The Home of C&P Software on the Web

Home
Blogs
About us
Why Choose Us?
What Are People saying?
OneClickAway PC Support
Professional Profile
Free Software here!!!
Contact Us
Privacy Notice
Useful Links
NLP

Solaris Volume Manager – Building Stripe Sets and Working With Soft Partitions

By Paul A. Fortin

The following explains how to build stripe sets with the 3 (secondary) disks on a Sunfire V440s, and also how to add new soft partitions and filesystems and grow existing ones.

 

  1. Use “format” to change the partition table of physical disks 1, 2, and 3.  (These are c1t1d0, c1t2d0, c1t3d0.)  Be careful to make no changes to disk 0, c1t0d0 – the boot disk.

 

Select disk 1 and use “par” to go into partition table editing, then “pri” to list the partition table.  The menus will help guide you in this.

 

DO NOT EDIT SLICE 2.

 

For each slice other than slice 0 and 2, leave all the entries the same except specify “0” as the starting cylinder and “0c” as the size.  This tells format to make the slice start at cylinder 0 and be 0 cylinders long.

 

For slice 0, leave all entries the same except specify “0” as the start cylinder and “14080e” as the size.  This creates a slice which starts at cylinder 0 and ends at 14080.

 

We also need a small slice, for which we’ll use slice 7, to put Solaris Volume Manager’s state databases on.  Make slice 7 with all entries left as-is, except specify “14081” as the start cylinder and “14086e” as the size.

 

Once these slices are made, type “q” to leave partition table editing.

 

Type “label” to actually write the new partition table to the disk.  Answer “y” when asked for confirmation.

 

Quit out of “format”.

 

  1. Now we copy this partition table to the remaining two disks:

 

prtvtoc  /dev/rdsk/c1t1d0s2  |  fmthard  –s  -  /dev/rdsk/c1t2d0s2

prtvtoc  /dev/rdsk/c1t1d0s2  |  fmthard  –s  -  /dev/rdsk/c1t3d0s2

 

  1. Write SVM state database replicas to slice 7 on all three disks:

 

metadb  –f  –a  –c3  c1t1d0s7

metadb  –a  –c3  c1t2d0s7

metadb  –a  –c3  c1t3d0s7

 

  1. Add the following lines to the end of /etc/lvm/md.tab:

d1   1  3  c1t1d0s0  c1t2d0s0  c1t3d0s0

d11  -p  d1  50g

 

The size of d11 (here 50g) can be any value that fits within the stripe set, which should be around 204 GB in size.

 

The above specifies a three-element RAID 0 stripe set using slice 0 on all three disks, then a “soft partition” on top of it which is 50 GB in size.  More soft partitions could be made by adding more lines to the file with names like d12, d13, etc.  The sizes can be increased later.

 

  1. Use “metainit” to actually build the stripe set and soft partition:

 

metainit  -a

 

“metainit –a” asks SVM to build all metadevices it finds in md.tab that are not already built.

 

The output should say something similar to “Concat/stripe is created” then “Soft partition is created.”

 

Use “metastat” to confirm what you’ve built.  The “start cyl” value on the elements of the stripe set may seem odd, but this is innocuous.

 

  1. Create a filesystem on the soft partition:

 

newfs   /dev/md/rdsk/d11   (note the extra “md” element in the path)

 

  1. Create a mount point for the new filesystem:

 

mkdir  /(mount point name)

 

  1. Edit /etc/vfstab and add an entry for the new mount.  This should look just like ordinary entries except, as above, the paths will be “/dev/md/dsk….” instead of “/dev/dsk…”  and  “/dev/md/rdsk…” instead of “/dev/rdsk…”

 

Example:

 

/dev/md/dsk/d11        /dev/md/rdsk/d11    /data   ufs    2    yes    -

 

  1. Test the correctness of vfstab using “mount /data” (or whatever the mount point is called).
  2. The new filesystem is now ready to use.

 

 

To create a new soft partition later:

 

To create a new soft partition called, for example, d12 with size 20 GB, on the stripe set:

 

Metainit  d12  -p  d1  20g

 

Then simply create a filesystem, mount point, and vfstab entry as above.

 

To expand an existing soft partition and the filesystem on it:

 

Plan and type carefully, as this change is not reversible without deleting the soft partition.

 

To expand the size of d11, for example, by 10 GB:

 

metattach  d11  10g

growfs –M  /(mount point)  /dev/md/rdsk/d11

 

The above growfs command is for a filesystem that is mounted.  If it is not mounted at the time, the “-M /(mount point)” portion is not needed.

 

Check the new size with “df –h”.