This is ideal for creating LUN’s over iSCSI or locally.
zfs create -s -V 2G raid5/volume1
This will create a 2Gb volume on the zpool raid5 with thin provisioning.
newfs /dev/zvol/raid5/volume1
Creates a ufs filesystem with default settings on the volume just created.
mount /dev/zvol/raid5/volume1 /mnt/tmp
Mounts it as /mnt/tmp
mount|grep volume1
Note how it only takes up a couple of kilobytes.
dd if=/dev/zero of=/mnt/tmp/testfile bs=4096 count=1024
mount|grep volume1
Note how it now just takes up a bit over 4Mb. To grow and shrink the volume use the following
zfs set volsize=4G raid5/volume1
Recent Comments