![]()
How to Split a Root Mirrored With Solaris Volume Manager Prior to Updating SoftwareApril, 2009 Here is the correct way to split a Solaris Volume Manager mirror prior to updating the software through upgrades or software updates (patches). How to Leave Comments or Tag Pages1. Register. |
Comments (4)
May 18, 2009
FuuBar says:
How about this alternativ from bullet 3 less reboots both before and after. 3. ...How about this alternativ from bullet 3 less reboots both before and after.
3. Fsck & Mount the detached disk (d12 disk c0t3d0s0 in this example):
root@patchtest-x4200-2 # fsck -f /dev/dsk/c0t3d0s0
root@patchtest-x4200-2 # mount /dev/dsk/c0t3d0s0 /mnt
4. Revert to booting off the physical device on the detached disk (d12 disk c0t3d0s0 in this example):
root@patchtest-x4200-2 # metaroot -R /mnt c0t3d0s0
5. Verify that vfstab is now correct:
root@patchtest-x4200-2 # grep c0t3d0s0 /mnt/etc/vfstab
/dev/dsk/c0t3d0s0 /dev/rdsk/ / ufs 1 no -
root@patchtest-x4200-2 # grep d10 /etc/vfstab
root@patchtest-x4200-2 #
6. Unmount c0t3d0s0 and perform any software maintenance steps.
root@patchtest-x4200-2 # umount /mnt
May 19, 2009
CCSUNGRP says:
Hi All, However, the '/var', '/opt' & '/usr' directory's if they are on sep...Hi All,
However, the '/var', '/opt' & '/usr' directory's if they are on separate partition's ( metadevice) ?
Thanks & Regards
May 19, 2009
Mickey_N says:
Great article, but I'm missing instructions for reverting back to the untouched ...Great article, but I'm missing instructions for reverting back to the untouched mirror in case the upgrade fails. This seems to be the most challenging part of the operation.
Also I have been struggling with this on an X4150 and got in to a bunch of unexpected issues due to re-addressing of disks, it seems as if the disk which is first in the boot sequence will always be target 0
/Mikael
May 22, 2009
eoconnor says:
Hi So if you say /usr /var seperate then once you have followed the instructions...Hi
So if you say /usr /var seperate then once you have followed the instructions in the doc for splitting root, and before rebooting run
root@oyster # df -k /usr
Filesystem kbytes used avail capacity Mounted on
/dev/md/dsk/d30 5040814 3344800 1645606 68% /usr
root@oyster # metastat -p d30
d30 -m d31 d32 1
d31 1 1 c0t1d0s5
d32 1 1 c0t0d0s5
root@oyster #
root@oyster # metadetach d30 d32
d30: submirror d32 is detached
root@oyster #
So now edit /etc/vfstab to enable /usr to be mounted off c0t1d0s5
#/dev/md/dsk/d30 /dev/md/rdsk/d30 /usr ufs 1 no
-
/dev/dsk/c0t1d0s5 /dev/rdsk/c0t1d0s5 /ufs ufs 1 no
( best to just comment out original entries for now, as you'll need them later to reattach mirrors)
Do same for say /opt etc.
if swap is mirrored and you want to break swap mirror
root@oyster # swap -l
swapfile dev swaplo blocks free
/dev/md/dsk/d40 85,40 16 2048272 2048272
root@oyster # metastat -p d40
d40 -m d41 d42 1
d41 1 1 c0t2d0s3
d42 1 1 c0t3d0s3
root@oyster #
root@oyster # metadetach d40 d42
d40: submirror d42 is detached
root@oyster
then edit /etc/vfstab and modify to assign swap of one half of the mirror
/dev/dsk/c0t2d0s3 - - swap - no -
Then once /etc/vfstab is correct, reboot at that stage, and system will now boot with /, /usr etc mounted of the underlying disks.
To reattach, run metaroot d10 and edit /etc/vfstab to mount the metadevices ( the original entries that existed ), then reboot
and reattach the submirrors via
#metattach d10 d12
#metattach d30 d32
and so on to reattach all the sub disks to their mirrors.
metastat should then show all the mirrors and sub disks.
------
For systems such as x4150 the boot disk is determined from boot priority in BIOS, so on x86 based systems it's important to consider that the disk that is listed first in the BIOS boot priority is where the system will look first for a grub menu, and then proceed to the second entry if none is found and so on.
------
So if say you do boot of an underlying disk and the software update/upgrade fails, rendering the system unbootable, the options are to
1. boot off failsafe
ok> boot -F failsafe in SPARC u6 and beyond
or select failsafe entry from grub on boot if x86
2. Boot of network or cd|dvd etc
Then once that has been accomplished you will need to access the metadevices ( follow as far as step 5 in "How to Mount a Solaris Volume Manager Mirror While Booted From Media" section in this doc.
then
say you had split the root mirror and it looked like the following after the split
d10 -m d11 1
d11 1 1 c0t2d0s0
#
and d12, the detached half of the mirror was c0t3d0s0, and you now wanted to boot of that and probably recreate the mirror until figuring out the problem, you could do
#metaclear d10 ( gets rid of the mirror )
reinitialise the subdisks and mirror
#metainit d11 1 1 c0t2d0s0
#metainit d10 -m d12
now you have
d10 -m d12 1
d12 1 1 c0t3d0s0
#
Now mount /dev/dsk/c0t3d0s0 on /a and edit /a/etc/vfstab to boot of c0t3d0s0
/dev/dsk/c0t3d0s0 /dev/rdsk/c0t3d0s0 / ufs 1 no -
Also make sure that if /var and /usr etc are seperate mirrors devices, that you take care to boot of the unpatched side
check /a/etc/system and comment out rootdev:/pseudo/md entry if it exists.
then need to modify the eeprom variables to boot of c0t3d0s0
so
root@oyster # ls -l /dev/dsk/c0t3d0s0
lrwxrwxrwx 1 root root 43 May 21 11:42 /dev/dsk/c0t3d0s0 -> ../../devices/pci@1c,600000/scsi@2/sd@3,0:a
so we need to boot of
/pci@1c,600000/scsi@2/disk@3,0:a ( note replace major name, sd in this case with disk )
so need to set the following for instance in eeprom
something like
root@oyster # eeprom "nvramrc=devalias disk /pci@1c,600000/scsi@2/disk@2,0:a disk1 /pci@1c,600000/scsi@2/disk@3,0:a"
root@oyster # eeprom "boot-device=disk1 disk net"
This should then boot of disk1 /pci@1c,600000/scsi@2/sd@3,0:a otherwise known as c0t3d0s0
after the reboot you should then be able to run
#metaroot d10
#metattach d10 d11
and the d12 ( pre updating software disk ) will sync to d11.
I would also recommend running fsck before booting of the underlying disk as in:
#/usr/sbin/fsck -F ufs -m /dev/rdsk/c0t3d0s0
this will run a sanity check and tell you if all is ok, if not then you obviously have problems and need to run
/usr/sbin/fsck -F ufs -o p /dev/rdsk/c0t3d0s0
at a minimum to repair the ufs metadata.
Enda