This is some kind of a followup from the first post about ufsdump – how to backup solaris filesystem
1. Replace and partition the disk if it has failed.
2. Because the system cannot be booted from the boot disk, boot from the CD-ROM and re-create the failed file system by issuing the newfs command:
3. Check the new file system by using fsck:
4. Mount the new file system on a temporary mount point:
5. Change to the /mnt directory:
6. Write protect the tapes so that you don’t accidentally overwrite them.
7. Load the tape and issue the following command:
ufsrestore rf /dev/rmt/0
The entire content of the tape is restored to the file system. All permissions, ownerships, and dates remain as they were when the last incremental tape was created.
8. Verify that the file system is restored:
9. Remove the restoresymtable file that is created and used by ufsrestore to checkpoint the restoration:
10. Change to the root (/) directory:
11. Unmount the newly created file system:
12. Check the new file system with fsck:
The restored file system is checked for consistency.
13. If you are recovering the root (/) file system, create the boot blocks on the root partition by using the installboot command:
The installboot command installs the boot blocks onto the boot disk. Without the boot blocks, the disk cannot boot.
14. Insert a new tape into the tape drive and back up the new file system:
ufsdump 0uf /dev/rmt/n /dev/rdsk/
A level 0 backup is performed. You should immediately make a backup of a newly created file system because ufsrestore repositions the files and changes the inode allocation.
15. Reboot the system with a reconfiguration reboot:
# shutdown -y -g0 -i0
ok boot -r
The system is rebooted.
Extra Notes on UFSrestore
When you restore files in a directory other than the root directory of the file system, ufsrestore re-creates the file hierarchy in the current directory. For example, if you restore to /home files that were backed up from /users/bcalkins/files, the files are restored in the directory /home/users/bcalkins/files.
When you restore individual files and directories, it’s a good idea to restore them to a temporary directory such as /var/tmp. After you verify that you’ve retrieved the correct files, you can move them to their proper locations. You can restore individual files and directories to their original locations; however, if you do so, you should be sure that you do not overwrite newer files with older versions from the backup tape.
You should not forget to make regular backups of your operating system. Losing all the customization you dosuch as adding user accounts, setting up printers, and installing application softwarewould be disastrous. Whenever you make modifications that affect the root (/),/usr, /opt, or other operating system directories, you should bring down the system into single-user mode and perform a level 0 dump.