[SOLVED] Resize raw disk on ZFS.

Marc Ballat

Renowned Member
Dec 28, 2015
38
7
73
56
Hi,

I installed 6.3 on a new server in order to test it prior to migrating my main server. In the process, I switched from LVM to ZFS.

I would like to use the qemu-img -resize command in order to shrink a raw file on ZFS. How can I achieve this ?

Cheers.

Marc
 
I would like to use the qemu-img -resize command in order to shrink a raw file on ZFS. How can I achieve this ?
Did you place a file or is the VM disk on the ZFS storage of type raw?

VM disks on ZFS are stored not as files but for each VM disk there is a ZFS dataset of the type volume (zvol) which provides a block device.

The size of the disk is a property that can be altered but shrinking is always a dangerous operation!

First you need to shrink the file systems and partitions inside the VM before you lower the disk size. The property you are looking for is called volsize.

e.g. zfs get volsize <pool>/<path to disk dataset>
 
  • Like
Reactions: semanticbeeng
Great to hear :) I went ahead and marked the thread as solved.