nanaskylead 回复于:2004-01-19 09:32:31 |
是原创就顶!! |
C.Arthur 回复于:2004-01-19 09:33:09 |
鼓励一下,多发精品 |
nanaskylead 回复于:2004-01-19 09:39:22 |
可以发到你的工作小技巧里更好。 |
wuzhengok 回复于:2004-01-19 09:42:46 |
那就麻烦斑竹挪一下位置吧 :) |
C.Arthur 回复于:2004-01-19 09:47:22 |
发到http://bbs.chinaunix.net/forum/6/20031125/209485.html里面吧 |
alinker 回复于:2004-01-19 09:47:53 |
wonderful, up |
diag 回复于:2004-01-19 10:18:47 |
怎么才能。用磁带
恢复 系统文件??? 用你的方法不成的。。 |
flighttop 回复于:2004-01-19 10:33:15 |
mt -f /dev/rmt/0n fsf N means that the DAT tape drive forwards N files and doesn't rewind. In case you want to restore a specific file,you can use the interactive mode to find the file you want. |
wuzhengok 回复于:2004-01-19 10:37:05 |
[quote:b4c6aac037="diag"]怎么才能。用磁带
恢复 系统文件??? 用你的方法不成的。。[/quote:b4c6aac037] 具体怎么恢复系统文件,可以参见SA238I的ufsrestore恢复root filesystem。 |
diag 回复于:2004-01-19 10:49:08 |
这个超慢的。。
17-16 Solaris 8™Operating Environment System Administration I Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services June 2000, RevisionA Restoring the root(/) File System 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 17 Backup and Recovery 17-17 Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services June 2000, RevisionA 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# 17 17-18 Solaris 8™Operating Environment System Administration I Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services June 2000, RevisionA Invoking an Interactive Restore The ufsrestore i-i command invokes an interactive interface for browsing through the backup tape’s directory hierarchy and selects individual files to be extracted. 1. Become root and change to a temporary directory to place the extracted files. # cd /var/tmp 2. Invoke the ufsrestore command with the interactive option. # ufsrestore ivf /dev/rmt/0 Verify volume and initialize maps Media block size is 64 Dump date: Mon June 01 15:17:09 2000 Dumped from: the epoch Level 0 dump of / on host1:/dev/dsk/c0t3d0s0 Label: none Extract directories from tape Initialize symbol table. 3. Display the contents of the directory structure on the backup tape. ufsrestore > ls 2 *./ 39 devices/ 30847 net/ 2 *../ 5122 etc/ 15360 opt/ 161 .Xauthority 5120 export/ 25611 proc/ 160 .Xdefaults 10240 home/ 15381 sbin/ 159 .rhosts 40 kadb 35863 tmp/ 3085 .wastebasket/ 25608 kernel/ 30848 tmp_mnt/ 3 bin 35 lib 20480 usr/ 3087 cdrom/ 3 lost+found/ 25600 var/ 25610 dev/ 20503 mnt/ To change directories on the backup tape: ufsrestore > cd etc/inet ufsrestore > ls 4. Add any file to be restored to the extraction list. ufsrestore > add inetd.conf hosts 17 Files to be restored are marked with an asterisk (*) for extraction. If you are extracting a directory, all of its contents are marked for extraction. In this example, two files are marked for extraction; and the ls command displays an asterisk in front of the selected file names: *hosts and *inetd.conf. To delete a file from the extraction list, use the delete command: ufsrestore > delete inetd.conf The ls command displays inetd.conf without an asterisk. 5. To restore the selected file(s) from the backup tape: ufsrestore > extract Extract requested files You have not read any volumes yet. Unless you know which volume your file(s) are on you should start with the last volume and work towards the first. Specify next volume #: 1 extract file ./etc/inet/hosts Add links Set directory mode, owner, and times. set owner/mode for ‘.’? [yn] n 6. Exit the interactive restore once the files are extracted. ufsrestore> quit 7. Check the restored files, move them to their original or permanent directory location, and delete the files from the temporary directory. # mv /var/tmp/etc/inet/hosts /etc/inet/hosts # rm -r /var/tmp/etc |