Tuesday, July 2, 2013

How to Take / Filesystem Backup Using Dump and Restore It

In our server (RHEL5) , / filesystem has gone to read only mode. 
Before running the fsck, I need to know how to take root system backup and restore using dump, in case of data failure. 
Is dump a best option or any other way?
"dump" is good because you don't want to backup many filesystem together 

also "cpio" is very nice command. 

You can execute "fsck" and you can answer "no" to "fsck" questions for data 

I had the same problem before and this is what I did to resolve the problem 
Umount the filesystem that has gone read only 
fsck -y filesystem
Reboot the system in single user mode, edit the /etc/fstab there 5th and 6th columns: Dump and fsck options, turn off the fsck for / partition boot the system in normal mode and now take the backup if you need then run fsck. 

/dev/hda2 / ext2 defaults 1 1 

/dev/hda2 / ext2 defaults 1 (1 is default change to 0) 
The three major backup program are cpio, tar and dump. I explain each of them very shortly in the following: 
Dump and restore 
dump is a traditional unix backup programDump only can backup entire file system and can not get backup from part of file system or specific directory tree. You can restore the data by restore command which by default expand the backup data to the /tmp. 
The major thing around this type of backup tool is: it does not store the files and directories, but instead backup in a block level. It means, blocks are copies to the backup media(tape, ...) not file and directories. 
The major difference of tar with dump is, tar stores files and directories, in contrast to storing block of the files. In other words, tar is file level backup tool, but dump is block level. 
cpio is the original UNIX file interchange tape program for magnetic media. some advantages of cpio over tar is: 
  • Preserve hard link 
  • Does not annoying file length limitation
  • Preserves timestamps
  • etc...
Which is better??? 
The clear solusion to backing up all of your data and peculiarities of UNIX file system, is dump. See http://www.coredumps.de/doc/dump/zwicky/testdump.d oc.html. 

This web site, test several important backup tools in Unix included dump, and show the comparison result. Its very useful, check it. 
Sorry for my external link. The dot at the end of the URL rised "Page Not Found Error"
see: http://www.coredumps.de/doc/dump/zwicky/testdump.d oc.html
try rsync 

you can run a full first time backup and the run using cron rsync 
nightly to bring it up to date seeman rsync 


Post a Comment

Design by BABU | Dedicated to grandfather | welcome to BABU-UNIX-FORUM