Sun Cluster 3.0 Installation Guide

How to Mirror the Root (/) File System

Use this procedure to mirror the root (/) file system.

  1. Become superuser on a node of the cluster.

  2. Use the metainit(1M) command to put the root slice in a single-slice (one-way) concatenation.


    # metainit -f submirror1 1 1 root-disk-slice
    
  3. Create a second concatenation.


    # metainit -f submirror2 1 1 submirror-disk-slice
    
  4. Create a one-way mirror with one submirror.


    Note -

    The metadevice name for the mirror must be unique throughout the cluster.



    # metainit mirror -m submirror1
    
  5. Run the metaroot(1M) command.

    This command edits the /etc/vfstab and /etc/system files so the system can be booted with the root (/) file system on a metadevice.


    # metaroot mirror
    
  6. Run the lockfs(1M) command.

    This command flushes all transactions out of the log and writes the transactions to the master file system on all mounted UFS file systems.


    # lockfs -fa
    
  7. Evacuate any resource groups or device groups from the node.


    # scswitch -S -h node
    
    -S

    Evacuates all resource groups and device groups

    -h node

    Specifies the name of the node from which to evacuate resource or device groups

  8. Reboot the node.


    # shutdown -g 0 -y -i 6
    
  9. Use the metattach(1M) command to attach the second submirror to the mirror.


    # metattach mirror submirror2
    
  10. If the disk used to mirror the root disk is physically connected to more than one node (multiported), enable the localonly property of the raw disk device group for the disk used to mirror the root disk.

    You must enable the localonly property to prevent unintentional fencing of a node from its boot device if the boot device is connected to multiple nodes.

    1. If necessary, use the scdidadm -L command to display the full device ID (DID) pseudo-driver name of the raw disk device group.

      In the following example, the raw disk device group name dsk/d2 is part of the third column of output, which is the full DID pseudo-driver name.


      # scdidadm -L
      ...
      1         phys-schost-3:/dev/rdsk/c1t1d0     /dev/did/rdsk/d2
      # scconf -c -D name=dsk/d2,localonly=true
      

      For more information about the localonly property, refer to the scconf_dg_rawdisk(1M) man page.

    2. Use the scconf(1M) command to enable the localonly property.


      # scconf -c -D name=rawdisk_groupname,localonly=true
      
      -D name=rawdisk_groupname

      Specifies the name of the raw disk device group

  11. Record the alternate boot path for possible future use.


    # ls -l /dev/rdsk/root-disk-slice
    
  12. Repeat Step 1 through Step 11 on each remaining node of the cluster.

    Ensure that each metadevice name for a mirror is unique throughout the cluster.

Example--Mirroring the Root (/) File System

The following example shows creation of mirror d0 on the node phys-schost-1, which consists of submirror d10 on partition c0t0d0s0 and submirror d20 on partition c2t2d0s0. Disk c2t2d0 is a multiported disk, so the localonly property is enabled.


(Create the mirror:)
# metainit -f d10 1 1 c0t0d0s0
d11: Concat/Stripe is setup
# metainit -f d20 1 1 c2t2d0s0
d12: Concat/Stripe is setup
# metainit d0 -m d10
d10: Mirror is setup
# metaroot d0
# lockfs -fa
 
(Reboot the node:)
# scswitch -S -h phys-schost-1
# shutdown -g 0 -y -i 6
 
(Attach the second submirror:)
# metattach d0 d20
d0: Submirror d20 is attached
 
(Enable the localonly property of the mirrored disk's raw disk device group:)
# scconf -c -D name=dsk/d2,localonly=true
 
(Record the alternate boot path:)
# ls -l /dev/rdsk/c2t2d0s0
lrwxrwxrwx  1 root     root          57 Apr 25 20:11 /dev/rdsk/c2t2d0s0 -> 
../../devices/node@1/pci@1f,0/pci@1/scsi@3,1/disk@2,0:a,raw

Where to Go From Here

To mirror the global namespace, /global/.devices/node@nodeid, go to "How to Mirror the Global Namespace".