I am trying to resize my primary/boot partition to use the added 30GB (virtual machine on Proxmox). As you can see my boot partition is full. I am fairly new to all this so, I'm following the answer from here: Ubuntu - unable to extend partition with growpart - partition 1 could only be grown by 2046
As I understand it, I have two partitions "in the way" of my free space, so I can't simply growpart
, hence googling the error and coming across the above thread.
porter@porter:~$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 5.9G 0 5.9G 0% /dev
tmpfs 1.2G 1.6M 1.2G 1% /run
/dev/sda1 19G 18G 0 100% /
tmpfs 5.9G 0 5.9G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 1.2G 0 1.2G 0% /run/user/0
tmpfs 1.2G 0 1.2G 0% /run/user/1000
Using cfdisk
I can see the 30 GB of free space.
Disk: /dev/sda
Size: 50 GiB, 53687091200 bytes, 104857600 sectors
Label: dos, identifier: 0x0266d922
Device Boot Start End Sectors Size Id Type
>> /dev/sda1 * 2048 39942143 39940096 19G 83 Linux
/dev/sda2 39944190 41940991 1996802 975M 5 Extended
└─/dev/sda5 39944192 41940991 1996800 975M 82 Linux swap / Solaris
Free space 41940992 104857599 62916608 30G
So, I delete sda2
and sda5
, then write the changes.
Disk: /dev/sda
Size: 50 GiB, 53687091200 bytes, 104857600 sectors
Label: dos, identifier: 0x0266d922
Device Boot Start End Sectors Size Id Type
>> /dev/sda1 * 2048 39942143 39940096 19G 83 Linux
Free space 39942144 104857599 64915456 31G
However, when I then go to growpart
, I get an error:
porter@porter:~$ sudo growpart -v /dev/sda 1
update-partition set to true
resizing 1 on /dev/sda using resize_sfdisk_dos
104857600 sectors of 512. total size=53687091200 bytes
## sfdisk --unit=S --dump /dev/sda
label: dos
label-id: 0x0266d922
device: /dev/sda
unit: sectors
sector-size: 512
/dev/sda1 : start= 2048, size= 39940096, type=83, bootable
padding 33 sectors for gpt secondary header
max_end=104857567 tot=104857600 pt_end=39942144 pt_start=2048 pt_size=39940096
resize of /dev/sda returned 0.
failed [pt_update:1] pt_update /dev/sda 1
partx: /dev/sda: error updating partition 1
FAILED: pt_resize failed
And the subsequent execution of resize2fs
also fails with an error:
porter@porter:~$ sudo resize2fs /dev/sda 1
resize2fs 1.46.2 (28-Feb-2021)
resize2fs: Device or resource busy while trying to open /dev/sda
Couldn't find valid filesystem superblock.
Any guidance would be greatly appreciated.