Thursday, October 16, 2014

Creating zfs filesystem on Solaris servers



#!/bin/bash
rm /tmp/list.fs
echo > /tmp/list.fs
echo " Please enter the "mount point" and space and the "size""
sleep 5
vi /tmp/list.fs
for i in `cat  /tmp/list.fs`
do
Mpoint=`echo $i | awk -F, '{print $1}`
FSSize=`echo $i | awk -F, '{print $2}'`
LvName=`echo $i | awk -F, '{print $1}' |sed 's,^/,,' |sed 's,/,_,g'`
poolName=`zpool list |grep poolv |awk '{print $1}'`
zfs create   -o mountpoint=$Mpoint -o quota=$FSSize  $poolName/FS_$LvName

done

No comments:

Post a Comment