An example of mirroring the root disks with DiskSuite on Solaris 9. Step by step instructions on how to mirror 2 internal root disks with the bundled version of DS.

With a default install (Entire Group plus/minus OEM) of Solaris 9, you should have Solaris Volume Manager installed. It’s basically disksuite with a few niceties. I believe one of them is viewing the volumes in MB instead of cylinders. Don’t quote me on that.

Vi /etc/lvm/md.tab and follow the example below:

# Root Mirror MetaDevices
# MetaDevice for c1t0d0s0 (boot disk root slice)
/dev/md/dsk/d11 1 1 /dev/dsk/c1t0d0s0
# MetaDevice for c1t1d0s0 (bootmirror disk root slice)
/dev/md/dsk/d12 1 1 /dev/dsk/c1t1d0s0
# MetaDevice for a mirror using boot disk to start with
/dev/md/dsk/d10 -m /dev/md/dsk/d11

# Swap Mirror Metadevices
# MetaDevice for c1t0d0s1 (boot disk swap)
/dev/md/dsk/d21 1 1 /dev/dsk/c1t0d0s1
# MetaDevice for c1t1d0s1 (bootmirror disk swap)
/dev/md/dsk/d22 1 1 /dev/dsk/c1t1d0s1
# MetaDevice for Swap Mirror
/dev/md/dsk/d20 -m /dev/md/dsk/d21

# /export Mirror Metadevices
# MetaDevice for c1t0d0s5
/dev/md/dsk/d31 1 1 /dev/dsk/c1t0d0s7
# MetaDevice for c1t1d0s5
/dev/md/dsk/d32 1 1 /dev/dsk/c1t1d0s7
# MetaDevice for Export Mirror
/dev/md/dsk/d30 -m /dev/md/dsk/d31

# /usr Mirror Metadevices
# MetaDevice for c1t0d0s3
/dev/md/dsk/d41 1 1 /dev/dsk/c1t0d0s3
# MetaDevice for c1t1d0s3
/dev/md/dsk/d42 1 1 /dev/dsk/c1t1d0s3
# MetaDevice for /usr Mirror
/dev/md/dsk/d40 -m /dev/md/dsk/d41

# /var Mirror Metadevices
# MetaDevice for c1t0d0s4
/dev/md/dsk/d51 1 1 /dev/dsk/c1t0d0s4
# MetaDevice for c1t1d0s3
/dev/md/dsk/d52 1 1 /dev/dsk/c1t1d0s4
# MetaDevice for /var Mirror
/dev/md/dsk/d50 -m /dev/md/dsk/d51

Now create your metadatabase. It holds info about your volumes. This is similar to encapsulation under Veritas.

[root@server /]# metadb -af -c 4 /dev/dsk/c1t0d0s6
[root@server /]# metadb -af -c 4 /dev/dsk/c1t1d0s6

Make sure that the database replicas were created.

[root@server /]# metadb
        flags           first blk       block count
     a        u         16              8192            /dev/dsk/c1t0d0s6
     a        u         8208            8192            /dev/dsk/c1t0d0s6
     a        u         16400           8192            /dev/dsk/c1t0d0s6
     a        u         24592           8192            /dev/dsk/c1t0d0s6
     a        u         16              8192            /dev/dsk/c1t1d0s6
     a        u         8208            8192            /dev/dsk/c1t1d0s6
     a        u         16400           8192            /dev/dsk/c1t1d0s6
     a        u         24592           8192            /dev/dsk/c1t1d0s6

Initialize your metadevices. You don’t have to force each one but I did for quicker Bash shortcuts (up arrow).

[root@server /]# metainit -f /dev/md/dsk/d11
d11: Concat/Stripe is setup
[root@server /]# metainit -f /dev/md/dsk/d12
d12: Concat/Stripe is setup
[root@server /]# metainit -f /dev/md/dsk/d10
d10: Mirror is setup
[root@server /]# metainit -f /dev/md/dsk/d21
d21: Concat/Stripe is setup
[root@server /]# metainit -f /dev/md/dsk/d22
d22: Concat/Stripe is setup
[root@server /]# metainit -f /dev/md/dsk/d20
d20: Mirror is setup
[root@server /]# metainit -f /dev/md/dsk/d31
d31: Concat/Stripe is setup
[root@server /]# metainit -f /dev/md/dsk/d32
d32: Concat/Stripe is setup
[root@server /]# metainit -f /dev/md/dsk/d30
d30: Mirror is setup
[root@server /]# metainit -f /dev/md/dsk/d41
d41: Concat/Stripe is setup
[root@server /]# metainit -f /dev/md/dsk/d42
d42: Concat/Stripe is setup
[root@server /]# metainit -f /dev/md/dsk/d40
d40: Mirror is setup
[root@server /]# metainit -f /dev/md/dsk/d51
d51: Concat/Stripe is setup
[root@server /]# metainit -f /dev/md/dsk/d52
d52: Concat/Stripe is setup
[root@server /]# metainit -f /dev/md/dsk/d50
d50: Mirror is setup

