Solaris Volume Manager Administration Guide

x86: Creating a RAID-1 Volume From the root (/) File System

Beginning with the Solaris 10 1/06 release, the GRand Unified Bootloader (GRUB) has replaced the Device Configuration Assistant (DCA) for boot processes and configurations in x86 based systems. For a brief description of this feature and the enhancements it introduces, refer to the GRUB Based Booting in Solaris 10 What’s New.

The procedures in this section describe steps to create RAID-1 volumes from the root (/) file system. If your system is running the Solaris 10 1/06 OS or subsequent releases, follow the first procedure that uses GRUB. Otherwise, perform the steps in the second procedure that uses DCA.

The process for mirroring the root (/) file system on an x86 based system is similar to mirroring root on a SPARC system. However, on x86 based systems, the BIOS and fdisk partitioning add an additional layer of complexity.

In the example used in the procedures, the existing slice is c1t0d0s0. The second slice, c1t1d0s0, is available for the second half of the mirror. The submirrors are d1 and d2, respectively, and the mirror is d0.


Note –

Before implementing any of the procedures, check Prerequisites for Creating Solaris Volume Manager Components and Creating and Maintaining RAID-1 Volumes.


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

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. Some of the BIOS's tasks are as follows:

    • Perform startup functions.

    • Detect the correct device from which to boot the system.

    • Load the master boot record from that device to allow the system to self-boot.

    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's BIOS does not have this feature and the primary submirror fails, you need to access the BIOS during system boot to reconfigure the system 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

    Before setting up a root mirror, check the BIOS on 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.

    The existence of a separate x86 boot partition presents a problem when mirroring the root (/) file system. Because it exists outside of the Solaris fdisk partition, 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.

    The GRUB-based installation program of the Solaris 10 1/06 software and subsequent releases no longer automatically creates an x86 boot partition. However, if the x86 already exists in the system, the installation program preserves that partition by default.

    To determine if your system has a separate x86 boot partition, check the /etc/vfstab file. The x86 boot partition exists if the file contains an entry similar to the following:


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

    To use the Solaris Volume Manager to mirror the root (/) file system, the file system must use the single Solaris fdisk partition. Therefore, if the x86 boot partition already exists in the system, delete this partition with the fdisk command and then reinstall the Solaris software. When you reinstall, the boot partition is no longer recreated.


    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. 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. Make the secondary disk bootable.


    # /sbin/installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c1t1d0s0
    

    For more information about installgrub, refer to the installgrub(1M) man page.

  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.

    Only the single slice can be included in the RAID-0 volume. Use 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 -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 (c1t1d0s0 in this example) on an unused slice to act as the second submirror.


    Note –

    The secondary submirror must be the same size as the original submirror, or larger. Also, 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.


    Use either of the following methods:

    • 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 an 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, then reboot the system.


    # metaroot volume-name
    # reboot
    

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

  10. 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. Define the alternative boot path in the menu.lst file.

    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. In the current example, c1t1d0s0, the alternative path is on the first slice of the first fdisk partition on the second disk. Thus, you would edit the menu.lst with the following entry:


    title alternate boot
     root (hd1,0,a)
     kernel /boot/multiboot
     module /boot/x86.miniroot-safe

    Note –

    To properly edit entries in menu.lst, you must be familiar with disk-naming conventions in GRUB. For details, see Chapter 11, GRUB Based Booting (Tasks), in System Administration Guide: Basic Administration


    After you have completed editing the menu.lst file, the system is set to failover to the second disk. If the primary disk fails, disk numbering changes so that the system boots from the secondary disk.


    Caution – Caution –

    On certain cases, the automatic disk-renumbering feature of the BIOS might affect recovery from an unavailable primary disk. When disk renumbering forces the system to boot from the secondary disk, the primary disk's boot archive becomes stale. If the same primary disk becomes available later and you boot the system, the disk numbering switches again to use the default primary disk for the system boot. However, at this stage, the primary disk's boot archive remains stale. Consequently, the system might not boot at all. Therefore make sure that in such cases, you select the correct entry from the GRUB menu to boot the system from the valid boot archive. After the system completes the boot up process, perform the normal metadevice maintenance which synchronizes both primary and secondary disks and restores the valid boot archive to the primary disk.


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