[SOLVED] Resizing disk raw virtio disk doesn't work

I have have a RAW virtio disk which is running as a partition for an Ubuntu 14.04.3 LTS VM. I wanted to make it bigger, so I used the PVE web GUI's "resize disk" command, which reported the resize went OK.I then rebooted the guest, and ran resize2fs on the partition, but it said there was nothing to do.How can I get Ubuntu so see the new space on the drive? I note the docs here say that "Linux should see the new size online without reboot with kernel >= 3.6" but that doesn't seem to be the case with me: https://pve.proxmox.com/wiki/Resize_disksEDIT: I've now tried qm resize from the CLUI on the host, and on a different disk, but it's the same result. The disk cannot be made bigger. My host is running: proxmox-ve-2.6.32: 3.4-165 (running kernel: 2.6.32-42-pve) pve-manager: 3.4-11 (running version: 3.4-11/6502936f) pve-kernel-2.6.32-40-pve: 2.6.32-160 pve-kernel-2.6.32-39-pve: 2.6.32-157 pve-kernel-2.6.32-41-pve: 2.6.32-164 pve-kernel-2.6.32-42-pve: 2.6.32-165 lvm2: 2.02.98-pve4clvm: 2.02.98-pve4corosync-pve: 1.4.7-1openais-pve: 1.1.4-3libqb0: 0.11.1-2redhat-cluster-pve: 3.2.0-2resource-agents-pve: 3.9.2-4fence-agents-pve: 4.0.10-3pve-cluster: 3.0-19qemu-server: 3.4-6pve-firmware: 1.1-4libpve-common-perl: 3.0-24libpve-access-control: 3.0-16libpve-storage-perl: 3.0-33pve-libspice-server1: 0.12.4-3vncterm: 1.1-8vzctl: 4.0-1pve6vzprocps: 2.0.11-2vzquota: 3.1-2pve-qemu-kvm: 2.2-11ksm-control-daemon: 1.1-1glusterfs-client: 3.5.2-1Why are line breaks being removed from my posts?
 
Last edited:
Re: resize2fs after resizing disk raw virtio disk saying "nothing to do"

For some reason line breaks are being removed from my posts. Here's an attempt to post the above with them:

I have have a RAW virtio disk which is running as a partition for an Ubuntu 14.04.3 LTS VM.

I wanted to make it bigger, so I used the qm resize command, which reported the resize went OK.

I then rebooted the guest, and ran resize2fs on the partition, but it said there was nothing to do.

How can I get Ubuntu so see the new space on the drive? I note the docs here say that "Linux should see the new size online without reboot with kernel >= 3.6" but that doesn't seem to be the case with me: https://pve.proxmox.com/wiki/Resize_disks

My host is running:

proxmox-ve-2.6.32:
3.4-165 (running kernel: 2.6.32-42-pve) pve-manager: 3.4-11 (running version: 3.4-11/6502936f) pve-kernel-2.6.32-40-pve: 2.6.32-160 pve-kernel-2.6.32-39-pve: 2.6.32-157 pve-kernel-2.6.32-41-pve: 2.6.32-164 pve-kernel-2.6.32-42-pve: 2.6.32-165 lvm2: 2.02.98-pve4clvm: 2.02.98-pve4corosync-pve: 1.4.7-1openais-pve: 1.1.4-3libqb0: 0.11.1-2redhat-cluster-pve: 3.2.0-2resource-agents-pve: 3.9.2-4fence-agents-pve: 4.0.10-3pve-cluster: 3.0-19qemu-server: 3.4-6pve-firmware: 1.1-4libpve-common-perl: 3.0-24libpve-access-control: 3.0-16libpve-storage-perl: 3.0-33pve-libspice-server1: 0.12.4-3vncterm: 1.1-8vzctl: 4.0-1pve6vzprocps: 2.0.11-2vzquota: 3.1-2pve-qemu-kvm: 2.2-11ksm-control-daemon: 1.1-1glusterfs-client: 3.5.2-1

 
Re: resize2fs after resizing disk raw virtio disk saying "nothing to do"

OK so for the benefit of anyone else - I think I worked it out.

I have /dev/vdd which is the "physical" virtual disk. This used to be 15Gb but was resized using PVE's resize disk command to 20Gb.

However, I hadn't originally formatted /dev/vdd but instead created a DOS partition table, with a single 15Gb Linux partition - called /dev/vdd1

This vdd1 partition was then formatted as ext4.

If you resize2fs /dev/vdd1 it will try to make sure the filesystem fills the disk partition. Which it already does as that hasn't changed in size.

Because the disk was partitioned, resizing the disk doesn't do anything very useful. What I now have is a bigger disk with 5Gb of free space. So the best I can do is create another partition (/dev/vdd2) of 5Gb.

So - if I create a new virtual disk & attach it (/dev/vde) I should make sure I don't partition it and instead format it directly (mkfs.ext4 /dev/vde). That way if I resize the disk in the future we I run resze2fs and it will grow as expected (or Ubuntu might even resize it automatically).
 
Re: resize2fs after resizing disk raw virtio disk saying "nothing to do"

Worked here always out of the box:

- increase partition via webgui
- start parted in vm ((parted) resizepart 5 100%)
- pvresize /dev/sda5
- lvextend -L+12G /dev/mapper/vg-root
- resize2fs /dev/mapper/vg-root

