Linux: How to backup and restore file system

One method to move filesystems around, particularly if you are moving your root filesystem, is to use dump. Dump is a lower level backup program than tar, but this also makes dump quicker, because it doesn’t have all of the overhead. Another advantage is that depth of directories, symlinks, etc. aren’t a big deal. In the following example, /dev/sda3 is the root filesystem of a tricked out LFS install, but we are running a Red Hat install off of /dev/hda3.

# /sbin/dump -0 -j -f /backuplfs.dump /dev/sda3
DUMP: Date of this level 0 dump: Tue Jan 7 11:53:13 2003
DUMP: Dumping /dev/sda3 (an unlisted file system) to /backuplfs.dump
DUMP: Added inode 7 to exclude list (resize inode)
DUMP: Label: none
DUMP: Compressing output at compression level 2 (bzlib)
DUMP: mapping (Pass I) [regular files]
DUMP: mapping (Pass II) [directories]
DUMP: estimated 1244488 tape blocks.
DUMP: Volume 1 started with block 1 at: Tue Jan 7 11:53:36 2003
DUMP: dumping (Pass III) [directories]
DUMP: dumping (Pass IV) [regular files]
DUMP: 18.93% done at 785 kB/s, finished in 0:21
DUMP: 38.23% done at 792 kB/s, finished in 0:16
DUMP: 51.35% done at 710 kB/s, finished in 0:14
DUMP: 62.18% done at 644 kB/s, finished in 0:12
DUMP: 74.95% done at 621 kB/s, finished in 0:08
DUMP: 90.76% done at 627 kB/s, finished in 0:03
DUMP: 100.00% done at 599 kB/s, finished in 0:00
DUMP: Closing /backuplfs.dump
DUMP: Volume 1 completed at: Tue Jan 7 12:30:45 2003
DUMP: Volume 1 took 0:37:09
DUMP: Volume 1 transfer rate: 234 kB/s
DUMP: Volume 1 1342210kB uncompressed, 523693kB compressed, 2.563:1
DUMP: 1342210 tape blocks (1310.75MB) on 1 volume(s)
DUMP: finished in 2229 seconds, throughput 602 kBytes/sec
DUMP: Date of this level 0 dump: Tue Jan 7 11:53:13 2003
DUMP: Date this dump completed: Tue Jan 7 12:30:45 2003
DUMP: Average transfer rate: 234 kB/s
DUMP: Wrote 1342210kB uncompressed, 523693kB compressed, 2.563:1
DUMP: DUMP IS DONE

You can get dump here. To restore the above system, we created a fresh filesystem, mounted it, changed the current directory to the root of the mount, and ran restore:

# restore rf /backuplfs.dump

Leave a Reply

Your email address will not be published. Required fields are marked *

CAPTCHA * Time limit is exhausted. Please reload the CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.