SVM question - weird issue

Kartik Vashishta <[email protected]> Thu, 16 Aug 2012 14:12:07 -0500
Newsgroups gmane.os.solaris.managers
Message-ID <CAJFC5W3F1KaWk4AP1BcqZfN4QY_FV9YXsrPXtoDBnQu=JDM85w@mail.gmail.com>
I have a Sun T2000 and mirrored drive is having issues, however it appears
that the system has been booted off of the mirrored drive!!!!! Not sure if
bootblks are present in the "main" drive(any way to test if they're there?)

# cfgadm -al
Ap_Id                          Type         Receptacle   Occupant
Condition
c0                             scsi-sas     connected    configured
unknown
c0::dsk/c0t0d0                 disk         connected    configured
unknown
c0::dsk/c0t1d0                 disk         connected    configured
unknown
c0::dsk/c0t2d0                 disk         connected    configured
unknown
c0::dsk/c0t3d0                 disk         connected    configured
unknown
<snip>

# eeprom | grep boot-device
boot-device=disk1
boot-device-index=0
#


#  ls -l /dev/dsk/c0t1d0s0
lrwxrwxrwx   1 root     root          49 May  8 10:46 /dev/dsk/c0t1d0s0 ->
../../devices/pci@780/pci@0/pci@9/scsi@0/sd@1,0:a
#


# prtconf -vp | grep disk1
        boot-device:  'disk1'
        disk1:  '/pci@780/pci@0/pci@9/scsi@0/disk@1'

# prtconf -vp | grep disk0
        disk0:  '/pci@780/pci@0/pci@9/scsi@0/disk@0'
#


#metastat
<snip> (all other metadevice status looks great)
d20: Mirror
    Submirror 0: d30
      State: Needs maintenance
    Submirror 1: d40
      State: Needs maintenance
    Pass: 1
    Read option: roundrobin (default)
    Write option: parallel (default)
    Size: 92937408 blocks (44 GB)

d30: Submirror of d20
    State: Needs maintenance
    Invoke: after replacing "Maintenance" components:
                metareplace d20 c0t1d0s0 <new device>
    Size: 92937408 blocks (44 GB)
    Stripe 0:
        Device     Start Block  Dbase        State Reloc Hot Spare
        c0t1d0s0          0     No      Last Erred   Yes


d40: Submirror of d20
    State: Needs maintenance
    Invoke: metasync d20
    Size: 92937408 blocks (44 GB)
    Stripe 0:
        Device     Start Block  Dbase        State Reloc Hot Spare
        c0t0d0s0          0     No            Okay   Yes
<snip>(all other metadevice status looks great)

# cat /etc/vfstab
#device         device          mount           FS      fsck    mount
mount
#to mount       to fsck         point           type    pass    at boot
options
#
fd      -       /dev/fd fd      -       no      -
/proc   -       /proc   proc    -       no      -
/dev/md/dsk/d21 -       -       swap    -       no      -
/dev/md/dsk/d20 /dev/md/rdsk/d20        /       ufs     1       no
logging
/dev/md/dsk/d22 /dev/md/rdsk/d22        /var    ufs     1       no
logging
/dev/md/dsk/d23 /dev/md/rdsk/d23        /opt    ufs     2       yes
logging
/dev/md/dsk/d24 /dev/md/rdsk/d24        /opt2   ufs     2       yes
logging
/devices        -       /devices        devfs   -       no      -
ctfs    -       /system/contract        ctfs    -       no      -
objfs   -       /system/object  objfs   -       no      -
swap    -       /tmp    tmpfs   -       yes     -
sharefs         -       /etc/dfs/sharetab       sharefs -       no      -
#



My procedure to do this is:
metadetach -f d23 d33
metadetach -f d22 d32
metadetach -f d21 d31
metadetach -f d20 d30


metaclear d33
metaclear d32
metaclear d31
metaclear d30

metastat -p | grep c0t1d0

<should be no output>

cfgadm -c unconfigure c0::dsk/c0t1d0

Remove the disk1

INsert the new disk

cfgadm -c configure c0::dsk/c0t1d0

cfgadm -al

prtvtoc /dev/rdsk/c0t0d0s2 | fmthard -s - /dev/rdsk/c0t1d0s2

/usr/sbin/installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk
/dev/rdsk/c0t1d0s0

metadevadm -u c0t1d0

metainit d33 1 1 c0t1d0s5
metainit d32 1 1 c0t1d0s3
metainit d31 1 1 c0t1d0s1
metainit d30 1 1 c0t1d0s0


metattach d23 d33
metattach d22 d32
metattach d21 d31
metattach d20 d30



However I think I will have to boot off of disk0, this requires rebooting
the system, also what do I do if disk0 does not have any bootblk's?

Am, I missing anything?