如何用ufsdump,ufsrestore去备份和恢复?

发表于:2007-06-09来源:作者:点击数: 标签:
[这个贴子最后由bear在2002/03/2710:57pm编辑] 如何用ufsrestore去备份根目录,var,usr目录 以及cot3d0sx上的目录(我的系统安置自c0t0d0s1上) sohu3370 回复于:2002-03-22 12:26:03 aswellas 是不是搞错了,你到底是想BACKUP还是RESTORE啊? ufsdump是ba

[这个贴子最后由bear在 2002/03/27 10:57pm 编辑]

如何用ufsrestore去备份 根目录,var,usr目录
以及cot3d0sx 上的目录(我的系统安置自c0t0d0s1上)


 sohu3370 回复于:2002-03-22 12:26:03
aswellas
是不是搞错了,你到底是想BACKUP还是RESTORE啊?
ufsdump是 backup,有联机修改的应该unmount文件系统再做,那你应该知道怎么做了吧
#ufsdump 0uf /dev/rmt/0 /var            ----(level 0 backup)
#ufsdump 0uf /dev/rmt/0 /dev/rdsk/c0t0d0s3

ufsrestore是 restore
恢复/ ,/var,/usr当然比较复杂,比如恢复/
#boot cdrom -s
#newfs /dev/rdsk/c0t0d0s0
#mount /dev/dsk/c0t0d0s0 /abc
#ufsrestore rf /dev/rmt/0
#cd /usr/platform/'uname -m'/lib/fs/ufs
#installboot bootblk /dev/rdsk/c0t0d0s0
#cd /
#unmount /abc
#init 6

呵呵!刚看过这部分内容,练习以下!


 aswellas 回复于:2002-03-22 12:55:10
好的多谢,好详细,我去试一下。
老师的力量是伟大的!

 czc9 回复于:2002-03-27 11:37:24
To restore the / (root) file system, boot from the Solaris CD-ROM and then run ufsrestore.
Note – If / (root), /usr, or the /var file system is unusable because of some type of corruption or damage, the system will not boot.
The following procedure demonstrates how to restore the / (root) file system on the boot disk c0t0d0s0.
1. Insert the Solaris 8 Software CD 1 of 2, and boot the CD-ROM with the single-user mode option.
ok boot cdrom -s
2. Create the new file system structure.
# newfs /dev/rdsk/c0t0d0s0
3. Mount the file system to an empty mount point directory, /a and change to that directory.
# mount /dev/dsk/c0t0d0s0 /a
# cd /a
4. Restore the / (root) file system from its backup tape.
# ufsrestore rf /dev/rmt/0
Note – Remember to always restore a file system starting with the level 0 backup tape and continuing with the next lowest level tape up through the highest level tape.
5. Remove the restoresymtable file.
# rm restoresymtable
6. Install the bootblk in sectors 1–15 of the boot disk. Change to the directory containing the bootblk, and run the installboot command.
# cd /usr/platform/`uname -m`/lib/fs/ufs
# installboot bootblk /dev/rdsk/c0t0d0s0
7. Unmount the new file system.
# cd / ; umount /a
8. Use the fsck command to check the restored file system.
# fsck /dev/rdsk/c0t0d0s0
9. Reboot the system.
# init 6
10. Perform a full backup of the file system. For example:
# ufsdump 0uf /dev/rmt/0 /dev/rdsk/c0t0d0s0
Note – Always back up the newly created file system, as ufsrestore repositions the files and changes the inode allocation. Restoring the /usr and /var File Systems To restore the /usr and /var file systems repeat the steps described above, except step 6. This step is required only when restoring the (/) root file system.
Restoring Regular File Systems
To restore a regular file system, (for example, /export/home, or /opt) back to disk, repeat the steps described above, except steps 1, 6, and 9. Example
# newfs /dev/rdsk/c#t#d#s#
# mount /dev/dsk/c#t#d#s# /mnt
# cd /mnt
# ufsrestore rf /dev/rmt/#
# rm restoresymtable
# cd /
# umount /mnt
# fsck /dev/rdsk/c#t#d#s#
# ufsdump 0uf /dev/rmt/# /dev/rdsk/c#t#d#s#


原文转自:http://www.ltesting.net