[SOLVED] Resize raw disk on ZFS.

Marc Ballat

Well-Known Member
Dec 28, 2015
33
3
48
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.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!