[iyunv@localhost ~]# dump -S /boot
16752640
[iyunv@localhost ~]# dump -u -0 -f /root/boot.dump.0 /boot
DUMP: Date of this level 0 dump: Fri Feb 28 15:05:56 2014
DUMP: Dumping /dev/sda1 (/boot) to /root/boot.dump.0
DUMP: Label: /boot
DUMP: Writing 10 Kilobyte records
DUMP: mapping (Pass I) [regular files]
DUMP: mapping (Pass II) [directories]
DUMP: estimated 16360 blocks.
DUMP: Volume 1 started with block 1 at: Fri Feb 28 15:05:56 2014
DUMP: dumping (Pass III) [directories]
DUMP: dumping (Pass IV) [regular files]
DUMP: Closing /root/boot.dump.0
DUMP: Volume 1 completed at: Fri Feb 28 15:05:58 2014
DUMP: Volume 1 16440 blocks (16.05MB)
DUMP: Volume 1 took 0:00:02
DUMP: Volume 1 transfer rate: 8220 kB/s
DUMP: 16440 blocks (16.05MB) on 1 volume(s)
DUMP: finished in 2 seconds, throughput 8220 kBytes/sec
DUMP: Date of this level 0 dump: Fri Feb 28 15:05:56 2014
DUMP: Date this dump completed: Fri Feb 28 15:05:58 2014
DUMP: Average transfer rate: 8220 kB/s
DUMP: DUMP IS DONE
[iyunv@localhost ~]# cat /etc/dumpdates
/dev/sda1 0 Fri Feb 28 15:05:56 2014 +0800
=>可以看出etc/dumpdates记录着这次备份信息
举例2:查看文件系统备份记录
[iyunv@localhost ~]# dump -W
Last dump(s) done (Dump '>' file systems):
> /dev/sda2 ( /) Last dump: never
> /dev/sda3 ( /home) Last dump: never
/dev/sda1 ( /boot) Last dump: Level 0, Dat
> /dev/sda6 (/mnt/sda6) Last dump: never
=>可以看出sda1已经进行了level0备份,其他还未备份
举例3:增量备份 level 1
[iyunv@localhost ~]# dd if=/dev/zero of=/boot/bigfile.img bs=1M count=20
20+0 records in
20+0 records out
20971520 bytes (21 MB) copied, 0.320717 seconds, 65.4 MB/s
=>先创建一个20M左右的文件
[iyunv@localhost ~]# dump -u -1 -f /root/boot.dump.1 /boot
DUMP: Date of this level 1 dump: Fri Feb 28 15:17:51 2014
DUMP: Date of last level 0 dump: Fri Feb 28 15:05:56 2014
DUMP: Dumping /dev/sda1 (/boot) to /root/boot.dump.1
DUMP: Label: /boot
DUMP: Writing 10 Kilobyte records
DUMP: mapping (Pass I) [regular files]
DUMP: mapping (Pass II) [directories]
DUMP: estimated 20543 blocks.
DUMP: Volume 1 started with block 1 at: Fri Feb 28 15:17:52 2014
DUMP: dumping (Pass III) [directories]
DUMP: dumping (Pass IV) [regular files]
DUMP: Closing /root/boot.dump.1
DUMP: Volume 1 completed at: Fri Feb 28 15:17:53 2014
DUMP: Volume 1 20580 blocks (20.10MB)
DUMP: Volume 1 took 0:00:01
DUMP: Volume 1 transfer rate: 20580 kB/s
DUMP: 20580 blocks (20.10MB) on 1 volume(s)
DUMP: finished in 1 seconds, throughput 20580 kBytes/sec
DUMP: Date of this level 1 dump: Fri Feb 28 15:17:51 2014
DUMP: Date this dump completed: Fri Feb 28 15:17:53 2014
DUMP: Average transfer rate: 20580 kB/s
DUMP: DUMP IS DONE
[iyunv@localhost ~]# cat /etc/dumpdates
/dev/sda1 0 Fri Feb 28 15:05:56 2014 +0800
/dev/sda1 1 Fri Feb 28 15:17:51 2014 +0800
=>这次配备写入备份记录中
[iyunv@localhost ~]# dump -W
Last dump(s) done (Dump '>' file systems):
> /dev/sda2 ( /) Last dump: never
> /dev/sda3 ( /home) Last dump: never
/dev/sda1 ( /boot) Last dump: Level 1, Date Fri Feb 28 15:17:51 2014
> /dev/sda6 (/mnt/sda6) Last dump: never
[iyunv@localhost ~]# ll /root/boot*
-rw-r--r-- 1 root root 16834560 02-28 15:05 /root/boot.dump.0
-rw-r--r-- 1 root root 21073920 02-28 15:17 /root/ boot.dump.1
=> boot.dump.1大小约为20M,可见是增量备份
举例4:单一目录进行备份
[iyunv@localhost ~]# dump -0 -f /root/etc.dump /etc
DUMP: Date of this level 0 dump: Fri Feb 28 15:23:39 2014
DUMP: Dumping /dev/sda2 (/ (dir etc)) to /root/etc.dump
DUMP: Label: /
DUMP: Writing 10 Kilobyte records
DUMP: mapping (Pass I) [regular files]
DUMP: mapping (Pass II) [directories]
DUMP: estimated 177675 blocks.
DUMP: Volume 1 started with block 1 at: Fri Feb 28 15:23:41 2014
DUMP: dumping (Pass III) [directories]
DUMP: dumping (Pass IV) [regular files]
DUMP: Closing /root/etc.dump
DUMP: Volume 1 completed at: Fri Feb 28 15:24:23 2014
DUMP: Volume 1 188600 blocks (184.18MB)
DUMP: Volume 1 took 0:00:42
DUMP: Volume 1 transfer rate: 4490 kB/s
DUMP: 188600 blocks (184.18MB) on 1 volume(s)
DUMP: finished in 42 seconds, throughput 4490 kBytes/sec
DUMP: Date of this level 0 dump: Fri Feb 28 15:23:39 2014
DUMP: Date this dump completed: Fri Feb 28 15:24:23 2014
DUMP: Average transfer rate: 4490 kB/s
DUMP: DUMP IS DONE
[iyunv@localhost ~]# ll /root/etc.dump
-rw-r--r-- 1 root root 193126400 02-28 15:24 /root/etc.dump
[iyunv@localhost ~]# mv /boot/message /boot/message-back
[iyunv@localhost ~]# restore -C -f /root/boot.dump.0 -D /boot
Dump date: Fri Feb 28 15:05:56 2014
Dumped from: the epoch
Level 0 dump of /boot on localhost.localdomain:/dev/sda1
Label: /boot
filesys = /boot
restore: unable to stat ./message: No such file or directory
Some files were modified! 1 compare errors