Thursday, February 17, 2011

Boot from second mirror disk d20 - configuration

Here is the final method:


Disk layout

d0 = default boot disk (root partition)

d10 = sub mirror one

d20 = sub mirror two.

1. Confirm standard boot device d0, with sub-mirrors of d10 and d20

2. determine physical devices

metastat d10 --> /dev/dsk/c0t1d0s0

metastat d20 --> /dev/dsk/c0t0d0s0

3. determine physical address of device

ls -l /dev/rdsk/c0t1d0s0 -->



/devices/sbus@2,0/SUNW,socal@d,10000/sf@0,0/ssd@w2100002037a86c65,0:a,raw

ls -l /dev/rdsk/c0t0d0s0 -->



/devices/sbus@2,0/SUNW,socal@d,10000/sf@0,0/ssd@w210000203796fb42,0:a,raw

4. setup boot names at "ok" prompt

nvalias bootdisk

/sbus@2,0/SUNW,socal@d,10000/sf@0,0/ssd@w2100002037a86c65,0:a

nvalias mirrdisk

/sbus@2,0/SUNW,socal@d,10000/sf@0,0/ssd@w210000203796fb42,0:a

5. Break mirror and setup each boot disk

metadetach d0 d20

touch /d0.disk (create dummy file to verify disk

name)

mount /dev/md/dsk/d20 /usr/dummy (mount into a dummy directory)

cd /usr/dummy

metaroot -n /dev/md/dsk/d20 (obtain what changes are

required)

edit vfstab, set root disk to d20 (get all this info from metaroot

command)

edit system, modify to this

rootdev:/pseudo/md@0:0,20,blk

touch /usr/dummy/d20.disk

6. Confirm boot off each disk, verify dummy file

boot bootdisk

verify /d0.disk exists

boot mirrdisk

verify /d20.disk exists

At this point, can apply patches to d0 or make config changes to d0 - with a

good backup of original system on d20.

7. If all goes well with patches the copy changes from d10 to d20

boot bootdisk

confirm /d0.disk exists

metattach d0 d20

metastat d0 (to confirm sync complete)

confirm /d0.disk exists

reboot

8. If patch application/config changes FAIL, copy d20 to d10

boot mirrdisk

verify /d20.disk exists

mount /dev/md/dsk/d0 /usr/dummy (not really necessary)

verify /usr/dummy/d0.disk exists

umount /usr/dummy

metaclear d0 (remove old d0 .. d10 does not

change)

metainit -f d0 -m d20 (force creation of d0 to d20 mirror)

metaroot -n /dev/md/dsk/d0 (print what todo without doing it)

metaroot /dev/md/dsk/d0 (actually run the command)

reboot (boots off default of d0)

metattach d0 d10

watch re-sync!

=========================

Another solution suggested was

I haven't had a chance to test it, but in theory, it looks like you can

(unsupported) edit /etc/lvm/md.cf to tell it that d0 is made up of d20 with

d10 as a mirror.

/etc/lvm/md.conf should initially have said something like:

d0 -m d10 d20 1

d10 1 1 c0t0d0s0

d20 1 1 c1t0d0s0

But after the metadetatch says something like:

d0 -m d10 1

d10 1 1 c0t0d0s0

d20 1 1 c1t0d0s0

Edit it to:

d0 -m d20 d10 1

d20 1 1 c1t0d0s0

d10 1 1 c0t0d0s0

Reboot.

There doesn't seem to be a real win in this process over the other though;

the only place I could possibly see it as being useful is with live upgrade

where you can't run meta* commands on your inactive boot environment but may

wish to only do one reboot to change BE's and fix your disk setup - even in

that case, I suspect you really should be using etc/lvm/md.tab which IS

supported.

=========================

No comments: