Hi,
so I am building a Debian 12 VM template with cloud-init. I basically have everything working already, except the automatic resizing for the disk. When trying to run
Here is the full command output:
Does anyone know how you can fix this?
so I am building a Debian 12 VM template with cloud-init. I basically have everything working already, except the automatic resizing for the disk. When trying to run
sudo growpart /dev/vda 5
, it fails because of No space left on device.
.Here is the full command output:
Code:
ciuser@debian:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sr0 11:0 1 4M 0 rom
sr1 11:1 1 1024M 0 rom
sr2 11:2 1 1024M 0 rom
vda 254:0 0 48G 0 disk
├─vda1 254:1 0 487M 0 part /boot
├─vda2 254:2 0 1K 0 part
└─vda5 254:5 0 31.5G 0 part
└─debian--vg-root 253:0 0 31.5G 0 lvm /
ciuser@debian:~$ sudo growpart /dev/vda 5
attempt to resize /dev/vda failed. sfdisk output below:
| Backup files:
| MBR (offset 0, size 512): /tmp/growpart.ls8aej/orig.save-vda-0x00000000.bak
| EBR (offset 512752640, size 512): /tmp/growpart.ls8aej/orig.save-vda-0x1e8ffc00.bak
|
| Disk /dev/vda: 48 GiB, 51539607552 bytes, 100663296 sectors
| 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: dos
| Disk identifier: 0x3d44182f
|
| Old situation:
|
| Device Boot Start End Sectors Size Id Type
| /dev/vda1 * 2048 999423 997376 487M 83 Linux
| /dev/vda2 1001470 67106815 66105346 31.5G 5 Extended
| /dev/vda5 1001472 67106815 66105344 31.5G 8e Linux LVM
|
| >>> Script header accepted.
| >>> Script header accepted.
| >>> Script header accepted.
| >>> Script header accepted.
| >>> Script header accepted.
| >>> Created a new DOS (MBR) disklabel with disk identifier 0x3d44182f.
| /dev/vda1: Created a new partition 1 of type 'Linux' and of size 487 MiB.
| Partition #1 contains a ext2 signature.
| /dev/vda2: Created a new partition 2 of type 'Extended' and of size 31.5 GiB.
| /dev/vda3: No free sectors available.
| Failed to add #3 partition: No space left on device
| Leaving.
|
FAILED: failed to resize
***** WARNING: Resize failed, attempting to revert ******
512+0 records in
512+0 records out
512 bytes copied, 0.00153709 s, 333 kB/s
512+0 records in
512+0 records out
512 bytes copied, 0.000825545 s, 620 kB/s
***** Restore appears to have gone OK ****
Does anyone know how you can fix this?