Thursday, September 2, 2010

Solaris Volume Manager

The Solaris volume manager (SVM) is a free component of Solaris 9 and Solaris 10. It was previously known as Solstice DiskSuite. SVM software provides mechanisms to configure physical slices of harddrive into logical volumes. As such it introduces additional level of complexity and should not be used unless absolutely necessary. On Solaris 10 using ZFS is a better alternative. Logical volumes can be configured to provide mirroring and RAID5. In its simplest form SVM uses traditional Solaris disk partitioning (up to eight partitions or slices in Solaris terminology) to build virtual disks called volumes.

Any partition can be used to create volumes, but it is common practice to reserve slice s7 for the state database replicas. Database replicas are created on selected disks and hold the SVM configuration data. It is the administrator’s responsibility to create these state databases (using the metadb command) and distribute them across disks and controllers to avoid any single points of failure.

Commands used in SVM

#metadb -a -f c0t0d0s3
a - add
f - force

#metadb
#metainit d0 3 1 c0t0d03 c0t0d0s4 c0t0d0s5
d0 - address
The above command creates concatenation for 3 slices

#metainit d0 1 c0t0d03 c0t0d0s4 c0t0d0s5
The above command uses stripping

#newfs /dev/md/rdsk/d0
#mkdir /FS
#mount /dev/md/dsk/d0 /FS
#metastat
#metaclear d0
#metadb -d -f c0t0d0s3
#metastat

Now if you want to create a partition from a meta

#metainit d10 -p d1 1500m
d10 - partition name
d1 - source
#metainit d11 -p d1 1500m
#newfs /dev/md/rdsk/d10
#newfs /dev/md/rdsk/d11
#mkdir /FS
#mount /dev/md/dsk/d10 /FS

Adding 1500m to d10
#metaattach d10 1500m
#growfs -M /FS /dev/md/rdsk/d10

For adding a disk to meta
#metattach d0 c0t0d0s6
#growfs -M /FS /dev/md/rdsk/d0

Mirroring
#metainit d0 2 1 c0t0d0s3 c0t0d1s3
#metainit d1 2 1 c0t0d2s3 c0t0d3s3
#metainit d10 -m d0
#init 6
#metattach d10 d1
#metastat
#newfs /dev/md/rdsk/s10

To clear the meta information
#metaclear d10
#metaclear d0 d1

RAID-5
#metainit d10 -r c0t0d0s3 c0t0d1s3 c0t0d2s3 c0t0d3s3
#metastat
#newfs /dev/md/rdsk/d10



1 comment:

Msd said...

I am getting error while removing meta device...
Error occurred while Defining change number 2: The device is bound to a pool.....
I unmapped it from the server and trying to unbind it from pool then dissolve and delete...