Solaris Volume Manager

RaidSolaris Volume Manager (formerly known as Online: DiskSuite, and later Solstice DiskSuite is a software package for creating, modifying and controlling RAID disks in Solaris. The process below outlines steps that you need to take to setup basic root disk mirroring.

Adding a new Disk? Create your Partition Table for your Mirror:

Using the format command, select your initial disk. Then select par, then
name to save off you partition table to disk.

Then switch to the other disk and label the other disk with the saved
partition table.

Md.tab — add mirror information:

The file /etc/md.tab is basically a map file where you define your metadevices and the physical devices that they represent. In the example below the metadevice d0 has two submirrors, d10 and d20.

For Example:
d0      -m              d10
d10             1 1     /dev/dsk/c0t0d0s0
d20             1 1     /dev/dsk/c0t1d0s0
#swap mirror
d1      -m              d11
d11             1 1     /dev/dsk/c0t0d0s1
d21             1 1     /dev/dsk/c0t1d0s1
#var mirror
d4      -m              d14
d14             1 1     /dev/dsk/c0t0d0s4
d24             1 1     /dev/dsk/c0t1d0s4

Add Meta Databases:

bash-3.00# metadb -c 3 -f -a /dev/dsk/c5t0d0s3
bash-3.00# metadb -c 3 -f -a /dev/dsk/c5t4d0s3

Make sure that you create them on the correct slice. The normal standard that I follow, has me creating them on slice 3.
In the example above you are creating 3 metadbs on the mirror disk. Not sure if you need the -f option on the second db, but it does not seem to cause any issues.

Initialize
your Mirrors:

In the example below you are initializing your one way mirror. These are the entries from the md.tab. Here I am initializing each side of the mirror. Note that you do not need to specify "d10 1 1 c5t0d0s0" if you have added this information to the md.tab Use the '-f' switch when the filesystem on that slice is currently mounted.

EXAMPLE for Slice 0:

bash-3.00# metainit -f d10 1 1 c5t0d0s0
d10: Concat/Stripe is setup
bash-3.00# metainit d20 1 1 c5t4d0s0
d10: Concat/Stripe is setup

.

Attach your First
Submirror:

The example below shows how attach your one way mirror to your metadevice. Once this step is complete. You will want to reboot, and attach the other side of the mirror. You can then edit the /etc/fstab with the new metadevices.

EXAMPLE:

metainit d0 -m d10

 


Metaroot to Create root mirror in fstab:

The metaroot command is used to modify the /etc/fstab

metaroot d0

Then modify any other entries.

Attach Secondary Mirror:

metattach d20

Other Helpful Commands:

How to Delete Metadbs:

If you need to start over, you can use the command below to remove metadatabases.

metadb -d -f /dev/dsk/diskname

Inpect your Metadbs:

# metadb -i
        flags           first blk       block count
     a        u         16              8192            /dev/dsk/c0t0d0s7
     a        u         16              8192            /dev/dsk/c0t1d0s7
     a        u         16              8192            /dev/dsk/c0t2d0s7

How to Detach Mirrors:

metadetach mirror submirror

metadetach d0 d20

after completing the step above you should clear the concat/stripe

metaclear d20

Metastat:

Metastat gives you the status of your mirrors

# metastat
d7: RAID
    State: Initializing
    Initialization in progress: 12.2% done <== not done yet
    Interlace: 32 blocks
    Size: 208618176 blocks (99 GB)
Original device:
    Size: 208627648 blocks (99 GB)
        Device     Start Block  Dbase        State Reloc  Hot Spare
        c0t0d0s7      10506       Yes Initializing   Yes
        c0t1d0s7      10506       Yes Initializing   Yes
        c0t2d0s7      10506       Yes Initializing   Yes


 


		

One thought on “Solaris Volume Manager

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.