Back to the main page

SVM - soft partition

If you need to divide disk/volume in more than 8 partitions, this is what you need to use. 

For best practices, place soft partition directly above disk slice or on top of mirror/stripe/raid5 volume (volume built from slices). Avoid other combinations. 

Each soft partition can be separate file system. Say you have 100 users, so you create 100 soft partitions over RAID1/5 volume and each user has home directory on separate FS. 

Example 1: 

Creating soft partition from whole disk size 16G.

-p = soft partition is specified.  

# metainit d10 -p c1t1d0s2 16g
d10: Soft Partition is setup
# metastat d10
d10: Soft Partition
    Device: c1t1d0s2
    State: Okay
    Size: 33554432 blocks (16 GB)
        Device     Start Block  Dbase Reloc
        c1t1d0s2       3636     No    No

        Extent              Start Block              Block count
             0                     3637                 33554432
Device Relocation Information:
Device   Reloc  Device ID
c1t1d0   No     -
# metastat -p
d10 -p c1t1d0s2 -o 3637 -b 33554432
Create new FS
# newfs -v /dev/md/rdsk/d10
Mount FS Add line in /etc/vfstab
/dev/md/dsk/d10         /dev/md/rdsk/d10        /.1     ufs     2       yes     -
# mount /.1 Check the FS
# df -h /.1
Filesystem             size   used  avail capacity  Mounted on
/dev/md/dsk/d10         16G    16M    16G     1%    /.1
Example 2: Create 11 soft partitions on disk (you can have max of 8 traditional partitions).
# foreach i ( 1 2 3 4 5 6 7 8 9 10 11 )
foreach? metainit d${i}0 -p c1t1d0s2 1g
foreach? end
# metastat -p
d110 -p c1t1d0s2 -o 20975167 -b 2097152
d100 -p c1t1d0s2 -o 18878014 -b 2097152
d90 -p c1t1d0s2 -o 16780861 -b 2097152
d80 -p c1t1d0s2 -o 14683708 -b 2097152
d70 -p c1t1d0s2 -o 12586555 -b 2097152
d60 -p c1t1d0s2 -o 10489402 -b 2097152
d50 -p c1t1d0s2 -o 8392249 -b 2097152
d40 -p c1t1d0s2 -o 6295096 -b 2097152
d30 -p c1t1d0s2 -o 4197943 -b 2097152
d20 -p c1t1d0s2 -o 2100790 -b 2097152
d10 -p c1t1d0s2 -o 3637 -b 2097152
Create new FS(s)
# foreach i ( 1 2 3 4 5 6 7 8 9 10 11 )
foreach? newfs /dev/md/rdsk/d${i}0
foreach? end
Mount new FS(s) - update /etc/vfstab file
# foreach i ( 1 2 3 4 5 6 7 8 9 10 11 )
foreach? echo "/dev/md/dsk/d${i}0 /dev/md/rdsk/d${i}0 /.${i} ufs 2 yes - " >> /etc/vfstab
foreach? end
# mountall Let's say you want to add 2G to soft partition (has 1G).
# metattach d110 2g
d110: Soft Partition has been grown
You can see now that soft partition has 3g.
# metastat d110
d110: Soft Partition
    Device: c1t1d0s2
    State: Okay
    Size: 6291456 blocks (3.0 GB)
        Device     Start Block  Dbase Reloc
        c1t1d0s2       3636     No    No
But FS is still 1G and you need to make it grow.
#df -h /.11
Filesystem             size   used  avail capacity  Mounted on
/dev/md/dsk/d110       962M   1.0M   904M     1%    /.11
Use command:
# growfs -M /.11 /dev/md/rdsk/d110
As you can see, soft partition has to be mounted when you do this. You are good to go now. All data is still there on FS /.11
# df -h /.11
Filesystem             size   used  avail capacity  Mounted on
/dev/md/dsk/d110       2.8G   3.0M   2.8G     1%    /.11
Back to the main page