C H A P T E R  6

Rebuilding the Preinstalled OS

This chapter walks you through the steps to the Solaris Volume Manager to manually recreate the mirrored preinstalled Solaris Operating System (OS).

For additional details about the preinstalled Solaris operating system, refer to the Sun Fire X4500 Server Guide for Preinstalled Solaris Operating System (819-7148), and the Sun Fire X4500 Server Installation Guide (819-4358). For additional information about the Solaris Volume Manager, refer to the Solaris Volume Manager Administration Guide (819-2789).

This chapter includes the following topics:


Preinstalled OS Overview

The Solaris 10 11/06 Operating System and patches specific to the Sun Fire X4500 server are preinstalled on the hard disk drives in slot 0 and mirrored in slot 1. The following example shows the default physical partition sizes of both disk drives.


CODE EXAMPLE 6-1 Preinstalled OS Default Partition Sizes
File System         Partition            Size
root                Slice 0              11000 MB
swap                Slice 1               2000 MB
/var                Slice 5               6000 MB
metadb              Slice 7               8192 blocks

The Sun Fire X4500 server’s preinstalled OS, file systems, and partitions are created with RAID-1. RAID-1 creates an exact copy (or mirror) of systems data over multiple physical disks. By duplicating the OS over separate disks, the data is protected from disk corruption or a disk failure. Additionally, since all the data exists in multiple copies, each with its own hardware, the read performance increases.

CODE EXAMPLE 6-2 displays the amount of disk space occupied by the preinstalled OS file system, the amount of used and available space, and how much of the file system’s total capacity has been used.

CODE EXAMPLE 6-2 Sun Fire X4500 Server default Preinstalled OS Partition

File System         Size      Used    Available   Capacity     Mounted on
/dev/md/dsk/d10     11G       5.2G    5.3G         50%         /
/devices             0K         0K      0K          0%         /devices
ctfs                 0K         0K      0K          0%         system/contract
proc                 0K         0K      0K          0%         /proc
mnttab               0K         0K      0K          0%         /etc/mnttab
swap                15G       656K     15G          1%    /etc/system/volatile
objfs                0K         0K      0K          0%         /system/object
/usr/lib/libc/      11G       5.2G    5.3G         50%        /lib/libc.so.1  libc_hwcap2.so.1
fd                   0K         0K      0K          0%         /dev/fd
/dev/md/dsk/d30     5.8G       1.1G    4.6G        20%         /var
swap                15G        28K     15G          1%         /var/run
zpool1              21T        49K     21T          1%         /zpool


Creating Preinstalled OS Disk Mirrors (RAID-1)

These procedures assume that both drives are identical, that the operating system is already installed on c5t0d0, and that the mirrored disk is c5t4d0, a typical setup for a Sun Fire X4500 server.

Use this procedure to mirror an existing file system. If the file system can be unmounted, the entire procedure can be completed without a reboot. For file systems that cannot be unmounted, such as /usr and /swap, the system must be rebooted to complete the procedure.

All RAID-1 devices must be set up by the metainit command before they can be used. You use the metainit command to create mirrored disk partitions. The metainit command configures metadevices, mirrors, and hot spares according to the information specified on the command line.

metadb Command

The metadb command creates and deletes replicas of the metadevice state database. State database replicas can be created on dedicated slices, or on slices that will later become part of a simple metadevice.

The metadevice state database contains the configuration of all metadevices and hot spare pools in the system. Additionally, the metadevice state database keeps track of the current state of metadevices and hot spare pools, and their components. Solaris Volume Manager automatically updates the metadevice state database when a configuration or state change occurs. A submirror failure is an example of a state change.

When creating and deleting replicas of replicas of the metadevice state database, use the following metainit command syntax:


# metadb 

where

metainit Command

When creating metadevices and mirrors, use the following metainit command syntax:


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

where

metaroot Command

Once the mirrors are created using the metainit command, you need to remount your newly mirrored file system, and reboot the system. To remount the file system, use the following metaroot command syntax:


# metaroot volume-name 
# init 6

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

After the file system is remounted and the system rebooted, you can attach the second submirror. To attach the second submirror, use the following metattach command syntax:


# metaroot volume-name submirror-name

where

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


