A Recovery CD for the Solaris OS and VERITAS NetBackup SoftwareRob Hammar, December 2004 Contents:
OverviewThis paper documents a method for building and using a recovery CD for the Solaris Operating System. This CD can be used to restore root file systems without having to install the OS on an alternate boot disk or configure and use a Solaris JumpStart server (as described in the BigAdmin Community-Submitted document "Restoring the Solaris OS From VERITAS NetBackup Software"). The BigAdmin Community-Submitted article "UberJS: A More Flexible Solaris JumpStart System" provided much of the information regarding the modification of the Solaris installation CD that is used in this process. If for some reason this process does not work in your environment, I would suggest reviewing these documents, as well as the documents they reference, for ideas.
The basic idea is to build a bootable CD that will allow the installation of the VERITAS NetBackup client software. Since some of the files in This process assumes a fairly basic NetBackup configuration with a single NetBackup master server that is also the only media server as well. This process is not suited for situations where the target server is also a NetBackup media server although other ways to make it work may exist in this situation as well. Extracting the Slices From the Solaris 9 Software CDThe layout of the Solaris 9 Software CD looks like this: Slice Contents 0 Solaris_9 Directory which contains installation products 1 Generic Solaris Kernel + root directory structure 2 boot for sun4c 3 boot for sun4m 4 boot for sun4d 5 boot for sun4u and sun4us Copy CD slice 0 to a directory on the hard drive. insert the Solaris 9 Software CD 1 of 2 in the CDROM drive. mkdir -p /SolarisCD/s0 cd /cdrom/cdrom0/s0 find . -print | cpio -pdm /SolarisCD/s0
Use /etc/init.d/volmgt stop dd if=/dev/dsk/c0t2d0s1 of=/SolarisCD/s1 bs=512 ; dd if=/dev/dsk/c0t2d0s2 of=/SolarisCD/s2 bs=512 ; dd if=/dev/dsk/c0t2d0s3 of=/SolarisCD/s3 bs=512 ; dd if=/dev/dsk/c0t2d0s4 of=/SolarisCD/s4 bs=512 ; dd if=/dev/dsk/c0t2d0s5 of=/SolarisCD/s5 bs=512 ; /etc/init.d/volmgt stop Modifying the CD Images
Since the kernel and root directories are on slice 1 we must mount it using the mkdir /tmp/slice lofiadm -a /SolarisCD/Sol9.s1 /dev/lofi/1 mount /dev/lofi/1 /mnt/slice
The file system The following files need to have entries appended to them in order to allow the NetBackup client services to start.
To the file # # OpenV*NetBackup services # bpcd 13782/tcp bpcd vopied 13783/tcp vopied bpjava-msvc 13722/tcp bpjava-msvc bprd 13720/tcp bprd
To the file
bpcd stream tcp nowait root /usr/openv/netbackup/bin/bpcd bpcd
vopied stream tcp nowait root /usr/openv/bin/vopied vopied
bpjava-msvc stream tcp nowait root \
/usr/openv/netbackup/bin/bpjava-msvc bpjava-msvc -transient
vnetd stream tcp nowait root /usr/openv/bin/vnetd vnetd
Create a file echo "+" > /mnt/slice/etc/.rhost This allows the NetBackup server to install the rest of the client software later. Create a directory to be used as a mount point for the NetBackup client software. mkdir /mnt/slice/usr/openv This concludes the changes that we will make to the CD image. These should be enough to allow us to boot from CD, plumb and configure network settings, start network services, install the NetBackup client software, and restore the file system to the boot disk. Creating the ISO ImageUnmount the ISO file system with the following commands: cd / umount /mnt/slice lofiadm 0d /dev/lofi/1
Use the following command to create an ISO file cd /SolarisCD mkisofs -R -d -L -l -sparc-boot Sol9.s1,Sol9.s2,Sol9.s3,Sol9.s4,Sol9.s5 \ -o sol9_boot.iso ./s0 Transfer the ISO file to a Windows or Linux client (we don't have CD writers on any of our UNIX hosts), and burn a copy of the new CD image. Insert the CD in the system you want to recover, and from the OBP prompt, type: boot cdrom -sw <enter> Using the CD for an OS RestoreTo use this CD to restore the root file systems, you need the following information:
Target Host Name ___________________________ Target Host IP ___________________________ Target Subnet Mask ___________________________ Target Default Router ___________________________ Root disk partitions: ___________________________ ___________________________ ___________________________ ___________________________ ___________________________ ___________________________ NetBackup Master Name ___________________________ NetBackup Master IP ___________________________ Once the system comes up in single user mode, you need to plumb, configure and start the network services. ifconfig hme0 inet <ip_address_of_target_host> ifconfig hme0 netmask <netmask_of_target_host> ifconfig hme0 up route add default <default_router_of_target_host>
So that the target host responds correctly to the hostname <hostname of the target host>
Test the network connection to and from the NetBackup master server using
Edit the Start the network services that will be needed. /etc/init.d/inetsvc start Prepare a file system to hold the NetBackup client software: newfs /dev/dsk/c0t0d0s7 #(or wherever your swap partition was) mount /dev/dsk/c0t0d0s7 /usr/openv From the NetBackup master server, push the NetBackup client software to the target host. You'll receive a couple of warnings regarding X-windows config files that are on read-only file systems, but they should not cause any problems.
Run the newfs /dev/dsk/c0t0d0s0 # / (root) file system newfs /dev/dsk/c0t0d0s1 # /etc newfs /dev/dsk/c0t0d0s3 # /opt . . .
Mount the root file system on the target host on mount /dev/dsk/c0t0d0s0 /a # / (root) file system mount /dev/dsk/c0t0d0s1 /a/etc # /etc file system mount /dev/dsk/c0t0d0s3 /a/opt # /opt file system . . .
From the NetBackup master server, configure and run a restore of the file systems on the target server, specifying the file systems mounted under
You may receive one error message indicating that NetBackup was not able to create the Once the restore job finishes, if the root drives were mirrored using Solstice DiskSuite, Sun Volume Manager, or VERITAS Volume Manager software, you need to follow the recommended procedure for recovering the mirrored configuration. Installing the Boot BlockIf you're using this procedure because you had to replace a failed hard drive, you need to reinstall the boot block. /usr/sbin/installboot /a/usr/platform/`uname -i`/lib/fs/ufs/bootblk \ /dev/rdsk/c0t0d0s0 Recovery Using VERITAS Volume Manager MirrorIf your original root disk was mirrored using VERITAS Volume Manager, follow the instructions in the VXVM Troubleshooting guide to recover the mirror. You may also want to refer to SunSolve document 77912: This includes an extra step that's missing in the copy of the VXVM Troubleshooting Guide that I have. Recovery Using Solaris DiskSuite and Solaris Volume Manager SoftwareIf your original root disk was mirrored using Solaris DiskSuite software, follow the instructions on SunSolve document 18119 to recreate delete and recreate the mirrors. (Please note: Document is password protected and can only be viewed by users with a valid Sun Support Contract.) ReferencesBigAdmin Community-Submitted Article: UberJS: A More Flexible Solaris JumpStart System BigAdmin Community-Submitted Article: Restoring the Solaris OS From VERITAS NetBackup Software About the AuthorRob Hammar has 21 years of IT experience in the following: SAP R/3 Basis Administration, SAP Business Warehouse Basis Administration, EMC Symmetrix Administration, Database Administration (Oracle, DB2, Sybase, SQL Server, Informix and Ingres), UNIX System Administration (Solaris OS, HP), Client Server Applications Development (Visual Basic, Visual C++), Mainframe System Administration/Systems Programing, Mainframe Cobol and ALC Programming, and Mainframe Operations.
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. |
| |||