Solaris Volume Manager Administration Guide

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

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.

Before You Begin

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

  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.