Backing Up and Restoring the Solaris OS With "ufsdump"Yazid Mohamed, August 2006
This Tech Tip describes a backup and restore procedure for the Solaris 8 or 9 Operating System using the Backing Up the OS
1. For this example, we are using # init -s 2. Check the partition consistency. # fsck -m /dev/rdsk/c0t0d0s0 3. Verify the tape device status: # mt status
Or use this command when you want to specify the raw tape device, where # mt -f /dev/rmt/x status4. Back up the system: a) When the tape drive is attached to your local system, use this: # ufsdump 0uf /dev/rmt/0n /
b) When you want to back up from disk to disk, for example, if you want to back up # mkdir /tmp/backup # mount /dev/dsk/c0t1d0s0 /tmp/backup # ufsdump 0f - / | (cd /tmp/backup;ufsrestore xvf -)
c) When you want to back up to a remote tape, use this. On a system that has a tape drive, add the following line to its hostname root
where hostname is the name or IP of the system that will run # ufsdump 0uf remote_hostname:/dev/rmt/0n / Restoring the OS
1. For this example, your OS disk is totally corrupted and replaced with a new disk. Go to the ok> boot cdrom -s 2. Partition your new disk in the same way as your original disk.
3. Format all slices using the # newfs /dev/rdsk/c0t0d0s0
4. Make a new directory in # mkdir /tmp/slice0
5. Mount # mount /dev/dsk/c0t0d0s0 /tmp/slice0 6. Verify the status of the tape drive: # mt status If the tape drive is not detected, issue the following command: # devfsadm -c tape or # drvconfig # tapes # devlinks Verify the status of tape drive again and make sure the backup tape is in the first block or file number is zero. Use the following command to rewind the backup tape: # mt rewind
7. Go into the # cd /tmp/slice0 # ufsrestore rvf /dev/rmt/0n
If you want to restore from another disk (such as # mkdir /tmp/backup # mount /dev/dsk/c0t1d0s0 /tmp/backup # ufsdump 0f - /tmp/backup | (cd /tmp/slice0;ufsrestore xvf -)
8. After restoring all the partitions successfully, install bootblock to make the disk bootable. This example assumes your # cd /tmp/slice0/usr/platform/'uname -m'/lib/fs/ufs # installboot bootblk /dev/rdsk/c0t0d0s0 9. To finish restoring your OS, reboot the system.
The information and links on this page have been provided by a BigAdmin user. The submitter is solely responsible for such information and links. Sun is not responsible for the availability of external sites or resources, and does not endorse and is not responsible or liable for any content, advertising, products, or other materials on or available from such sites or resources. Sun will not be responsible or liable, directly or indirectly, for any actual or alleged damage or loss caused by or in connection with use of or reliance on the information posted here, or goods or services available on or through any external site or resource. Unless otherwise licensed, code in all technical manuals herein (including articles, FAQs, samples) is provided under this License. |
| |||