Sun Cluster System Administration Guide for Solaris OS

ProcedureHow to Restore a Root (/) File System That Was on a Solstice DiskSuite Metadevice or Solaris Volume Manager Volume

Use this procedure to restore a root (/) file system that was on a Solstice DiskSuite metadevice or a Solaris Volume Manager volume when the backups were performed. Perform this procedure under circumstances such as when a root disk is corrupted and replaced with a new disk. The node being restored should not be booted. Ensure that the cluster is running without errors before performing the restore procedure.


Note –

Because you must partition the new disk by using the same format as the failed disk, identify the partitioning scheme before you begin this procedure, and recreate file systems as appropriate.


The phys-schost# prompt reflects a global-cluster prompt. Perform this procedure on a global cluster.

This procedure provides the long forms of the Sun Cluster commands. Most commands also have short forms. Except for the long and short forms of the command names, the commands are identical. For a list of the commands and their short forms, see Appendix B, Sun Cluster Object-Oriented Commands.

  1. Become superuser or assume a role that provides solaris.cluster.modifiy RBAC authorization on a cluster node with access to the disk set, other than the node you restoring.

    Use a node other than the node that you are restoring.

  2. Remove the hostname of the node being restored from all disksets.


    # metaset -s setname -f -d -h nodelist
    
    -s setname

    Specifies the metaset name.

    -f

    Deletes the last host from the disk set.

    -d

    Deletes from the metaset.

    -h nodelist

    Specifies the name of the node to delete from the metaset.

    -m mediator_host_list

    Specifies the name of the mediator host to add or delete from the disk set.

  3. Replace the failed disk on the node on which the root (/) file system will be restored.

    Refer to disk replacement procedures in the documentation that shipped with your server.

  4. Boot the node that you are restoring.

    • If you are using the Solaris OS CD, note the following:

      • SPARC: Type:


        ok boot cdrom -s
        
      • x86:Insert the CD into the system's CD drive and boot the system by shutting it down and then turning it off and on. In the Current Boot Parameters screen, type b or i.


                             <<< Current Boot Parameters >>>
        Boot path: /pci@0,0/pci8086,2545@3/pci8086,1460@1d/pci8086,341a@
        7,1/sd@0,0:a
        Boot args:
        
        Type b [file-name] [boot-flags] <ENTER> to boot with options
        or   i <ENTER>                          to enter boot interpreter
        or   <ENTER>                            to boot with defaults
        
                         <<< timeout in 5 seconds >>>
        Select (b)oot or (i)nterpreter: b -s
        
    • If you are using a Solaris JumpStartTM server, note the following:

      • SPARC: Type:


        ok boot net -s
        
      • x86:Insert the CD into the system's CD drive and boot the system by shutting it down and then turning it off and on. In the Current Boot Parameters screen, type b or i.


                             <<< Current Boot Parameters >>>
        Boot path: /pci@0,0/pci8086,2545@3/pci8086,1460@1d/pci8086,341a@
        7,1/sd@0,0:a
        Boot args:
        
        Type b [file-name] [boot-flags] <ENTER> to boot with options
        or   i <ENTER>                          to enter boot interpreter
        or   <ENTER>                            to boot with defaults
        
                         <<< timeout in 5 seconds >>>
        Select (b)oot or (i)nterpreter: b -s
        
  5. Create all the partitions and swap space on the root disk by using the format command.

    Re-create the original partitioning scheme that was on the failed disk.

  6. Create the root (/) file system and other file systems as appropriate, by using the newfs command

    Re-create the original file systems that were on the failed disk.


    Note –

    Ensure that you create the /global/.devices/node@nodeid file system.


  7. Mount the root (/) file system on a temporary mount point.


    # mount device temp-mountpoint
    
  8. Use the following commands to restore the root (/) file system.


    # cd temp-mountpoint
    # ufsrestore rvf dump-device
    # rm restoresymtable
    
  9. Install a new boot block on the new disk.


    # /usr/sbin/installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk 
    raw-disk-device
    
  10. Remove the lines in the /temp-mountpoint/etc/system file for MDD root information.


    * Begin MDD root info (do not edit)
    forceload: misc/md_trans
    forceload: misc/md_raid
    forceload: misc/md_mirror
    forceload: misc/md_hotspares
    forceload: misc/md_stripe
    forceload: drv/pcipsy
    forceload: drv/glm
    forceload: drv/sd
    rootdev:/pseudo/md@0:0,10,blk
    * End MDD root info (do not edit)
  11. Edit the /temp-mountpoint/etc/vfstab file to change the root entry from a Solstice DiskSuite metadevice or a Solaris Volume Manager volume to a corresponding normal slice for each file system on the root disk that is part of the metadevice or volume.


    Example: 
    Change from—
    /dev/md/dsk/d10   /dev/md/rdsk/d10    /      ufs   1     no       -
    
    Change to—
    /dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0  /      ufs   1     no       -
  12. Unmount the temporary file system, and check the raw disk device.


    # cd /
    # umount temp-mountpoint
    # fsck raw-disk-device
    
  13. Remove the node being restored from the mediator host list of the disk set.


    # metaset -s setname -f -d -m hostname
    
  14. Reboot the node in multiuser mode.


    # reboot
    
  15. Replace the device ID.


    # cldevice repair rootdisk
    
  16. Use the metadb command to recreate the state database replicas.


    # metadb -c copies -af raw-disk-device
    
    -c copies

    Specifies the number of replicas to create.

    -af raw-disk-device

    Creates initial state database replicas on the named raw disk device.

  17. From a cluster node other than the restored node, add the restored node to all disksets.


    phys-schost-2# metaset -s setname -a -h nodelist
    
    -a

    Adds (creates) the metaset.

    Set up the metadevice or volume/mirror for root ( /) according to the Solstice DiskSuite documentation.

    The node is rebooted into cluster mode. The cluster is ready to use.


