BigAdmin System Administration Portal
Community Submitted Article
Print-friendly VersionPrint-friendly Version
This content is submitted by a BigAdmin user. It has not been reviewed for technical accuracy by Sun Microsystems, though it may have been lightly edited to improve readability. If you find an error or would like to comment on the article, please contact the submitter or use the comment field at the bottom of the article. Community submissions may not follow Sun trademark guidelines. For information on Sun trademarks, please see http://www.sun.com/suntrademarks/.
 
 

A Recovery CD for the Solaris OS and VERITAS NetBackup Software

Rob Hammar, December 2004

Contents:

  • Overview
  • Extracting the Slices From the Solaris 9 Software CD
  • Modifying the CD Images
  • Creating the ISO Image
  • Using the CD for an OS Restore
  • Installing the Boot Block
  • Recovery Using VERITAS Volume Manager Mirror
  • Recovery Using Solaris DiskSuite and Solaris Volume Manager Software
  • References
  • About the Author

  • Overview

    This 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 /etc directory will remain "read only", it is necessary to add entries that the NetBackup client installation won't be able to customize. To provide a file system to install the NetBackup client software, the host's swap partition will be formatted with newfs and mounted as /usr/openv.

    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 CD

    The 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 dd to copy slices 1 through 5:

    /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 lofiadm utility.

    mkdir /tmp/slice
    lofiadm -a /SolarisCD/Sol9.s1 /dev/lofi/1
    mount /dev/lofi/1 /mnt/slice
    

    The file system /mnt/slice is where the files we'll be modifying are located. The files that are located in /mnt/slice/.tmp_proto are copied to /tmp directory during the boot process. This is a useful thing to know since /tmp is the only writeable file system when first booted from the CD.

    The following files need to have entries appended to them in order to allow the NetBackup client services to start.

    To the file /mnt/slice/etc/services add the following lines:

    #
     # OpenV*NetBackup services
     #
    bpcd    13782/tcp       bpcd
    vopied  13783/tcp       vopied
    bpjava-msvc     13722/tcp       bpjava-msvc
    bprd    13720/tcp       bprd
    

    To the file /mnt/slice/etc/inetd.conf add the following lines:

    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 /mnt/slice/etc/.rhost with one line:

    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 Image

    Unmount 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 sol9_boot.iso containing all of the images:

    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 Restore

    To use this CD to restore the root file systems, you need the following information:

    • Hostname, IP address, and subnet mask of the host you're attempting to restore
    • Root hard drive partition information of the host you're attempting to restore, including the partition used for swap. The swap partition will be formatted, mounted, and used to hold the NetBackup client software.
    • Default router of the network segment that the destination host is located on
    • Hostname and IP address of the NetBackup Master
    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 command, enter the following command:

    hostname <hostname of the target host>
    

    Test the network connection to and from the NetBackup master server using ping and traceroute. If they both work, your network configuration should be in good shape.

    Edit the /etc/hosts file and add entries for the target host and the NetBackup master server.

    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 utility to format the disk slices that the OS will be restored on.

    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 /a. If there are other dependent file systems to restore (/usr, /opt, /var) mount them on top of /a.

    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 /a as the alternate target directories. Be sure to select the option to rename hard links, and to not select the option to rename soft links.

    You may receive one error message indicating that NetBackup was not able to create the /a directory. This will result in an error message at the end, indicating that the restore was partially successful. If no other error messages occur, this is not a problem.

    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 Block

    If 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 Mirror

    If 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 Software

    If 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.)


    References

    BigAdmin Community-Submitted Article: UberJS: A More Flexible Solaris JumpStart System

    BigAdmin Community-Submitted Article: Restoring the Solaris OS From VERITAS NetBackup Software


    About the Author

    Rob 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.


BigAdmin