C H A P T E R 13 |
Rebuilding the Preinstalled OS |
This chapter describes how to use the Solaris Volume Manager to manually re-create the mirrored preinstalled Solaris Operating System (OS).
For additional details about the preinstalled Solaris operating system, see the Sun Fire X4540 Server Guide for Preinstalled Solaris Operating System (819-7148), and the Sun Fire X4540 Server Installation Guide (820-4855). For additional information about the Solaris Volume Manager, refer to the Solaris Volume Manager Administration Guide (819-2789).
This chapter includes the following topics:
The Solaris 10 4/08 Operating System and patches specific to the Sun Fire X4540 server are preinstalled on the hard disk drives in slot 0 and mirrored in slot 1. CODE EXAMPLE 13-1 shows the default physical partition sizes of both disk drives.
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 X4540 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, because all the data exists in multiple copies, each with its own hardware, the read performance increases.
CODE EXAMPLE 13-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.
These procedures assume that both drives are identical, that the operating system is already installed on c0t0d0, and that the mirrored disk is c1t0d0, a typical setup for a Sun Fire X4540 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.
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:
When creating metadevices and mirrors, use the following metainit command syntax:
Once the mirrors are created using the metainit command, you need to remount your newly mirrored file system, and then reboot the system. To remount the file system, use the following metaroot command syntax:
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:
See the metattach(1M) man page for more information.
To re-create the preinstalled OS, perform the following procedures:
1. Install the OS using the default configuration in CODE EXAMPLE 13-1 as a guideline.
For additional instructions on installing the Solaris OS, see the Solaris Operating System Installation Guide (819-4362) at:
2. Create an initial state database replica by typing the following command:
3. Create a mirror of the root file system. Do the following.
a. Identify the slice that contains the existing root (/) file system to be mirrored. This example uses the slices c0t0d0s0 and c1t0d0s0.
b. Create a new volume on the slice from the previous step by using the following metainit commands:
# metainit -f d11 1 1 c0t0d0s0 d11: Concat/Stripe is setup # metainit d12 1 1 c1t0d0s0 d12: Concat/Stripe is setup |
1. Identify the slice that contains the /swap partition to be mirrored. This example uses the slices c0t0d0s1 and c1t0d0s1.
2. Create a new volume on the slice from the previous step by using the following metainit commands:
# metainit -f d21 1 1 c0t0d0s1 d21: Concat/Stripe is setup # metainit d22 1 1 c1t0d0s1 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.
1. Identify the slice that contains the /var partition to be mirrored. This example uses the slices c0t0d0s5 and c1t0d0s5.
2. Create a new volume on the slice from the previous step by using the following metainit command:
# metainit -f d31 1 1 c0t0d0s5 d31: Concat/Stripe is setup # metainit d32 1 1 c1t0d0s5 d32: Concat/Stripe is setup |
1. Create the mirrors by typing the following commands:
# 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:
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 typing the following command:
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 |
See the metattach(1M) man page for more information.
The metastat command displays the current status for each metadevice. Metadevice status includes stripes, concatenations, concatenations of stripes, mirrors, specified metadevices, and components.
Display the Metadevices by typing the following command:
# metastat -c d30 m 5.9GB d31 d32 d31 s 5.9GB c0t0d0s5 d32 s 5.9GB c1t0d0s5 d20 m 2.0GB d21 d22 d21 s 2.0GB c0t0d0s1 d22 s 2.0GB c1t0d0s1 d10 m 10GB d11 d12 d11 s 10GB c0t0d0s0 d12 s 10GB c1t0d0s0 |
GRUB stands for GRand Unified Bootloader. It installs GRUB stage 1 and stage 2 files on the boot area of a disk partition.
Install GRUB by typing the following command.
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.
1. Record the alternate boot path.
Determine the path to the alternate boot device. For example:
Note - Because the system might not be available, this information should be written down somewhere other than on the system. |
3. Use the eeprom command to define the alternative boot path. For example:
For more information about using the eeprom command, see the eeprom man page.
Copyright © 2009 Sun Microsystems, Inc. All rights reserved.