From: Roetman, Paul (PRoetman@CSXWT.com)
Date: Thu Jan 08 2004 - 22:10:23 EST
Original question about re-syncing Metadisks below...
Thanks to
Darren Dunham
Julie Baumler
David B. Harrington
Ellen Davis
and anyone else who spent time on this!
Darren came up with the solution first!...and there were some close variants
of that solution!
Some interesting reading on booting from different mirrors
http://www.sun.com/solutions/blueprints/1002/817-0407-10.pdf
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.
=========================
ORIGINAL POST:
Hello
There may be a simple solution for this, but I cannot see it (or it's just
been a long day!!)....
If I have the metadisk setup for the root disk
d0 mirror to d10
d0 mirror to d20
If I detach d20
metadetach d0 d20
I can then boot of either d0 or d20 (have tested this). There are great
examples on this from BigAdmin in 817-0407-10.pdf - Configuring Boot Disks
With Solaris(tm) Volume Manager Software
If I boot of d0, then I can re-attach and sync d20 (i.e. d20 is a copy of
d10), this is no problem...BUT, it I boot on d20 (and make changes to d20)
is there a simple way to sync d0 (or d10) to d20, so d10 is then an exact
copy of d20.
The only way I can see so far is to completely destroy d0 and d10, then
rebuild the whole mirror...this seems a bit over the top!
Cheers
Paul
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:27:48 EDT