Recreating the Preinstalled OS

To recreate the preinstalled OS, you need to perform the following procedures:

Create a Mirror for the root (/) File System

1. Install the OS using the default configuration as a guideline.

For additional instructions on installing the Solaris OS, see the Solaris Operating System Installation Guide (819-4362) at:

http://www.docs.sun.com.

2. Create an initial state database replica by typing the following command:


# metadb -a -f c5t0d0s7 c5t4d0s7 

3. To create a mirror of the root file system:

a. Identify the slice that contains the existing root (/) file system to be mirrored. This example uses the slices c5t0d0s0 and c5t4d0s0.

b. Create a new volume on the slice from the previous step by using the following metainit commands:


#  metainit -f d11 1 1 c5t0d0s0
d11: Concat/Stripe is setup
 
# metainit d12 1 1 c5t4d0s0
d12: Concat/Stripe is setup

Create a Mirror for the swap Partition

1. To create a mirror from the /swap partition.

a. Identify the slice that contains the /swap partition to be mirrored. This example uses the slices c5t0d0s1 and c5t4d0s1.

b. Create a new volume on the slice from the previous step by using the following metainit commands:


# metainit -f d21 1 1 c5t0d0s1
d21: Concat/Stripe is setup
# metainit d22 1 1 c5t4d0s1
d22: Concat/Stripe is setup

If there is an entry for swap in the /etc/vfstab file, it must be edited to reference the mirror.

Create a Mirror for the /var Partition

1. To create a mirror from the /var partition.

a. Identify the slice that contains the /var partition to be mirrored. This example uses the slices c5t0d0s5 and c5t4d0s5.

b. Create a new volume on the slice from the previous step by using the following metainit command:


# metainit -f d31 1 1 c5t0d0s5
d31: Concat/Stripe is setup
# metainit d32 1 1 c5t4d0s5
d32: Concat/Stripe is setup

Create / root, /swap, and /var Mirrors

single-step bullet  Create the mirrors by typing the following command:


# metainit d10 -m d11
d10: Mirror is setup
 
# metainit d20 -m d21
d20: Mirror is setup
 
# metainit d30 -m d31
d30: Mirror is setup

2. Remount the file system by typing the following command:


# metaroot d10

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

3. Edit the /etc/vfstab file so that root, swap, and /var is appropriately referenced.

4. Reboot the server by entering the following command:


# init 6

Attach / root, /swap, and /var Mirrors

single-step bullet  Attach the mirrors by typing the following command:


# metattach d10 d12
d10: submirror d12 is attached
 
# metattach d20 d22
d20: submirror d22 is attached
 
# metattach d30 d32
d30: submirror d32 is attached

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

Display Current Status of the Metadevices

The metastat command displays the current status for each metadevice (including stripes, concatenations, concatenations of stripes, mirrors, specified metadevices, and components.

single-step bullet  Display the Metadevices by typing the following command:


# metastat -c
d30              m  5.9GB d31 d32
    d31          s  5.9GB c5t0d0s5
    d32           s  5.9GB c5t4d0s5
d20              m  2.0GB d21 d22
    d21          s  2.0GB c5t0d0s1
    d22           s  2.0GB c5t4d0s1
d10              m   10GB d11 d12
    d11          s   10GB c5t0d0s0
    d12          s   10GB c5t4d0s0

Install GRUB on the Boot Disk

GRUB stands for GRand Unified Bootloader. It installs GRUB stage 1 and stage 2 files on the boot area of a disk partition.

1. Install GRUB by typing the following command.


# /sbin/installgrub -fm /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c5t4d0s0
 
stage1 written to partition 0 sector 0 (abs 16065)
stage2 written to partition 0, 233 sectors starting at 50(abs 16115)
stage1 written to master boot sector

Configure the Alternate Boot Device

1. Record the alternate boot path.

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

a. Determine the path to the alternate boot device. For example:


# ls -l /dev/dsk/c5t4d0s0

b. Record the string.



Note - Because the system might not be available, you should write down this information in a different location than on the system.


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


# eeprom altbootpath=/pci@1,0/pci1022,7458@4/pci11ab,11ab@1/disk@4,0:a

For more information about using the eeprom command, refer to the eeprom man page.