• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 398
  • Last Modified:

decyphering metatool info

Hello everyone

I've 'inherited' admin of a solaris 8 box, its disks have been configured with solaris disksuite. I've never used it, and am having trouble figuring out how the disks are layed out. there are 8 physical disks, and I believe 2 are used as an OS mirrored volume and the rest are a giant volume for user directories. these are raided, and I think mirrored as well...maybe there is a 3 disk volume and it's mirrored into another 3 disk volume.

I was hoping i could get some advice on decoding what's going on. the old admin was kind enough to give me a log of the commands he used in setting it up (included below). I've read a little on metatool and disksuite, but the sites I've looked at seem to be super cryptic. Any help is GREATLY appreciated as I get caught up on this bad boy.

here is the log he gave me:
metadb -f -a -c 3 /dev/rdsk/c0t0d0s7
metadb -f -a -c 3 /dev/rdsk/c0t1d0s7
metainit -f d10 1 1 c0t0d0s0
metainit -f d11 1 1 c0t0d0s1
metainit -f d13 1 1 c0t0d0s3
metainit -f d14 1 1 c0t0d0s4
metainit -f d15 1 1 c0t0d0s5
metainit -f d16 1 1 c0t0d0s6
metainit -f d20 1 1 c0t1d0s0
metainit -f d21 1 1 c0t1d0s1
metainit -f d23 1 1 c0t1d0s3
metainit -f d24 1 1 c0t1d0s4
metainit -f d25 1 1 c0t1d0s5
metainit -f d26 1 1 c0t1d0s6
metainit d0 -m d10
metainit d1 -m d11
metainit d3 -m d13
metainit d4 -m d14
metainit d5 -m d15
metainit d6 -m d16
metaroot d0
metattach d0 d20
metattach d1 d21
metattach d3 d23
metattach d4 d24
metattach d5 d25
metattach d6 d26
for disk in c2t0d0s2 c2t1d0s2 c2t2d0s2 c2t3d0s2 c3t0d0s2 c3t1d0s2 c3t2d0s2 c3t3d0s2
format $disk <<EOF







for disk in c2t0d0s2 c2t1d0s2 c2t2d0s2 c2t3d0s2
      fmthard -d 0:0:0:0:71353940 /dev/rdsk/$disk
      fmthard -d 7:0:0:71353940:22960 /dev/rdsk/$disk
for disk in c3t0d0s2 c3t1d0s2 c3t2d0s2 c3t3d0s2
      fmthard -d 0:0:0:0:71353940 /dev/rdsk/$disk
      fmthard -d 7:0:0:71353940:22960 /dev/rdsk/$disk

metainit d32 4 1 c2t0d0s0 1 c2t1d0s0 1 c2t2d0s0 1 c2t3d0s0
metainit d33 4 1 c3t0d0s0 1 c3t1d0s0 1 c3t2d0s0 1 c3t3d0s0
metainit d30 -m d32
metattach d30 d33
  • 3
  • 2
2 Solutions
you are pretty much right...

c0t0d0 and c0t1d0 are partitioned into s0/s1/s3/s4/s5/s6 and each of those partitions are mirrored to the apropriate partition on the other disk (and most probably all of them are used for the system)

for the other 8 physical disks, they are all partitioned as one partition only, and then the first 4 disks (c2t0d0s2 c2t1d0s2 c2t2d0s2 c2t3d0s2) are striped (as d32), the second 4 disks (c3t0d0s2 c3t1d0s2 c3t2d0s2 c3t3d0s2) are striped (as d33) and the two stripesets are mirrored (as d30)

a pretty usefull command to you may be metastat

metastat without parameters will give you an overview about all metadevices
metastat d30 (i.e.) will give you information about metadevice d30 (which consists of two submirrors called d32 and d33)
sdcoxAuthor Commented:
Thanks neted! So the mirrors are considered devices (metadevices I guess) in the tool as well? That makes more sense. I was thinking that there were too many metadevices entirely. So a submirror is just one of the disks in a disk mirror? And the disk mirror and the submirrors are their own meta devices?

> metadb -f -a -c 3 /dev/rdsk/c0t0d0s7
> metadb -f -a -c 3 /dev/rdsk/c0t1d0s7

SVM/SDS requires a private area to keep track of things like what its controlling and whats related to what.   This is called the META Database and the metadb command it what handles creating and managing these areas.  The -c means to put 3 copies of the meta database on two seperates disk on parition 7.  If you look at partition 7, its probably pretty small.  Using multiple copies on seperate disks gives you some redundency.

> metainit -f d10 1 1 c0t0d0s0 <--- root
> metainit -f d11 1 1 c0t0d0s1 <--- swap
> metainit -f d13 1 1 c0t0d0s3 <--- /usr maybe
> metainit -f d14 1 1 c0t0d0s4 <--- and so on
> metainit -f d15 1 1 c0t0d0s5
> metainit -f d16 1 1 c0t0d0s6
> metainit -f d20 1 1 c0t1d0s0 <--- this will be root mirror
> metainit -f d21 1 1 c0t1d0s1 <--- this will be swap mirror
> metainit -f d23 1 1 c0t1d0s3 <--- and so on
> metainit -f d24 1 1 c0t1d0s4
> metainit -f d25 1 1 c0t1d0s5
> metainit -f d26 1 1 c0t1d0s6

