Use this task to mirror root (/) on an x86 system.
When mirroring root (/), it is essential that you record the secondary root slice name to reboot the system if the primary submirror fails. This information should be written down, not recorded on the system, which may not be available. See Chapter 7, Troubleshooting the System for details on recording the alternate boot device, and on booting from the alternate boot device.
The high-level steps in this task are:
Creating a Solaris partition large enough for the root (/) mirror
Installing the boot information on the alternate boot disk
Using metainit(1M) -f to put the root (/) slice in a single slice (one-way) concat (submirror1)
Creating a second concat (submirror2)
Using metainit(1M) to create a one-way mirror with submirror1
Rebooting
Using metattach(1M) to attach submirror2
You cannot mirror root (/) on an IDE drive.
For the purpose of the following procedures, assume that the alternate disk is c0t1d0.
Use these steps to create a Solaris partition on an x86 system.
Create the disk partition using the fdisk(1M) command.
# fdisk /dev/rdsk/c0t1d0p0 |
If this is the first time you have run fdisk(1M), you see the following:
The recommended default partitioning for your disk is: a 100% "SOLARIS System" partition To select this, please type "y". To partition your disk differently, type "n" and the "fdisk" program will let you select other partitions. |
If you have previously run fdisk(1M), you see a menu similar to the following:
Total disk size is 1855 cylinders
Cylinder size is 1110 (512 byte) blocks
Partition Status Type Start End Length %
========= ====== ======== ===== === ====== ===
1 Active SOLARIS 1 1854 1854 100
SELECT ONE OF THE FOLLOWING:
1. Create a partition
2. Change Active (Boot from) partition
3. Delete a partition
4. Exit (Update disk configuration and exit)
5. Cancel (Exit without updating disk configuration)
Enter Selection:
|
Select menu items to ensure that you have a Solaris partition large enough for the root (/) mirror. The Solaris partition should be five cylinders larger than the size needed to hold the root (/) slice.
Make sure that the Solaris partition is active. Otherwise, you will be unable to boot from it.
Run the format(1M)command on the Solaris partition to create a slice for the root (/) mirror:
# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c0t0d0 <DEFAULT cyl 2676 alt 2 hd 9 sec 85>
/eisa/ncrs@8000,0/cmdk@0,0
1. c1t1d0 <DEFAULT cyl 1865 alt 2 hd 7 sec 80> ABCDEFG
/eisa/eha@1000,0/cmdk@1,0
2. c1t2d0 <DEFAULT cyl 1461 alt 2 hd 9 sec 64>
/eisa/eha@1000,0/cmdk@2,0
3. c1t3d0 <DEFAULT cyl 1461 alt 2 hd 9 sec 64>
/eisa/eha@1000,0/cmdk@3,0
4. c1t4d0 <DEFAULT cyl 1865 alt 2 hd 7 sec 80>
/eisa/eha@1000,0/cmdk@4,0
Specify disk (enter its number): 1
selecting c1t1d0: ABCDEFG
[disk formatted]
FORMAT MENU:
disk - select a disk
type - select (define) a disk type
partition - select (define) a partition table
current - describe the current disk
format - format and analyze the disk
fdisk - run the fdisk program
repair - repair a defective sector
label - write label to the disk
analyze - surface analysis
defect - defect list management
backup - search for backup labels
verify - read and display labels
save - save new disk/partition definitions
inquiry - show vendor, product and revision
volname - set 8-character volume name
quit
|
Select partition to define a partition:
format> partition
PARTITION MENU:
0 - change `0' partition
1 - change `1' partition
2 - change `2' partition
3 - change `3' partition
4 - change `4' partition
5 - change `5' partition
6 - change `6' partition
7 - change `7' partition
select - select a predefined table
modify - modify a predefined partition table
name - name the current table
print - display the current table
label - write partition map and label to the disk
quit
partition> 0
Part Tag Flag Cylinders Size Blocks
0 unassigned wm 0 0 (0/0/0)
Enter partition id tag [unassigned]: root
Enter partition permission flags [wm]: wm
Enter new starting cyl [0]: 4
Enter partition size [0b, 0c, 0.00mb]: 400mb
partition> label
Ready to label disk, continue? y
partition>
|
Exit from the partition menu and the format(1M) program by typing the quit command twice.
partition> quit
FORMAT MENU:
disk - select a disk
type - select (define) a disk type
partition - select (define) a partition table
current - describe the current disk
format - format and analyze the disk
repair - repair a defective sector
label - write label to the disk
analyze - surface analysis
defect - defect list management
backup - search for backup labels
verify - read and display labels
save - save new disk/partition definitions
inquiry - show vendor, product and revision
volname - set 8-character volume name
quit
format> quit
|
Note the following important information about the Solaris root (/) partition:
Its I.D. tag must be "root"
Its size must be greater than or equal to the size of the original root partition
It should not use cylinders 0-2
Use the installboot(1M) command to install the boot information on the alternate boot disk:
# installboot /usr/lib/fs/ufs/pboot /usr/lib/fs/ufs/bootblk /dev/rdsk/c0t1d0s0 |
This example assumes that a Solaris partition has been created and installed with the boot information using the tasks above.
# metainit -f d10 1 1 c0t0d0s0 d10:Concat/Stripe is setup # metainit d20 1 1 c1t0d0s0 d20: Concat/Stripe is setup # metainit d0 -m d10 d10: Mirror is setup # metaroot d0 # lockfs -fa # reboot ... # metattach d0 d20 d0: Submirror d20 is attached # ls -l /dev/rdsk/c1t0d0s0 lrwxrwxrwx 1 root root 55 Mar 5 12:54 /dev/rdsk/c1t0d0s0 -> ../. devices/eisa/eha@1000,0/cmdk@1,0:a |
The -f option forces the creation of the first concatenation, d10, which contains the mounted file system root (/) on /dev/dsk/c0t0d0s0. The second concatenation, d20, is created from /dev/dsk/c1t0d0s0. (This slice must be the same size or greater than that of d10.) The metainit command with the -m option creates the one-way mirror d0 using the concatenation containing root (/). Next, the metaroot command edits the /etc/vfstab and /etc/system files so that the system may be booted with the root file system (/) on a metadevice. After a reboot, the submirror d20 is attached to the mirror, causing a mirror resync. (The system verifies that the concatenations and the mirror are set up, and that submirror d20 is attached.) Using the ls -l command on the root raw device determines the path to the alternate root device in case the system needs to be booted from it.