Here, metaroot modifies vfstab to boot / off the d10 metadevice

[root@server /]# metaroot d10

Then manually change /dev/dsk/c1t0d0s1 for swap to read /dev/md/dsk/d20

#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/d20 -       -       swap    -       no      -
/dev/md/dsk/d10 /dev/md/rdsk/d10        /       ufs     1       no
-
/dev/md/dsk/d40 /dev/md/rdsk/d40        /usr    ufs     1       no
-
/dev/md/dsk/d50 /dev/md/rdsk/d50        /var    ufs     1       no
-
/dev/md/dsk/d30 /dev/md/rdsk/d30        /export ufs     2       yes
-
swap    -       /tmp    tmpfs   -       yes     -

Reboot to check your progress. If your server comes up, continue while doing a happy dance.

Root’s fine

[root@server /]# df -lk /
Filesystem            kbytes    used   avail capacity  Mounted on
/dev/md/dsk/d10      5039370  336115 4652862     7%    /

Swap’s fine

[root@server /]# swap -l
swapfile             dev  swaplo blocks   free
/dev/md/dsk/d20     85,20     16 2097392 2097392

Do the following for every mirror pair, here I attach d11 to d12 as d10 (d11 is assumed by our previous config file).

[root@server /]# metattach d10 d12 d10: submirror d12 is attached

[…]

[root@server /]# metastat|grep Resync State: Resyncing Resync in progress: 2 % done State: Resyncing

Best idea to let one synch go at a time. Watch status with:

while true; do metastat|grep %; sleep 1; done

When you don’t see Resync progress anymore, the mirrors are sync’d. Then we check to see how our new mirrors are doing:

[root@server /]# metastat
d40: Mirror
    Submirror 0: d41
      State: Okay
    Pass: 1
    Read option: roundrobin (default)
    Write option: parallel (default)
    Size: 6142014 blocks (2.9 GB)

d41: Submirror of d40
    State: Okay
    Size: 6142014 blocks (2.9 GB)
    Stripe 0:
        Device     Start Block  Dbase        State Reloc Hot Spare
        c1t0d0s3          0     No            Okay   Yes

d30: Mirror
    Submirror 0: d31
      State: Okay
    Pass: 1
    Read option: roundrobin (default)
    Write option: parallel (default)
    Size: 51314418 blocks (24 GB)

d31: Submirror of d30
    State: Okay
    Size: 51314418 blocks (24 GB)
    Stripe 0:
        Device     Start Block  Dbase        State Reloc Hot Spare
        c1t0d0s5          0     No            Okay   Yes

d20: Mirror
    Submirror 0: d21
      State: Okay
    Pass: 1
    Read option: roundrobin (default)
    Write option: parallel (default)
    Size: 2097414 blocks (1.0 GB)

d21: Submirror of d20
    State: Okay
    Size: 2097414 blocks (1.0 GB)
    Stripe 0:
        Device     Start Block  Dbase        State Reloc Hot Spare
        c1t0d0s1          0     No            Okay   Yes

d10: Mirror
    Submirror 0: d11
      State: Okay
    Pass: 1
    Read option: roundrobin (default)
    Write option: parallel (default)
    Size: 10238616 blocks (4.9 GB)

d11: Submirror of d10
    State: Okay
    Size: 10238616 blocks (4.9 GB)
    Stripe 0:
        Device     Start Block  Dbase        State Reloc Hot Spare
        c1t0d0s0          0     No            Okay   Yes

d50: Mirror
    Submirror 0: d51
      State: Okay
    Pass: 1
    Read option: roundrobin (default)
    Write option: parallel (default)
    Size: 1022706 blocks (499 MB)

d51: Submirror of d50
    State: Okay
    Size: 1022706 blocks (499 MB)
    Stripe 0:
        Device     Start Block  Dbase        State Reloc Hot Spare
        c1t0d0s4          0     No            Okay   Yes

d52: Concat/Stripe
    Size: 1022706 blocks (499 MB)
    Stripe 0:
        Device     Start Block  Dbase   Reloc
        c1t1d0s4          0     No      Yes

d42: Concat/Stripe
    Size: 6142014 blocks (2.9 GB)
    Stripe 0:
        Device     Start Block  Dbase   Reloc
        c1t1d0s3          0     No      Yes

d32: Concat/Stripe
    Size: 51314418 blocks (24 GB)
    Stripe 0:
        Device     Start Block  Dbase   Reloc
        c1t1d0s5          0     No      Yes

d22: Concat/Stripe
    Size: 2097414 blocks (1.0 GB)
    Stripe 0:
        Device     Start Block  Dbase   Reloc
        c1t1d0s1          0     No      Yes

d12: Concat/Stripe
    Size: 10238616 blocks (4.9 GB)
    Stripe 0:
        Device     Start Block  Dbase   Reloc
        c1t1d0s0          0     No      Yes

Device Relocation Information:
Device   Reloc  Device ID
c1t1d0   Yes    id1,ssd@w20000004cf9f2e91
c1t0d0   Yes    id1,ssd@w20000004cf99e53f