Recovery of root password with SDS mirrored rootdisk

compiled by Doug Hughes

This assumes that c0t0d0s0 is rootdisk and c0t1d0s0 is root mirror. /dev/md/dsk/d0 is / device, d10 is c0t0d0s0 and d20 is c0t1d0s0

  1. boot the machine from cdrom or off the net into single user mode.
  2. fsck -o p /dev/dsk/c0t0d0s0 (or your root device if different)
  3. mount /dev/dsk/c0t0d0s0 /a
  4. vi /a/etc/system - comment out rootdev by putting * in front
  5. vi /a/etc/vfstab - comment out /dev/md/dsk/d0 entry (or whatever metadevice you use for /) and add raw device entry back in
  6. vi /a/etc/shadow and fix root password
  7. reboot (off your primary rootdevice - which it will do automatically at this point by just typing reboot)
    * at this stage, your d0 two submirrors are probably both listed in a "needing synchronization" phase - so you may not be able to run metadetach - this procedure works either way.
  8. metaclear d0. (clear the current mirror setup)
  9. metainit d0 -m d10 (setup d0 to be c0t0d0s0 submirror as primary)
  10. metaroot d0 (this will reenable /etc/system boot device and also fix /etc/vfstab for you)
  11. reboot - you will now be running once again off disksuite root mirror
  12. metattach d0 d20

Why do metattach after reboot? because it can take a long time to synchronize and if you do it before the reboot, it's probably better to wait until it's complete, which delays recovery.