Example 12–7 Restoring a Root (/) File System That Was on a Solstice DiskSuite Metadevice or Solaris Volume Manager Volume

The following example shows the root (/) file system restored to the node phys-schost-1 from the tape device /dev/rmt/0. The metaset command is run from another node in the cluster, phys-schost-2, to remove and later add back node phys-schost-1 to the metaset schost-1. All other commands are run from phys-schost-1 . A new boot block is created on /dev/rdsk/c0t0d0s0, and three state database replicas are recreated on /dev/rdsk/c0t0d0s4 .


[Become superuser or assume a role that provides solaris.cluster.modify RBAC authorization on a cluster node with access to the metaset, other than the node to be restored.]
[Remove the node from the metaset:]
phys-schost-2# metaset -s schost-1 -f -d -h phys-schost-1
[Replace the failed disk and boot the node:]

Boot the node from the Solaris OS CD:


[Use format and newfs to recreate partitions and file systems
.]
[Mount the root file system on a temporary mount point:]
# mount /dev/dsk/c0t0d0s0 /a
[Restore the root file system:]
# cd /a
# ufsrestore rvf /dev/rmt/0
# rm restoresymtable
[Install a new boot block:]
# /usr/sbin/installboot /usr/platform/`uname \
-i`/lib/fs/ufs/bootblk /dev/rdsk/c0t0d0s0

[Remove the lines in / temp-mountpoint/etc/system file for MDD root information:
]
* Begin MDD root info (do not edit)
forceload: misc/md_trans
forceload: misc/md_raid
forceload: misc/md_mirror
forceload: misc/md_hotspares
forceload: misc/md_stripe
forceload: drv/pcipsy
forceload: drv/glm
forceload: drv/sd
rootdev:/pseudo/md@0:0,10,blk
* End MDD root info (do not edit)
[Edit the /temp-mountpoint/etc/vfstab file]
Example: 
Change from—
/dev/md/dsk/d10   /dev/md/rdsk/d10    /      ufs   1     no       -

Change to—
/dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0  /usr   ufs   1     no       -
[Unmount the temporary file system and check the raw disk device:]
# cd /
# umount /a
# fsck /dev/rdsk/c0t0d0s0
[Reboot:]
# reboot
[Replace the disk ID:]
# cldevice repair /dev/rdsk/c0t0d0
[Re-create state database replicas:]
# metadb -c 3 -af /dev/rdsk/c0t0d0s4
[Add the node back to the metaset:]
phys-schost-2# metaset -s schost-1 -a -h phys-schost-1