Solaris Volume Manager Administration Guide

Procedurex86: How to Create a RAID-1 Volume From the root (/) File System by Using DCA

Steps
  1. Verify that the ordering for the BIOS boot device can be configured to allow the system to boot off of the second disk in the mirror.

    Before the kernel is started, the system is controlled by the read-only-memory (ROM) Basic Input/Output System (BIOS), which is the firmware interface on an x86 based system. The BIOS is analogous to the boot PROM on a SPARC based system. In addition to its other startup functions, the BIOS is responsible for finding the correct device to boot from and for loading the master boot record from the device that allows the system to boot itself. You can usually configure the BIOS to select the order of devices to probe for the boot record. Additionally, most modern BIOS implementations allow you to configure your devices so that the failover to the secondary submirror is automatic. If your system does not have this feature and the primary submirror fails, you need to access the BIOS while the system is booting and reconfigure it to boot from the secondary root slice. Consult the user's guide for your BIOS for instructions on how to configure settings in your BIOS.

    You can use the DCAon your system to verify that you can boot off of more than one disk. Some device drivers are configured to only see one disk on the system.

  2. Verify that the fdisk partitions are configured to support root mirroring.

    Another feature of x86 based systems is the use of fdisk partitions. The default boot-disk partition layout of the Solaris OS installation program creates a Solaris fdisk partition and another, small fdisk partition of about 10MB called the x86 boot partition.

    The x86 boot partition presents a problem when mirroring the root (/) file system. The x86 boot partition is outside of the Solaris fdisk partition. For that reason, the x86 boot partition cannot be mirrored by Solaris Volume Manager. Additionally, because only one copy of the x86 boot partition exists, it represents a single point of failure.

    You can determine if your Solaris OS has a separate x86 boot partition. The x86 boot partition is mounted in the /etc/vfstab file with an entry similar to the following:


    /dev/dsk/c2t1d0p0:boot  -       /boot   pcfs    -       no      -

    If the separate x86 boot partition does not exist, this entry does not appear in the /etc/vfstab file.

    In order to mirror the root (/) file system, you need to customize your fdisk partitions to delete the x86 boot partition and use the single Solaris fdisk partition. If you intend to use Solaris Volume Manager root mirroring, do not create a separate x86 boot partition during the system installation. If the system is already installed and a separate x86 boot partition was created, delete that fdisk partition using the fdisk command and reinstall the system. During installation, avoid creating a separate x86 boot partition by customizing your disk partitions during the installation process.


    Note –

    Solaris Volume Manager can only mirror slices within the Solaris fdisk partition If you have multiple fdisk partitions, you need to use another approach to protect the data outside of the Solaris fdisk partition.


  3. Make the secondary submirror bootable with a master boot program.

    1. Use the fdisk command to specify the master boot program.


      # fdisk -b /usr/lib/fs/ufs/mboot /dev/rdsk/c1t1d0p0
      

      The following screen appears:


                   Total disk size is 31035 cylinders
                   Cylinder size is 1146 (512 byte) blocks
      
                                                     Cylinders
            Partition   Status    Type          Start   End   Length    %
            =========   ======    ============  =====   ===   ======   ===
                1        Active   Solaris           1  31034    31034    100
      
      
      SELECT ONE OF THE FOLLOWING:
         1. Create a partition
         2. Specify the active partition
         3. Delete a partition
         4. Change between Solaris and Solaris2 Partition IDs
         5. Exit (update disk configuration and exit)
         6. Cancel (exit without updating disk configuration)
      Enter Selection: 
    2. Choose number 5 from the menu, and press return.

  4. Install bootblocks on the secondary submirror in order to make it bootable.

    Slice 8 on the disk where the secondary submirror resides is necessary for booting the Solaris OS from this fdisk partition. This slice holds the partition boot record (pboot), the Solaris VTOC for the disk, and the bootblock. This information is disk specific, so it is not mirrored with Solaris Volume Manager. However, you must ensure that both disks are bootable so that you can boot from the secondary disk if the primary fails. Use the installboot command to setup the second disk as a Solaris bootable disk. See the installboot(1M) man page for more information.

    You must specify slice 2 of the disk as the device, and slice 2 must comprise the entire disk.


    # installboot /usr/platform/i86pc/lib/fs/ufs/pboot \
    /usr/platform/i86pc/lib/fs/ufs/bootblk /dev/rdsk/c1t1d0s2
    
  5. Identify the slice that contains the existing root (/) file system to be mirrored. This example uses the slice c1t0d0s0.

  6. Create a new RAID-0 volume on the slice from the previous step by using one of the following methods. Only the single slice can be included in the RAID-0 volume.

    • From the Enhanced Storage tool within the Solaris Management Console, open the Volumes node, then choose Action⇒Create Volume. Follow the onscreen instructions. For more information, see the online help.

    • Use the following form of the metainit command:


      # metainit -f volume-name number-of-stripes components-per-stripe component-name
      
      -f

      Forces the command to continue. You must use this option when the slice contains a mounted file system.

      volume-name

      Specifies the name of the volume to create. For information on naming volumes, see Volume Names.

      number-of-stripes

      Specifies the number of stripes to create.

      components-per-stripe

      Specifies the number of components each stripe should have.

      component-names

      Specifies the names of the components that are used. This example uses the root slice, c0t0d0s0.

  7. Create a second RAID-0 volume on an unused slice (c1t1d0s0 in this example) to act as the second submirror. The secondary submirror must be the same size as the original submirror, or larger. Use one of the following methods:


    Note –

    The slice you use as the second submirror must have a slice tag of “root” and the root slice must be slice 0. For information on configuring the slice tag field, see the format(1M) man page.


    • From the Enhanced Storage tool within the Solaris Management Console, open the Volumes node, then choose Action->Create Volume and follow the instructions on screen. For more information, see the online help.

    • Use the following form of the metainit command.


      # metainit volume-name number-of-stripes components-per-stripes component-names
      

      Note –

      See Step 6 for and explanation of the options.


  8. Create a one-way mirror by using one of the following methods:

    • From the Enhanced Storage tool within the Solaris Management Console, open the Volumes node, then choose Action⇒Create Volume. Follow the onscreen instructions. For more information, see the online help.

    • Use the following form of the metainit command.


      # metainit volume-name -m submirror-name
      
      volume-name

      Specifies the name of the volume to create.

      -m

      Specifies to create a mirror.

      submirror-name

      Specifies the name of the component that will be the first submirror in the mirror. In this example, it is the RAID-0 volume that contains the root slice.

  9. Remount your newly mirrored file system. Run the metaroot volume-name command, replacing volume-name with the name of the mirror you have created. Then, reboot your system.


    # metaroot volume-name
    # reboot
    

    For more information, see the metaroot(1M) man page.

  10. Use the following form of the metattach command to attach the second submirror.


    # metattach volume-name submirror-name
    
    volume-name

    Specifies the name of the RAID-1 volume on which to add the submirror.

    submirror-name

    Specifies the name of the component that will be the second submirror attached to the mirror.

    See the metattach(1M) man page for more information.

  11. Record the alternate boot path.

    You need to configure your system so that if your primary submirror fails, the system boots from the secondary submirror. To enable the system to boot off of the disk that holds the secondary submirror, configure the system to see the disk as the alternate boot device.

    1. Determine the path to the alternate boot device. Use the ls -l command on the slice that is being attached as the second submirror to the root (/) file system mirror.


      # ls -l /dev/dsk/c1t1d0s0
      lrwxrwxrwx 1  root root  55 Mar 5 12:54  /dev/rdsk/c1t1d0s0 -> ../.
      ./devices/eisa/eha@1000,0/cmdk@1,0:a
    2. Record the string that follows the /devices directory, /eisa/eha@1000,0/cmdk@1,0:a. This is the device tree path.


      Note –

      Because the system might not be available, this information should be written down somewhere other than on the system. This enables you to more easily enter the device tree path information if you must use the DCA to boot the system.


    3. Use the eeprom command to define the alternative boot path. For example:


      # eeprom altbootpath=/eisa/eha@1000,0/cmdk@1,0:a
      

      If the primary submirror fails, the system tries to boot from the secondary submirror. The boot process is automatic if the BIOS can be configured to automatically failover to the second disk. If not, you need to enter the BIOS and configure it to boot from the secondary disk. Once the system starts to boot, it tries to boot from the bootpath device. Since the primary boot disk is the dead disk in the root mirror, the system then attempts to boot from the altbootpath device. Consult the user's guide for your BIOS for instructions on how to configure settings in your BIOS.

      If the system does not boot automatically, you can try using the DCA to select the secondary submirror. On some systems, you can choose to enter the DCA during the boot process. If this option is not available, you need to boot from an x86 boot floppy disk and use the DCA to select the secondary submirror. After the operating system has booted, update the eeprom bootpath value with the value that you set as the alternate boot path (the altbootpath value). Then, the system will boot automatically.

      For more information on using the eeprom command, see the eeprom(1M) man page.


