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.