Increase disk size of a VM on ZFS

Miguel

Member
Nov 27, 2017
44
0
11
48
I have searched around and I couldn´t find any instructions of how to increase a VM disk when using ZFS on proxmox 5.1.

This is my zpool:

zfs list
NAME USED AVAIL REFER MOUNTPOINT
rpool 232G 36.9G 104K /rpool
rpool/ROOT 1.86G 36.9G 96K /rpool/ROOT
rpool/ROOT/pve-1 1.86G 36.9G 1.86G /
rpool/data 226G 36.9G 96K /rpool/data
rpool/data/vm-100-disk-1 135G 36.9G 116G -
rpool/data/vm-102-disk-1 27.6G 36.9G 20.0G -
rpool/data/vm-102-disk-2 63.0G 36.9G 41.2G -
rpool/swap 4.25G 37.9G 3.26G -

I want to increase vm-100-disk-1.

How do I proceed? Shut down VM and run:

qm resize 100 virtio0 +5G ?

I am not sure which driver I should use
 
You can do this easily in the GUI. Just go the VM's hardware, click on the disk in question and then there's a Resize disk button you can use. It's nice and simple and can be done with the VM online.

You just then have to resize the storage on the VM inside the OS obviously.
 
I ran into exactly the same issue, and wound up adding a new partition ,,, I selected resize disk, but could not determine how to resize the storage on the VM inside....I was also not sure if ext4 was OK to use on the new partition, given that the VM exisits w/in a zfs mirror ..

Talk about nuts and bolts !
 
I selected resize disk, but could not determine how to resize the storage on the VM inside....I was also not sure if ext4 was OK to use on the new partition, given that the VM exisits w/in a zfs mirro
Once the disk has been resized you need to first extend the partition within the VM and then the filesystem inside the partition. How to do that depends on which OS you are running within the VM.

Current Windows versions and Linux distributions like Ubuntu come with their GUI tools for that. On Linux gparted, often also called Partition Manager, is a nice GUI tool.

Ext4 as file system is fine within a VM.
 
# fdisk -l
Disk /dev/sda: 1.27 TiB, 1395864371200 bytes, 2726297600 sectors
Disk model: QEMU HARDDISK
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 07B147F9-8655-4FB3-8D30-B2F796D32ED8

Device Start End Sectors Size Type
/dev/sda1 2048 204799 202752 99M EFI System
/dev/sda2 204800 2252799 2048000 1000M Linux filesystem
/dev/sda3 2252800 2260991 8192 4M PowerPC PReP boot
/dev/sda4 2260992 2263039 2048 1M BIOS boot
/dev/sda5 2263040 2726297566 2724034527 1.3T Linux filesystem

If we use the xfs file system, which is most common on CentOS, although sometimes it is also used on Debian and Ubuntu.
#xfs_growfs /dev/sda5
 
Last edited:

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!