Among other things, SVM uses a construct called a meta device which is the association of a virtual "device" with a physical device.  The above is creating a simply mapping of, for example, the d10 meta device with the physical c0t0d0s0 partition e.g. your root partition.   Notice the d20 is the mapping of d20 with c0t1d0s0 which will be the other half of you root mirror.  The above doesn't really change how your system operates but SVM now knows that how these metadevices are related to your physical disks.  Remember the meta db, these commands modify that database with this information.  In a mirrored configuration, you can also call these sub mirrors.

> metainit d0 -m d10
> metainit d1 -m d11
> metainit d3 -m d13
> metainit d4 -m d14
> metainit d5 -m d15
> metainit d6 -m d16

In the previous commands, the individual mappings were setup.  Now that the individual partitions have been mapped to meta devices you have to associate these together to form a mirror.  This is what's beginning to happen above.   What's happening is each partition on your root disk (/, /usr, /var, or whatever) is getting its own meta device or mirror - mirrors at a minimum have 2 halves e.g. sub mirrors.  So d10 (root partition) is being associated with the mirror d0.  So d0 is a new meta device and it currently has a single sub mirror d10.

> metaroot d0

This does a little bit of magic to your /etc/vfstab file and your /etc/system file that sets up the system so that is boots correctly from d0 as it primary root partition.  This command only address the root (e.g. /) partition cuz its special compared to the other partitions for obvious reasons e.g. kernel boot block being one of those very special things.

What's missing in your old admins notes your sent is the manual modifications he made to the /etc/vfstab file.  Basically the physical configuration for how the system mounts each partition changes.  Goes from:

/dev/dsk/c0t0d0s0  -> to -> /dev/md/dsk/d0     < modification for block device for root partition
/dev/rdsk/c0t0d0s0 -> to -> /dev/md/rdsk/d0  < modification for raw character device for root partition
/dev/dsk/c0t1d0s0 -> to -> /dev/md/dsk/d1
/dev/rdsk/c0t1d0s0 -> to -> /dev/md/rdsk/d1

and so on depending on the partition and what meta device was setup for it.  If you look in your /etc/vfstab file, you should see a line for d0 (which is root), d1 (which is swap), d3 (which is another partition), etc.

> exit

Generally you reboot after running metaroot.

> metattach d0 d20
> metattach d1 d21
> metattach d3 d23
> metattach d4 d24
> metattach d5 d25
> metattach d6 d26

Remember I said a mirror has two halves or submirrors ?  This does nothing more then attach the other submirror to its primary mirror meta device (and obviously updates the meta db to keep track of all this).

So now all your root disk partitions have been mirrored.  

> for disk in c2t0d0s2 c2t1d0s2 c2t2d0s2 c2t3d0s2 c3t0d0s2 c3t1d0s2 c3t2d0s2 c3t3d0s2
> do
> format $disk <<EOF
> p
> 0

> 0
> done

This are probably data disks.  This is basically formatting the drives and setting up the partitioning on each disk.  The loop he is using is called a HERE document.  The <<EOF begins the here document - this is a bourne shell bit of magic.  For commands that support it (like format), it allows you to put in canned responses to known questions coming from the commands - think automation.  But he's doing nothing more then clearing out whatever partition map is already on each disk - basically starting from scratch.

> for disk in c2t0d0s2 c2t1d0s2 c2t2d0s2 c2t3d0s2
> do
>    fmthard -d 0:0:0:0:71353940 /dev/rdsk/$disk
>    fmthard -d 7:0:0:71353940:22960 /dev/rdsk/$disk
> done
> for disk in c3t0d0s2 c3t1d0s2 c3t2d0s2 c3t3d0s2
> do
>     fmthard -d 0:0:0:0:71353940 /dev/rdsk/$disk
>     fmthard -d 7:0:0:71353940:22960 /dev/rdsk/$disk
> done

Here he is using the fmthard command to setup a BIG fat partition on slice 0 on each disk and then a little partition on slice 7 (he just never uses it - usually, slice 7 is used for meta db purposes on disks and something this small for is useful for nothing other then a meta db area).

And finally:

> metainit d32 4 1 c2t0d0s0 1 c2t1d0s0 1 c2t2d0s0 1 c2t3d0s0
> metainit d33 4 1 c3t0d0s0 1 c3t1d0s0 1 c3t2d0s0 1 c3t3d0s0
> metainit d30 -m d32
> metattach d30 d33

d32 and d33 are being setup as strips (with a 16Kbyte interlace value if I remember correctly - its been a while).  Then he setups up d30 as a mirror with d32 being its first sub mirror.   Then he attached d33 to d30 making effectively a RAID0+1 blob.

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

>> So the mirrors are considered devices (metadevices I guess) in the tool as well? That makes more sense.


>> So a submirror is just one of the disks in a disk mirror?

It may be one (as with your system disk) or multiple (as with your big data storage)

>> And the disk mirror and the submirrors are their own meta devices?

Correct. The mirror metadevice consists of up to three submirror metadevices (which would be called a three-way-mirror, but thats not common. 2-way-mirror is the normal thing
sdcoxAuthor Commented:
wow thanks for all your help guys, i'll assign points asap. One other thing...if my boot disk fails, to switch to the mirrow, do I only have to change the vfstab file? Or do i need to reconfigure the mirror, etc?
suppose the setup was correct you dont need to change any file.

at the boot prom (OK-Prompt, when unix is not yet started), use

printenv boot-device

suppose it is set to something like

disk net

or only


then the setup is not complete.

suppose it is set to something like

disk backup_root (and possibly net in the end)

then this is correct.

For exact setup of this part see the following link:


Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now