How to Split a Root Mirrored With Solaris Volume Manager Prior to Updating Software
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:
How to Split the Mirror Before the Software Update
- First, determine the layout of the root file system:
- Remove the mirror that is not being upgraded (for instance, in the example in Step 1,
d12:c0t3d0s0
will not be upgraded). - Revert to booting off the physical device that is being upgraded (
d11
diskc0t2d0s0
in this example): - Verify that
vfstab
is now correct: - Reboot the system (which will now boot from
c0t2d0s0
), and perform any software maintenance steps.
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
root@patchtest-x4200-2 # metadetach d10 d12
d10: submirror d12 is detached
root@patchtest-x4200-2 # metaroot c0t2d0s0
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 #
How to Rebuild the Mirror After the Software Update
- Redefine the boot device to
d10
. - Reboot the system.
- Add back the mirror:
- Let the sync complete prior to rebooting; examine
metastat d10
to observe the sync progress.
#metaroot d10
#metaattach d10 d12
How to Mount a Solaris Volume Manager Mirror While Booted From Media
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:
/
ond10
/var
ond20
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
- First, boot from media, for example:
- Now mount one of the subdisks read-only, so that you cannot accidentally damage the subdisk.
- Then set up the current booted environment so that it can use Solaris Volume Manager:
- Update the Solaris Volume Manager driver to load the configuration:
- Now run
metainit
to initialize all the metadevices. - If you have mirrors, you should run
metasync
to get them synced at this point. Usemetastat
to see if a sync is required or has completed. - After the sync has completed, then you can proceed to mount the meta devices:
#boot net -s
In this example, assume that the underlying disk is still accessible and data has not been corrupted.
# mount -o ro /dev/dsk/c0t0d0s0 /a
# cp /a/kernel/drv/md.conf /kernel/drv/md.conf
# umount /a
# update_drv -f md
Note: Ignore any error messages from update_drv
.
# metainit -r
# 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
.
For More Information
Here are some additional resources:
- Sun download site
- Sun training courses at https://www.oracle.com/sun/
- Forums, such as Sun forums and the BigAdmin Discussions collection
- Product documentation at https://docs.oracle.com/en/ and the Documentation Center
- Support:
- Sun resources:
- Community system administration experts
- Events of interest to users of Sun products:
November 2009: Script was extended to collect additional data for detailed patch and package analysis.