Friday, May 15, 2009

create a soft partition with SVM

Here we will show how to create a soft partition using Solaris volume manager or SVM on a local partition. Once created, the soft partition can be treated as an ordinary partition, allowing the creation of a filesystem. These kinds of partitions are referred to using the meta-device (/dev/md/) hierarchy. One benefit of soft partitions is that they can be expanded (with metattach & growfs).

There are two phases to creating a soft partition:

* defining a soft partition meta-device using the appropriate Solaris tools.
* creating the file system on the newly-defined soft partition.

Once you have decided on the size of the soft partition, and which physical device it should sit on, you need to create the soft partition with the metainit command.

For example, to create a 30Gb soft partition using meta-device "d3" on physical device c4t8d0s0, first define the meta-device:

# metainit d3 -p c4t8d0s0 30g

(the "-p" option defines the named meta-device "d3" as a 'soft partition' type - for other possible types, see the md.cf(4) man page). This will produce the output:

d3: Soft Partition is setup

- which defines a metadevice "d3" as a soft partition ("-p"), on disk slice c4t8d0s0, starting at offset 1 and extending for 62914560 blocks.

There are two things to note about this process. Firstly, it is possible (and indeed normal) to have more than one soft partition on a given device. Metainit will take care of setting up the offset and extent for each device.

Secondly, for the sake of disaster recovery, it would be very helpful if the names of metadevices, ie "d3" could be unique across a site. This is not the case at time of writing (18/11/04) but will hopefully become so shortly. The device name should be chosen with this in mind. To see all the metadevices defined on a server, use the metastat -p command.

Once this is done, the normal filesystem creation and checking commands can be used. For example:


# newfs /dev/md/dsk/d3

In order to mount this new filesystem, a partition name must be reserved in the "partitions" rfe map - this should be a unique name across all Informatics servers. Take the next free ptn number, and create an entry in the "partitions" rfe map - for example:

ptn028 pegasus.inf.ed.ac.uk /disk/ptn028

Next, add an entry in /etc/vfstab to allow the filesystem to be mounted. For example:


/dev/md/dsk/d3 /dev/md/rdsk/d3 /disk/ptn028 ufs 3 yes quota

NoteIf you're creating a partition that is not for home directories, eg a shared group partition, then omit the quota mount option.

Once this is done, the mount-point should be created and the filesystem mounted. You should then see something like:

# df -hF ufs
Filesystem size used avail capacity Mounted on
...
/dev/md/dsk/d3 30G 9K 29G 1% /disk/ptn028
#

To make the partition available via nfs, edit the server's LCFG profile and add the following lines:

!nfs.exports mADD()
nfs.fs_ /disk/
nfs.options_ rw=.inf.ed.ac.uk:.dcs.ed.ac.uk:.cogsci.ed.ac.uk:.dai.ed.ac.uk

This will add the partition to the /etc/dfs/dfstab file on the server. Once the dfstab file has been updated, run exportfs -a (make sure you've mounted the partition first) to make the partition generally available.

Readers who read this page, also read:




Bookmark and Share My Zimbio http://www.wikio.com

0 comments: