Minska hdd storlek i Proxmox gäst som har lagring på zfs

Hämtat från: https://forum.proxmox.com/threads/shrink-zfs-disk.45835/#post-220907

Basic guide (may need improvments and it’s not failproof) to shrink zfs disks:

1. prepare your vm disk for shrinking and shut it down
2. in pve shell set new zfs pool size
Code:

$zfs set volsize=<new size>G rpool/data/vm-<vm id>-disk-<disk number>

3. edit vm config in /etc/pve/local/qemu-server/<vm id>.conf on line
Code:

virtio0: local-zfs:vm-<vm id>-disk-<disk number>,size=<new size>G

Obviusly the line may not be the same, just edit the disk size
4. in pve panel change the cache mode to something else and then revert back, this should update the config

Note: you may corrupt your partition table, to fix it in linux boot on a recovery live image like gparted and launch gdisk
Code:

$ gdisk /dev/vda

and then press v,x,e,w and y.
This should do the trick.

Lämna ett svar

Din e-postadress kommer inte publiceras. Obligatoriska fält är märkta *