This section describes how to create a mirror from scratch, and how to mirror an existing file system, including root (/).
In the past, when creating a mirror for a file system, the mount point would change. Now, in certain instances, you can create mirrors without having to change the mount point. Refer to "How to Create a Mirror From an Existing Concat/Stripe (Command Line)" for more information.
A mirror is a metadevice composed of one or more submirrors. A submirror is made of one or more striped or concatenated metadevices. Mirroring data provides you with maximum data availability by maintaining multiple copies of your data.
The system must contain at least three state database replicas before you can create mirrors.
Before creating a mirror, create the striped metadevices or concatenated metadevices that will make up the mirror.
Any file system including root (/), swap, and /usr, or any application such as a database, can use a mirror.
When creating a mirror for an existing file system, be sure that the initial submirror contains the data.
When creating a mirror, first create a one-way mirror, then attach a second submirror. This starts a resync operation and ensures that data is not corrupted.
To mirror an existing file system, use an additional slice of equal or greater size than the slice already used by the mirror. You can use a concatenated metadevice or striped metadevice of two or more slices that have adequate space to contain the mirror.
You can create a one-way mirror for a future two- or three-way mirror.
You can create up to a three-way mirror. However, two-way mirrors usually provide sufficient data redundancy for most applications, and are less expensive in terms of disk drive costs. A three-way mirror enables you to take a submirror offline and perform a backup while maintaining a two-way mirror for continued data redundancy.
Use the same size slices when creating submirrors. Using different size slices creates unused space in the mirror.
Avoid having slices of submirrors on the same disk. Also, when possible, use disks attached to different controllers to avoid single points-of-failure. For maximum protection and performance, place each submirror on a different physical disk and, when possible, on different disk controllers. For further data availability, use hot spares with mirrors.
Adding additional state database replicas before creating a mirror can increase the mirror's performance. As a general rule, add one additional replica for each mirror you add to the system.
If possible create mirrors from disks consisting of the same disk geometries. The historical reason is that UFS uses disk blocks based on disk geometries. Today, the issue is centered around performance: a mirror composed of disks with different geometries will only be as fast as its slowest disk.
The high-level steps in this procedure are:
Creating two striped metadevices or concatenated metadevices, which will be the submirrors. Refer to "How to Create a Striped Metadevice (DiskSuite Tool)" or "How to Create a Concatenation (DiskSuite Tool)".
Creating a one-way mirror from one of the submirrors.
Creating the two-way mirror from the second submirror.
Make sure you have met the prerequisites ("Prerequisites for Creating DiskSuite Objects"), and have read the preliminary information ("Preliminary Information for Creating Mirrors").
Click the Mirror template.
An unassigned and uncommitted Mirror object appears on the canvas. The metadevice name is automatically assigned.
[Optional] Change the default metadevice name.
Display the object's pop-up menu and select Info. Type the new metadevice name in the Device Name field and click Attach. Then click Close.
To create a one-way mirror, drag the first Concat/Stripe object (submirror) from the Objects list into the Mirror template. Click the top rectangle of the mirror, then click Commit.
To create a two-way mirror, drag the second Concat/Stripe object (submirror) from the Objects list into the Mirror. Click the top rectangle of the mirror then click Commit.
A resync of the second submirror begins. The Mirror object displays the resync progress.
To verify that the mirror was committed, display the Configuration Log.
This example shows a committed mirror object, d5, consisting of two striped metadevices (submirrors), d3 and d4.
To prepare the newly created mirror for a file system, refer to "How to Create a File System on a Metadevice (File System Manager)". An application, such as a database, that uses the raw metadevice must have its own way of recognizing the metadevice.
The high-level steps in this procedure are:
Creating two striped metadevices or concatenated metadevices, which will be the submirrors. Refer to "How to Create a Striped Metadevice (Command Line)" or "How to Create a Concatenation (Command Line)".
Using the metainit(1M) -m command to create a one-way mirror from one of the submirrors.
Using the metattach(1M) command to create the two-way mirror from the second submirror.
Check the prerequisites ("Prerequisites for Creating DiskSuite Objects"), and the preliminary information ("Preliminary Information for Creating Mirrors"), before beginning. Refer to the metainit(1M) and metattach(1M) man pages for more information.
# metainit d51 1 1 c0t0d0s2 d51: Concat/Stripe is setup # metainit d52 1 1 c1t0d0s2 d52: Concat/Stripe is setup # metainit d50 -m d51 d50: Mirror is setup # metattach d50 d52 d50: Submirror d52 is attached |
This example creates a two-way mirror, d50. The metainit(1M) command creates two submirrors (d51 and d52), which are actually concatenations. The metainit -m command creates the one-way mirror from the d51 concatenation. The metattach(1M) command attaches d52, creating a two-way mirror and causing a mirror resync. (Any data on the attached submirror is overwritten by the other submirror during the resync.) The system verifies that the objects are set up.
To prepare a newly created mirror for a file system, refer to "How to Create a File System on a Metadevice (Command Line)". An application, such as a database, that uses the raw metadevice must have its own way of recognizing the metadevice.
Use this procedure to mirror file systems that can be unmounted.
Some file systems can be unmounted, while other file systems (like root (/), /usr, /opt, or swap) cannot be unmounted. To mirror these file systems, refer to "How to Create a Mirror From a File System That Cannot Be Unmounted (DiskSuite Tool)".
The high-level steps in this procedure are:
Identifying the slice that contains the existing file system to be mirrored
Putting the file system's slice in a Concat/Stripe object (which becomes submirror1)
Creating a second Concat/Stripe object (which becomes submirror2)
Dragging submirror1 to a mirror template and committing the mirror
Unmounting the file system
Dragging submirror2 to the mirror object and committing the mirror
Remounting the file system
Do not create a multi-way mirror at first. Instead, commit a one-way mirror, then drag the additional submirror to the mirror template and commit the mirror again. This procedure initiates a mirror resync, ensuring that data is not corrupted.
Make sure you have met the prerequisites ("Prerequisites for Creating DiskSuite Objects"), and have read the preliminary information ("Preliminary Information for Creating Mirrors").
Click Slices to display the Slice Browser window.
DiskSuite Tool should display the file system's name next to the name of the slice upon which it is mounted. If you mount a file system after starting DiskSuite Tool, select Rescan Configuration from the File menu.
Click the Concat/Stripe template.
DiskSuite Tool displays an unassigned and uncommitted Concat/Stripe object on the canvas and gives it a metadevice name.
[Optional] Change the default metadevice name.
Display the object's pop-up menu and select Info. Type the new metadevice name in the Device Name field and click Attach. Then click Close.
Drag the file system's slice from the Slice Browser window into the Concat/Stripe object.
When the slice is dropped, a warning dialog box is displayed that the slice is mounted. Click Continue.
Make sure the Concat/Stripe object is selected, then click Commit.
Click Really Commit on the warning dialog box that appears. This creates a metadevice that contains the file system, which will be used as the first submirror.
If an entry exists in the /etc/vfstab file for the file system, and the file system is currently mounted, DiskSuite Tool automatically updates it to use the concatenation's name.
Click the Concat/Stripe template.
DiskSuite Tool displays an unassigned and uncommitted Concat/Stripe object on the canvas and gives it a metadevice name.
[Optional] Change the default metadevice name.
See Step 4.
Drag a slice from the Slice Browser window into the Concat/Stripe object.
Select an unused slice, a slice that contains a state database replica, or more than one slice that is the same size or greater as the existing file system.
Make sure the Concat/Stripe object is selected, then click Commit.
This creates a metadevice, which will be used as the second submirror.
Click the Mirror template.
DiskSuite Tool displays an unassigned and uncommitted mirror object on the canvas and gives it a metadevice name.
[Optional] Change the default metadevice name.
See Step 4.
Drag the Concat/Stripe object containing the file system (created in Step 6) into the Mirror template. A warning dialog box appears. Click Continue.
If an entry exists in the /etc/vfstab file for the file system, and the file system is currently mounted, DiskSuite Tool automatically updates it to use the mirror's metadevice name.
Click the top rectangle of the Mirror object, then click Commit.
This creates the one-way mirror.
Unmount the file system.
For example, use the umount(1M) command, or File System Manager.
Select Rescan Configuration from the File menu.
DiskSuite Tool updates the file system's current mount status.
Remount the file system on the mirror.
For example, use the mount(1M) command or File System Manager. (The mount point has now changed from the slice name to the mirror name.)
Select Rescan Configuration from the File menu.
DiskSuite Tool updates the file system's mount point. The Mirror object shows that it is being used by the file system.
Drag the second Concat/Stripe object (created in Step 10) into the Mirror object. Click on the top rectangle of the Mirror object then click Commit.
Data from the first submirror is resynced to the second mirror automatically.
To verify that the mirror was committed, display the Configuration Log.
This example shows a committed two-way mirror consisting of submirrors d0 and d7, which in turn consist of slices c1t1d0s2 and c2t1d0s2, respectively. The file system, /fs1, is mounted on the mirror, d2.
Use this procedure to mirror an existing file system that can be unmounted.
To use the command line to mirror /usr, /opt, or swap, refer to "How to Create a Mirror From a File System That Cannot Be Unmounted (Command Line)". To use the command line to mirror root (/), refer to "SPARC: How to Create a Mirror From root (/) (Command Line)", or "x86: How to Create a Mirror From root (/) (Command Line)".
The high-level steps in this procedure are:
Identifying the slice that contains the existing file system to be mirrored
Using metainit(1M) -f to put the mounted file system's slice in a concat/stripe (submirror1)
Creating a second concat/stripe (submirror2)
Using metainit(1M) -m to create a one-way mirror with submirror1
Unmounting the file system
Editing the /etc/vfstab file so that the file system refers to the mirror
Remounting the file system
Check the prerequisites ("Prerequisites for Creating DiskSuite Objects"), and the preliminary information ("Preliminary Information for Creating Mirrors"), before beginning. Refer to the metainit(1M) and metattach(1M) man pages for more information.
Do not create a multi-way mirror. Rather, create a one-way mirror with the metainit(1M) command then attach the additional submirrors with the metattach(1M) command. When the metattach(1M) command is not used, no resync operations occur and data could become corrupted. Also, do not create a two-mirror for a file system without first unmounting the file system and editing the /etc/vfstab file to reference the mirror metadevice before attaching the second submirror.
# metainit -f d1 1 1 c1t0d0s0 d1: Concat/Stripe is setup # metainit d2 1 1 c2t0d0s0 d2: Concat/Stripe is setup # metainit d0 -m d1 d0: Mirror is setup # umount /master (Edit the /etc/vfstab file so that the file system references the mirror) # mount /master # metattach d0 d2 d0: Submirror d2 is attached |
The -f option forces the creation of the first concatenation, d1, which contains the mounted file system /master on /dev/dsk/c1t0d0s0. The second concatenation, d2, is created from /dev/dsk/c2t0d0s0. (This slice must be the same size or greater than that of d1.) The metainit command with the -m option creates the one-way mirror, d0, from d1.
Next, /master is unmounted and its entry changed in the /etc/vfstab file to reference the mirror. For example, the following line:
/dev/dsk/c1t0d0s0 /dev/rdsk/c1t0d0s0 /master ufs 2 yes - |
should be changed to:
/dev/md/dsk/d0 /dev/md/rdsk/d0 /master ufs 2 yes - |
Finally, the /master file system is remounted and submirror d2 attached to the mirror, causing a mirror resync. (The system verifies that the concatenations and the mirror are set up, and that submirror d2 is attached.)
Use this procedure to mirror file systems, such as root (/), /usr, /opt, and swap, that cannot be unmounted during normal system usage.
The high-level steps in this procedure are:
Putting the file system's slice in a single-slice Concat/Stripe object (submirror1)
Creating a second Concat/Stripe object (submirror2)
Dragging submirror1 to a mirror template and committing the mirror
Rebooting
Dragging submirror2 to the Mirror object and committing the mirror
Recording the alternate boot path if mirroring root (/)
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.
Make sure you have met the prerequisites ("Prerequisites for Creating DiskSuite Objects"), and have read the preliminary information ("Preliminary Information for Creating Mirrors").
Click the Concat/Stripe template.
DiskSuite Tool displays an unassigned and uncommitted Concat/Stripe object on the canvas and gives it a metadevice name.
[Optional] Change the default metadevice name.
Display the object's pop-up menu and select Info. Type the new metadevice name in the Device Name field and click the Attach button. Then click the Close button.
Click Slices to display the Slice Browser window.
Drag the slice containing the file system you want to mirror to the top rectangle of the Concat/Stripe object.
When you drop the slice, DiskSuite Tool displays a warning dialog box. Click the Continue button.
Click the top rectangle of the Concat/Stripe object, then click Commit.
Click the Really Commit button if DiskSuite Tool displays a warning dialog box. This creates a one-way concatenation that contains the file system, which will be used as the first submirror.
If an entry exists in the /etc/vfstab file for the file system, and the file system is currently mounted, DiskSuite Tool automatically updates it to use the concatenation's metadevice name.
Click the Concat/Stripe template.
DiskSuite Tool displays an unassigned and uncommitted Concat/Stripe object on the canvas and gives it a metadevice name.
[Optional] Change the default metadevice name.
See Step 3.
Drag a slice from the Slice Browser window to this Concat/Stripe object.
When creating this one-way concatenated metadevice, use an unused slice that is the same size as or greater than the existing file system.
Click the top rectangle of the Concat/Stripe object then click Commit.
This creates the second submirror.
Click the Mirror template.
DiskSuite Tool displays an unassigned and uncommitted Mirror object on the canvas and gives it a metadevice name.
[Optional] Change the default metadevice name.
See Step 3.
Drag the Concat/Stripe object that contains the file system into the Mirror template.
Click the Continue button if DiskSuite Tool displays a warning dialog box.
If an entry exists in the /etc/vfstab file for the file system, and the file system is currently mounted, DiskSuite Tool automatically updates it to use the mirror's metadevice name.
Click the top rectangle of the Mirror object then click Commit.
Reboot.
Restart DiskSuite Tool.
Drag the second Concat/Stripe object created in Step 10 into the Mirror object to create the two-way mirror. Then click Commit.
Data from the first submirror is resynced to the second mirror.
If you are mirroring root (/), record the alternate boot path.
Refer to Chapter 7, Troubleshooting the System for more information.
To verify that the mirror was committed, display the Configuration Log.
This example shows a committed mirror containing the /usr file system.
Use this procedure to mirror file systems, such as /usr, /opt, and swap, that cannot be unmounted during normal system usage.
To save the crash dump when you have mirrored swap, use the dumpadm(1M) command to configure the dump device as a metadevice. For instance, if the swap device is named /dev/md/dsk/d2, use dumpadmdumpadm to set this as the dump device.
To use the command line to mirror root (/), refer to "SPARC: How to Create a Mirror From root (/) (Command Line)", or "x86: How to Create a Mirror From root (/) (Command Line)".
The high-level steps in this procedure are:
Using metainit(1M) -f to put the file system's slice in a single slice (one-way) concat/stripe (submirror1)
Creating a second concat/stripe (submirror2)
Using metainit(1M)to create a one-way mirror from submirror1
Editing the /etc/vfstab file so that the file system refers to the mirror
Rebooting
Using metattach(1M) to attach submirror2
Do not create a multi-way mirror. Rather, create a one-way mirror with the metainit(1M) command, then attach the additional submirrors with the metattach(1M) command. When the metattach(1M) command is not used, no mirror resync occurs and data could become corrupted.
After checking the prerequisites ("Prerequisites for Creating DiskSuite Objects"), and the preliminary information ("Preliminary Information for Creating Mirrors"), use the metainit(1M) and metattach(1M) commands to create the mirror.
# metainit -f d12 1 1 c0t3d0s6 d12: Concat/Stripe is setup # metainit d22 1 1 c1t0d0s6 d22: Concat/Stripe is setup # metainit d2 -m d12 d2: Mirror is setup (Edit the /etc/vfstab file so that /usr references the mirror) # reboot ... # metattach d2 d22 d2: Submirror d22 is attached |
The -f option forces the creation of the first concatenation, d12, which contains the mounted file system /usr on /dev/dsk/c0t3d0s6. The second concatenation, d22, is created from /dev/dsk/c1t0d0s6. (This slice must be the same size or greater than that of d12.) The metainit command with the -m option creates the one-way mirror d2 using the concatenation containing /usr. Next, the /etc/vfstab file must be edited to change the entry for /usr to reference the mirror. For example, the following line:
/dev/dsk/c0t3d0s6 /dev/rdsk/c0t3d0s6 /usr ufs 1 yes - |
should be changed to:
/dev/md/dsk/d2 /dev/md/rdsk/d2 /usr ufs 1 yes - |
After a reboot, the second submirror d22 is attached to the mirror, causing a mirror resync. (The system verifies that the concatenations and the mirror are set up, and that submirror d22 is attached.)
# metainit -f d11 1 1 c0t0d0s1 d11: Concat/Stripe is setup # metainit d21 1 1 c1t0d0s1 d21: Concat/Stripe is setup # metainit d1 -m d11 d1: Mirror is setup (Edit the /etc/vfstab file so that swap references the mirror) # reboot ... # metattach d1 d21 d1: Submirror d21 is attached |
The -f option forces the creation of the first concatenation, d11, which contains the mounted file system swap on /dev/dsk/c0t0d0s1. The second concatenation, d21, is created from /dev/dsk/c1t0d0s1. (This slice must be the same size or greater than that of d11.) The metainit command with the -m option creates the one-way mirror d1 using the concatenation containing swap. Next, if there is an entry for swap in the /etc/vfstab file, it must be edited to reference the mirror. For example, the following line:
/dev/dsk/c0t0d0s1 - - swap - no - |
should be changed to:
/dev/md/dsk/d1 - - swap - no - |
After a reboot, the second submirror d21 is attached to the mirror, causing a mirror resync. (The system verifies that the concatenations and the mirror are set up, and that submirror d21 is attached.)
Use this task to mirror root (/) on a SPARC system.
The task for using the command line to mirror root (/) on an x86 system is different from the task used for a SPARC system. To mirror root (/) on an x86 system, refer to "x86: How to Create a Mirror From root (/) (Command Line)". 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 procedure are:
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
Make sure you have met the prerequisites ("Prerequisites for Creating DiskSuite Objects"), and have read the preliminary information ("Preliminary Information for Creating Mirrors"). For more information refer to the metainit(1M), metaroot(1M), and metattach(1M) man pages.
# metainit -f d11 1 1 c0t3d0s0 d11: Concat/Stripe is setup # metainit d12 1 1 c1t3d0s0 d12: Concat/Stripe is setup # metainit d10 -m d11 d10: Mirror is setup # metaroot d10 # lockfs -fa # reboot ... # metattach d10 d12 d10: Submirror d12 is attached # ls -l /dev/rdsk/c1t3d0s0 lrwxrwxrwx 1 root root 88 Feb 8 15:51 /dev/rdsk/c1t3d0s0 -> ../../devices/iommu@f,e0000000/vme@f,df010000/SUNW,pn@4d,1080000/ipi3sc@0,0/i d@3,0:a,raw |
The -f option forces the creation of the first concatenation, d11, which contains the mounted file system root (/) on /dev/dsk/c0t3d0s0. The second concatenation, d12, is created from /dev/dsk/c1t3d0s0. (This slice must be the same size or greater than that of d11.) The metainit command with the -m option creates the one-way mirror d10 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. (It is a good idea to run lockfs -fa before rebooting.) After a reboot, the submirror d12 is attached to the mirror, causing a mirror resync. (The system verifies that the concatenations and the mirror are set up, and that submirror d12 is attached.) The ls -l command is run on the root raw device to determine the path to the alternate root device in case the system needs to be booted from it.
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.