Creating filesystem in Solaris 11 using Zpool

Let us see how to create a mount point or filesystem using zpool in Solaris 11.

To print the Disks

# echo | format

Scan for the new Disks

# devfsadm -c disk

To list all the controllers

# cfgadm -al

To create a pool

# zpool create backup02

# zfs create backup02/fs

# zfs set mountpoint=/backup02 backup02/fs

Create a file with below content in the name of format.cmd to label the disk using for loop.

cat >format.cmd
label
quit

Put all the new LUN details under NW_Lun file.

If we have the multiple number of disks we can use for loop as follows.

for disk in `cat NW_Lun` 
do 
format -s -f format.cmd $disk 
echo "labeled $disk ....."
done

Once we run the for loop it will label the disk, format. That’s it we have done with creating the new filesystem.