使用 dump/restore 备份和恢复单个文件:

     #dump -0S /dev/sda1 /* 首先使用 dump 确认备份所需空间,查看一个 0 级别备份所需字节数 */

    # dump -0u -f /var/tmp/dump_sda1 /dev/sda1  //首先确认 /var/tmp 目录有足够空间,将 /dev/sda1 备份到 dump_sda1

    # cat /etc/dumpdates                                      //查看完成备份的时间戳

    # restore -tf /var/tmp/dump_sda1                   // 使用 restore 检查备份文件的内容

    # mkdir /tmp/restored;cd /tmp/restored

    # restore -if /var/tmp/dump_sda1                  // 使用 restore 的互动模式恢复特定文件到一个目录

    restore > help

    Available commands are:

     ls [arg] - list directory

     cd arg - change directory

     pwd - print current directory

     add [arg] - add `arg' to list of files to be extracted

     delete [arg] - delete `arg' from list of files to be extracted

     extract - extract requested files

     setmodes - set modes of requested directories

     quit - immediately exit program

     what - list dump header information

     verbose - toggle verbose flag (useful with ``ls'')

     prompt - toggle the prompt display

     help or `?' - print this list

    If no `arg' is supplied, the current directory is used

    restore > ls

    .:

    System.map initrd-2.4.20-8.img module-info-2.4.20-8

    System.map-2.4.20-8 kernel.h os2_d.b

    boot.b lost+found/ vmlinux-2.4.20-8

    chain.b message vmlinuz

    config-2.4.20-8 message.ja vmlinuz-2.4.20-8

    grub/ module-info

    restore > add boot.b                               // 添加要恢复的文件   

   restore > add message

    restore > extract                                         // 使用 extract 命令恢复选中的文件,设置下个卷名为 1,不设所有者模式 

    restore > quit

  #ls

    通过上面的步骤相信你已经能够自己搞定咯! 祝贺你。

 

本文来自ChinaUnix博客,如果查看原文请点http://blog.chinaunix.net/u1/41036/showart_333096.html