Works fine.

Best Regards
 
Yeah but I'm not using LVM. In fact it would be best not to use LVM if I didn't have to since that just complicates things. Easier to use un-partitioned raw disks so you can just re-size them using PVE.
Yes i know. But the have the use:

- increase partition via webgui
- start parted in vm ((parted) resizepart 5 100%)
- resize2fs /dev/sda5

So this does not work for you?

Best Regards
 
That doesn't work because the disk's partition table is MSDOS, which doesn't allow re-sizing in that way. For example:

(parted) print
Model: Virtio Block Device (virtblk)
Disk /dev/vdd: 21.5GB <========== This is the virtual disk size
Sector size (logical/physical): 512B/512B
Partition Table: msdos


Number Start End Size Type File system Flags
1 1049kB 16.1GB 16.1GB primary ext4 <==== This is the partition in it.

So if I do resizepart 1 I can't get it bigger than 16.1GB
 
You do something wrong. It also works fine with msdos. I've just tested. Look at my output:

Code:
parted /dev/sdb
GNU Parted 2.3
/dev/sdb wird verwendet
Willkommen zu GNU Parted! Rufen Sie »help« auf, um eine Liste der verfügbaren Befehle zu erhalten.
(parted) print                                                            
Modell: QEMU QEMU HARDDISK (scsi)
Festplatte  /dev/sdb:  16,1GB
Sektorgröße (logisch/physisch): 512B/512B
Partitionstabelle: msdos


Nummer  Anfang  Ende    Größe   Typ      Dateisystem  Flags
 1      16,4kB  10,7GB  10,7GB  primary  ext4

(parted) resizepart 1 100%                                                
Warnung: Partition /dev/sdb1 is being used. Are you sure you want to continue?
parted: Unbekanntes Zeichen: 100%
Ja/Yes/Nein/No? ja                                                        
Ende?  [10,7GB]? 16,1GB                                                   
(parted) print
Modell: QEMU QEMU HARDDISK (scsi)
Festplatte  /dev/sdb:  16,1GB
Sektorgröße (logisch/physisch): 512B/512B
Partitionstabelle: msdos


Nummer  Anfang  Ende    Größe   Typ      Dateisystem  Flags
 1      16,4kB  16,1GB  16,1GB  primary  ext4


(parted) quit

resize2fs /dev/sdb1 
resize2fs 1.42.9 (4-Feb-2014)
Das Dateisystem auf /dev/sdb1 ist auf /mnt eingehängt; Online-Grössenveränderung nötig
old_desc_blocks = 1, new_desc_blocks = 1
Das Dateisystem auf /dev/sdb1 ist nun 3930660 Blöcke groß.

It also works with virtio.

Best Regards.
 
Last edited:
Hmm, what you say is strange... i have Ubuntu 14.04 (Linux utemplate 3.19.0-31-generic #36~14.04.1-Ubuntu SMP Thu Oct 8 10:21:08 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux)
I've tested it with virtio an an quemudisk (scsi). Both worked fine for me. Post your vmconfig, maybe something is diffrent. Ok, i run PVE4 not 3. But this should have nothing to do with. In the Office we also have PVE3.

Code:
root@PVEHOST:~# qm config 106
boot: c
bootdisk: scsi0
cores: 4
cpuunits: 10000
hotplug: disk,network,memory,cpu
ide2: none,media=cdrom
memory: 1024
name: utemplate.tux.cc
net0: virtio=42:EC:DD:A0:B3:62,bridge=vmbr0
numa: 1
ostype: l26
scsi0: v-machines:vm-106-disk-1,size=41024M
scsi1: v-machines:vm-106-disk-2,size=15G
scsihw: virtio-scsi-pci
sockets: 1
vga: qxl
virtio0: v-machines:vm-106-disk-3,size=15G
 
Last edited:
My config is:

Code:
balloon: 512
bootdisk: virtio0
cores: 4
ide2: local:iso/ubuntu-14.04.2-server-amd64.iso,media=cdrom,size=595M
memory: 8192
name: Lorina
net0: virtio=8A:A1:46:34:36:18,bridge=vmbr0,firewall=1
net1: virtio=3E:99:33:03:77:DB,bridge=vmbr1
numa: 0
onboot: 1
ostype: l26
smbios1: uuid=49f18bef-81e5-4007-a350-b03e1bbbaa63
sockets: 1
virtio0: local:101/vm-101-disk-1.raw,format=raw,size=2G
virtio1: local:101/vm-101-disk-2.raw,format=raw,size=2G
virtio2: local:101/vm-101-disk-3.raw,format=raw,size=5G
virtio3: local:101/vm-101-disk-4.raw,format=raw,size=20G
virtio4: local:101/vm-101-disk-5.raw,format=raw,size=20G
 
What do smbios? And i can't find hotplug. Have you enabled Hotplug for disks?
 
That seems to enabled in the UI? Do I have to add it to the config file manually??

hotplug.png

EDIT: OH! WAIT! It worked! Because with "resizepart 1 100%" I just get "invalid token" - I had to try "resizepart 1 yes 100%" and it worked! Weird... Better make sure it's behaving OK now.
 
Last edited:
Maybe an very old bug. Go to edit an see is there an "1"? Disabel all hotplug, enable only disk and network. The see again in the config.
 

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!