How to boot off a CD-ROM/Network when using Solstice Disksuite.

Boot disk mirroring with Solstice Disksuite and booting from a CD-ROM/Network are two things which do not go well together. When booted from a CD-ROM, the Disksuite software is not loaded, and thus you are not able to mount the metadevice (ie, the mirror) which is your root partition.
If you need to make changes to the root partition (and keep in mind even mounting a partition read-write will cause it to change!), you need to take extra steps to make sure that the two sides of the mirror remain consistant.

There is a common misconception that manually making the same changes on both sides of the mirror will get around this problem - this is not the case! Although you might make the same changes to both sides of the mirror, there's no saying that the OS will make exactly the same changes to both sides!

Below is a procedure for how to get around this problem. It described how to boot a machine into single-user mode from a CD/Network, disable mirroring on the partition for long enough to avoid the consistency problem, and then remirror the partition.


Firstly boot into single user mode from the cdrom/network

ok boot net -s

Once the machine comes up, pick one side of your root disk mirror to work on. In this example we'll pick c0t0d0s0
First we need to fsck this filesystem, and then mount it.

INIT: SINGLE USER MODE
#
# fsck /dev/dsk/c0t0d0s0
** /dev/dsk/c1t0d0s0
** Last Mounted on /
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
47115 files, 898516 used, 2644458 free (2370 frags, 330261 blocks, 0.0% fragmentation)
#
# mount /dev/dsk/c0t0d0s0 /mnt
#

Edit the /etc/system file from the mounted root filesystem (ie, /mnt/etc/system) and comment out the "rootdev" option by putting a "*" in front of it.

# vi /mnt/etc/system

The rootdev entry should now look something like :
* rootdev:/pseudo/md@0:0,30,blk

Edit the /etc/vfstab file from the root filesystem (ie, /mnt/etc/vfstab) and change the references from the Disksuite metadevice to the real disk device. You should do this for the root device only!

# vi /mnt/etc/vfstab
Change

/dev/md/dsk/d30     /dev/md/rdsk/d30     /     ufs     1     no     -
to
/dev/dsk/c0t0d0s0   /dev/rdsk/c0t0d0s0   /     ufs     1     no     -

You can now make whatever other changes you need (ie, fix whatever it was that caused you to have to boot off CD/Network in the first place!)

Once that's done, unmount the mounted root device, and shutdown the machine.

# cd /; umount /mnt
# init 0

Once the machine has shutdown, reboot it again into single user mode, making sure that you boot off the same disk as you setup as the rootdisk above.

ok boot disk0 -s

Once the machine has booted to single user mode, log in and confirm that you have booted off the correct disk.

INIT: SINGLE USER MODE

Type control-d to proceed with normal startup,
(or give root password for system maintenance):
single-user privilege assigned to /dev/console.
Entering System Maintenance Mode

Mar 11 22:10:32 su: 'su root' succeeded for root on /dev/console
root@marvin / #
root@marvin / # df -k /
Filesystem            kbytes    used   avail capacity  Mounted on
/dev/dsk/c0t0d0s0    3542974  898494 2609051    26%    /

Next, check which devices make up the normal root mirror. In this case the root mirror metadevice is d30, so :

root@marvin / # metastat -p d30
d30 -m d10 d20 1
d10 1 1 c0t0d0s0
d20 1 1 c0t1d0s0

So the mirror metadevice is d30, and the device we need to keep as a part of it (ie, the one we edited above) is d10 (on c0t0d0s0)

First we need to clear the existing relationship, as d20 is stale, and there's no easy way to detach it alone. So first clear the mirror relationship :
root@marvin / # metaclear d30
d30: Mirror is cleared

And then re-create d30 as a one-way mirror, with the device we worked out above as the only sub-mirror.
root@marvin / # metainit d30 -m d10
d30: Mirror is setup
root@marvin / # metastat -p d30
d30 -m d10 1
d10 1 1 c0t0d0s0

Next we need to undo the changes we made above - uncommenting the rootdev line in /etc/system, and changing /etc/vfstab back to use the metadevice.
root@marvin / # vi /etc/system
Uncomment the rootdev entry, eg
rootdev:/pseudo/md@0:0,30,blk
root@marvin / # vi /etc/vfstab
Change the /dev/{r}dsk/c0t0d0s0 entry back to /dev/md/{r}dsk/d30

Shutdown the machine
root@marvin / # init 0

Reboot the machine into single user mode, again using the disk which we modified above.
ok boot disk0 -s
When the machine reaches single user mode, login and check that you're booted from the correct device (ie, the metadevice) and that this device is a one-way mirror of the device edited above.
root@marvin / # df -k /
Filesystem            kbytes    used   avail capacity  Mounted on
/dev/md/dsk/d30      3542974  898494 2609051    26%    /
root@marvin / # metastat -p d30
d30 -m d10 1
d10 1 1 c0t0d0s0
root@marvin / #

Once you've confirmed everything looks OK, continue booking into multiuser mode, login, and remirror the root device.
root@marvin / # metastat -p d30
d30 -m d10 1
d10 1 1 c0t0d0s0
root@marvin / # metattach d30 d20
d30: submirror d20 is attached
root@marvin / #
root@marvin / # metastat -p d30
d30 -m d10 d20 1
d10 1 1 c0t0d0s0
d20 1 1 c0t1d0s0

(C) Copyright Scott Howard, 2002
scott@doc.net.au