Solaris Volume Manager Administration Guide

Example—Creating a Mirror From root (/)


# metainit -f d1 1 1 c0t0d0s0
d11: Concat/Stripe is setup
# metainit d2 1 1 c0t1d0s0
d12: Concat/Stripe is setup
# metainit d0 -m d1
d10: Mirror is setup
# metaroot d0
# lockfs -fa
# reboot
...
# metattach d0 d2
d10: Submirror d12 is attached
# ls -l /dev/rdsk/c0t1d0s0
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

Note –

Do not attach the second submirror before the system is rebooted. You must reboot between running the metaroot command and attaching the second submirror.


The -f option forces the creation of the first RAID 0 volume, d1, which contains the mounted file system root (/) on /dev/dsk/c0t0d0s0. The second concatenation, d2, is created from /dev/dsk/c0t1d0s0. (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 using the concatenation that contains root (/).

Next, the metaroot command edits the /etc/vfstab and /etc/system files so that the system can be booted with the root file system (/) on a volume. (It is a good idea to run the lockfs -fa command before rebooting.) After a reboot, the submirror d2 is attached to the mirror, causing a mirror resynchronization. (The system confirms that the concatenations and the mirror are set up, and that submirror d2 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 might later need to be booted from it.