• About
  • Manuals
  • Network
Confessions of a FreeBSD hacker Various tips & tricks about computers in general and FreeBSD in particular
Confessions of a FreeBSD hacker

Volume management in ZFS

March 4, 2012 15:38 / Leave a Comment / Magnus Strahlert

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
Posted in: ZFS / Tagged: iscsi, lun, volumes, zfs

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

* Copy This Password *

* Type Or Paste Password Here *

Post Navigation

← Previous Post
Next Post →

Recent Posts

  • Takeaways utilising VFIO in a KVM virtual guest
  • Converting VM from ESXi to KVM with iSCSI storage
  • Deploying oVirt in self-hosted mode
  • Ansible playbook for handling perl on FreeBSD
  • iSCSI: Migrating from istgt to ctld

Tags

ansible backup carp chroot cluster cross-server esxi freebsd ftp ftpchroot gpt grub hast install iscsi kvm linux lun lvm mirror network nfs nfsroot ovirt pxe raid ramdrive raspberrypi snapshot ssd ssh terminalserver usb vfio virtio virtualbox vlan vmware volumes winxp zfs zpool zroot

Archives

  • July 2019
  • March 2018
  • February 2018
  • July 2017
  • February 2016
  • January 2015
  • August 2014
  • April 2013
  • March 2013
  • February 2013
  • January 2013
  • December 2012
  • September 2012
  • July 2012
  • April 2012
  • March 2012
  • November 2011
  • August 2011

Recent Comments

    Meta

    • Log in
    • Entries feed
    • Comments feed
    • WordPress.org
    © Copyright 2013-2016 - Magnus Strahlert
    Infinity Theme by DesignCoral / WordPress