System Admins and Developers
All System Admin Articles
Enda O'Connor, April 2009
This article outlines the correct way to split a Solaris Volume Manager mirror prior to updating the software through, for instance, upgrades or software updates (patches). The following procedures should work with all Solaris releases except for How to Mount a Solaris Volume Manager Mirror While Booted From Media, which applies only to the Solaris 10 OS. The examples below were conducted on a Sun Fire x4200 server.
This article covers the following topics:
1. First, determine the layout of the root file system:
root@patchtest-x4200-2 # df -k / Filesystem kbytes used avail capacity Mounted on /dev/md/dsk/d10 10085921 1041301 8943761 11% / root@patchtest-x4200-2 # metastat -p d10 d10 -m d11 d12 1 d11 1 1 c0t2d0s0 d12 1 1 c0t3d0s0
2. Remove the mirror that is not being upgraded (for instance, in the example in Step 1,
d12:c0t3d0s0 will not be upgraded).
root@patchtest-x4200-2 # metadetach d10 d12 d10: submirror d12 is detached
3. Revert to booting off the physical device that is being upgraded (
d11 disk
c0t2d0s0 in this example):
root@patchtest-x4200-2 # metaroot c0t2d0s0
4. Verify that
vfstab is now correct:
root@patchtest-x4200-2 # grep c0t2d0s0 /etc/vfstab /dev/dsk/c0t2d0s0 /dev/rdsk/ / ufs 1 no - root@patchtest-x4200-2 # grep d10 /etc/vfstab root@patchtest-x4200-2 #
5. Reboot the system (which will now boot from
c0t2d0s0), and perform any software maintenance steps.
1. Redefine the boot device to
d10.
#metaroot d10
2. Reboot the system.
3. Add back the mirror:
#metaattach d10 d12
4. Let the sync complete prior to rebooting; examine
metastat d10 to observe the sync progress.
If, for any reason, it becomes necessary to mount a Solaris Volume Manager mirrored metadevice while booted from media, for example, using
boot net -s or
boot cdrom -s, use the following steps as a guide.
Note: This applies only to the Solaris 10 Operating System.
In this scenario, we need to boot off alternate media and mount the Solaris Volume Manager metadevices, because the mirror was not split before it became necessary to boot off the alternate media. In this case, we need to do some manual work to enable us to mount the
/dev/md/dsk/* metadevices onto
/a.
So, assume the root disk is laid out as follows:
/ on
d10
/var on
d20
The following was the state of the metadevices prior to booting off media:
root@oyster # metastat -p d10 d10 -m d11 d12 1 d11 1 1 c0t2d0s0 d12 1 1 c0t3d0s0 root@oyster # metastat -p d20 d20 -m d21 d22 1 d21 1 1 c0t2d0s1 d22 1 1 c0t3d0s1
1. First, boot from media, for example:
#boot net -s
2. Now mount one of the subdisks read-only, so that you cannot accidentally damage the subdisk.
In this example, assume that the underlying disk is still accessible and data has not been corrupted.
# mount -o ro /dev/dsk/c0t0d0s0 /a
3. Then set up the current booted environment so that it can use Solaris Volume Manager:
# cp /a/kernel/drv/md.conf /kernel/drv/md.conf # umount /a
4. Update the Solaris Volume Manager driver to load the configuration:
# update_drv -f md
Note: Ignore any error messages from
update_drv.
5. Now run
metainit to initialize all the metadevices.
# metainit -r
6. If you have mirrors, you should run
metasync to get them synced at this point. Use
metastat to see if a sync is required or has completed.
7. After the sync has completed, then you can proceed to mount the meta devices:
# mount /dev/md/dsk/d10 /a # mount /dev/md/dsk/d20 /a/var
Now you have the Solaris Volume Manager mirror mounted under the mountpoint
/a.
Here are some additional resources:
Unless otherwise licensed, code in all technical manuals herein (including articles, FAQs, samples) is provided under this License.