Dump and Restore
From Beakstar Wiki
Contents |
Saving a mount-point with dump to an archive file
dump -j9 -f/tmp/dump_boot /boot [root@sewerrat grub]# dump -j9 -f/tmp/dump_boot /boot DUMP: Date of this level dump: Mon Oct 3 10:31:34 2005 DUMP: Dumping /dev/md1 (/boot) to /tmp/dump_boot DUMP: Label: none DUMP: Writing 10 Kilobyte records DUMP: Compressing output at compression level 9 (bzlib) DUMP: mapping (Pass I) [regular files] DUMP: mapping (Pass II) [directories] DUMP: estimated 7372 blocks. DUMP: Volume 1 started with block 1 at: Mon Oct 3 10:31:34 2005 DUMP: dumping (Pass III) [directories] DUMP: dumping (Pass IV) [regular files] DUMP: Closing /tmp/dump_boot DUMP: Volume 1 completed at: Mon Oct 3 10:31:45 2005 DUMP: Volume 1 took 0:00:11 DUMP: Volume 1 transfer rate: 549 kB/s DUMP: Volume 1 7380kB uncompressed, 6041kB compressed, 1.222:1 DUMP: 7380 blocks (7.21MB) on 1 volume(s) DUMP: finished in 11 seconds, throughput 670 kBytes/sec DUMP: Date of this level dump: Mon Oct 3 10:31:34 2005 DUMP: Date this dump completed: Mon Oct 3 10:31:45 2005 DUMP: Average transfer rate: 549 kB/s DUMP: Wrote 7380kB uncompressed, 6041kB compressed, 1.222:1 DUMP: DUMP IS DONE [root@sewerrat grub]#
Restoring a file with interactive mode
[root@sewerrat /]# cd /tmp/t [root@sewerrat t]# ls -als total 12 4 drwxr-xr-x 2 root root 4096 Oct 3 10:32 . 8 drwxrwxrwt 15 root root 4096 Oct 3 10:33 .. [root@sewerrat t]# restore -i -a -f /tmp/dump_boot Dump tape is compressed. restore > ls .: System.map-2.6.12-1.1456_FC4 initrd-2.6.13-1.1526_FC4.img System.map-2.6.13-1.1526_FC4 kernel.h config-2.6.12-1.1456_FC4 lost+found/ config-2.6.13-1.1526_FC4 vmlinuz-2.6.12-1.1456_FC4 grub/ vmlinuz-2.6.13-1.1526_FC4 initrd-2.6.12-1.1456_FC4.img restore > add grub restore > add kernel.h restore > ls .: System.map-2.6.12-1.1456_FC4 initrd-2.6.13-1.1526_FC4.img System.map-2.6.13-1.1526_FC4 *kernel.h config-2.6.12-1.1456_FC4 lost+found/ config-2.6.13-1.1526_FC4 vmlinuz-2.6.12-1.1456_FC4 *grub/ vmlinuz-2.6.13-1.1526_FC4 initrd-2.6.12-1.1456_FC4.img restore > extract set owner/mode for '.'? [yn] y restore > quit [root@sewerrat t]# ls -als total 20 4 drwxr-xr-x 3 root root 4096 Oct 2 15:56 . 8 drwxrwxrwt 15 root root 4096 Oct 3 10:33 .. 4 drwxr-xr-x 2 root root 4096 Oct 2 16:29 grub 4 -rw-r--r-- 1 root root 549 Mar 12 2004 kernel.h [root@sewerrat t]# ls -als grub total 224 4 drwxr-xr-x 2 root root 4096 Oct 2 16:29 . 4 drwxr-xr-x 3 root root 4096 Oct 2 15:56 .. 4 -rw-r--r-- 1 root root 30 Sep 10 01:25 device.map 8 -rw-r--r-- 1 root root 7476 Sep 10 02:31 e2fs_stage1_5 8 -rw-r--r-- 1 root root 7300 Sep 10 02:31 fat_stage1_5 8 -rw-r--r-- 1 root root 6612 Sep 10 02:31 ffs_stage1_5 4 -rw------- 1 root root 838 Oct 2 16:29 grub.conf 4 -rw------- 1 root root 1018 Sep 28 19:36 grub.conf.backup 8 -rw-r--r-- 1 root root 6612 Sep 10 02:31 iso9660_stage1_5 8 -rw-r--r-- 1 root root 8096 Sep 10 02:31 jfs_stage1_5 0 lrwxrwxrwx 1 root root 9 Oct 3 10:33 menu.lst -> grub.conf 8 -rw-r--r-- 1 root root 6772 Sep 10 02:31 minix_stage1_5 4 -rw------- 1 root root 53 Sep 13 17:01 preset-menu.conf 12 -rw-r--r-- 1 root root 8980 Sep 10 02:31 reiserfs_stage1_5 4 -rw-r--r-- 1 root root 3194 May 23 18:22 splash.xpm.gz 4 -rw-r--r-- 1 root root 512 Sep 10 02:31 stage1 104 -rw-r--r-- 1 root root 101704 Sep 10 02:31 stage2 8 -rw-r--r-- 1 root root 6952 Sep 10 02:31 ufs2_stage1_5 8 -rw-r--r-- 1 root root 6228 Sep 10 02:31 vstafs_stage1_5 12 -rw-r--r-- 1 root root 8764 Sep 10 02:31 xfs_stage1_5 [root@sewerrat t]#
Encryption
Dumping a partion and running it through GPG
dump -0 -f - / |gpg --output /tmp/dump_boot.gpg -r mtwomey@beakstar.com -e -
The key has to be signed and valid of course.
Restoring from a GPG encrypted file
gpg -d dump_boot.gpg |restore -i -a -f-