Example 11–7 x86: Creating a Mirror From the root (/) File System By Using DCA


# metainit -f d1 1 1 c0t0d0s0
d1: Concat/Stripe is setup
# metainit d2 1 1 c0t1d0s0
d2: Concat/Stripe is setup
# metainit d0 -m d1
d0: Mirror is setup
# metaroot d0
# lockfs -fa
# reboot
...
# metattach d0 d2
d0: Submirror d2 is attached
# ls -l /dev/dsk/c0t1d0s0
lrwxrwxrwx   1 root     root          88 Feb  8 15:51 /dev/dsk/c1t3d0s0 ->
../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:a,raw
# eeprom altbootpath=/pci@1f,0/pci@1,1/ide@3/dad@0,0:a,raw
# fdisk -b /usr/lib/fs/ufs/mboot /dev/dsk/c0t1d0p0
             Total disk size is 31035 cylinders
             Cylinder size is 1146 (512 byte) blocks

                                               Cylinders
      Partition   Status    Type          Start   End   Length    %
      =========   ======    ============  =====   ===   ======   ===
          1        Active   Solaris           1  31034    31034    100


SELECT ONE OF THE FOLLOWING:
   1. Create a partition
   2. Specify the active partition
   3. Delete a partition
   4. Change between Solaris and Solaris2 Partition IDs
   5. Exit (update disk configuration and exit)
   6. Cancel (exit without updating disk configuration)
Enter Selection: 5
# installboot /usr/platform/i86pc/lib/fs/ufs/pboot \
/usr/platform/i86pc/lib/fs/ufs/bootblk /dev/rdsk/c0t1d0s2