Hello,
I'm trying to resize the root disk of a Linux VM on Proxmox but my case doesn't fit the steps shown in the manual (https://pve.proxmox.com/wiki/Resize_disks).
I extended the size via the GUI form 50 to 80GB already. The VM is not showing this, yet, obviously but running the dmesg command from the manual shows the size increase was detected:
The partition layout differs from what is shown in the manual since my root drive is not in the last partition (the extended one, as in the manual) but rather in the first/primary partition while the extended one holds the swap partition:
This is probably why the remaining steps in the manual do not work for me. Running
but rather just the partition layout again and the new size of the underlying disk:
and running
Which I assume will not work, even if I answered "yes"! because there is the extended partition with the swap behind partition 1.
Is there any way to resize the root partition online? Can I just delete the swap partition and the extended one and then run
If so: How do I do this? And can I re-enable swap afterwards? As a swapfile?
Any help is highly appreciated!
I'm trying to resize the root disk of a Linux VM on Proxmox but my case doesn't fit the steps shown in the manual (https://pve.proxmox.com/wiki/Resize_disks).
I extended the size via the GUI form 50 to 80GB already. The VM is not showing this, yet, obviously but running the dmesg command from the manual shows the size increase was detected:
Code:
root@VM:~# dmesg | grep sda
[ 1.888739] sd 2:0:0:0: [sda] 104857600 512-byte logical blocks: (53.7 GB/50.0 GiB)
[ 1.888782] sd 2:0:0:0: [sda] Write Protect is off
[ 1.888783] sd 2:0:0:0: [sda] Mode Sense: 63 00 00 08
[ 1.888853] sd 2:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 1.891177] sda: sda1 sda2 < sda5 >
[ 1.891362] sd 2:0:0:0: [sda] Attached SCSI disk
[ 2.600384] EXT4-fs (sda1): mounted filesystem with ordered data mode. Quota mode: none.
[ 2.993397] EXT4-fs (sda1): re-mounted. Quota mode: none.
[ 3.216527] Adding 998396k swap on /dev/sda5. Priority:-2 extents:1 across:998396k FS
[3366745.552412] sd 2:0:0:0: [sda] 167772160 512-byte logical blocks: (85.9 GB/80.0 GiB)
[3366745.552560] sda: detected capacity change from 104857600 to 167772160
The partition layout differs from what is shown in the manual since my root drive is not in the last partition (the extended one, as in the manual) but rather in the first/primary partition while the extended one holds the swap partition:
Code:
root@VM:~# fdisk -l /dev/sda | grep ^/dev
/dev/sda1 * 2048 102856703 102854656 49G 83 Linux
/dev/sda2 102858750 104855551 1996802 975M 5 Extended
/dev/sda5 102858752 104855551 1996800 975M 82 Linux swap / Solaris
This is probably why the remaining steps in the manual do not work for me. Running
parted /dev/sda and then print does not show the message shown in the manual:
Code:
Warning: Not all of the space available to /dev/vda appears to be used, you can
fix the GPT to use all of the space (an extra 268435456 blocks) or continue
with the current setting?
Fix/Ignore? F
but rather just the partition layout again and the new size of the underlying disk:
Code:
Model: QEMU QEMU HARDDISK (scsi)
Disk /dev/sda: 85.9GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 1049kB 52.7GB 52.7GB primary ext4 boot
2 52.7GB 53.7GB 1022MB extended
5 52.7GB 53.7GB 1022MB logical linux-swap(v1) swap
and running
(parted) resizepart 1 100% does not resize it but prints out:
Code:
(parted) resizepart 1 100%
Warning: Partition /dev/sda1 is being used. Are you sure you want to continue?
Yes/No? n
Which I assume will not work, even if I answered "yes"! because there is the extended partition with the swap behind partition 1.
Is there any way to resize the root partition online? Can I just delete the swap partition and the extended one and then run
resizepart 1 100%?If so: How do I do this? And can I re-enable swap afterwards? As a swapfile?
Any help is highly appreciated!