Enlarge /dev/sda1 in Debian VM? From 32GB to 64GB

vendo232

Member
Dec 16, 2021
14
4
8
47
Team

I have a Debian VM which is using 32GB , I managed to extend and add aditional 32GB in Proxmox but now I need to extend that size in the OS.

I have tried to follow the Proxmox guide but it is not working on my case. Would you be able to help me?

1640734618671.png

Code:
server@debian2:~$ sudo fdisk -l /dev/vda | grep ^/dev
fdisk: cannot open /dev/vda: No such file or directory
server@debian2:~$ sudo fdisk -l /dev/sda | grep ^/dev
/dev/sda1  *        2048 65107967 65105920   31G 83 Linux
/dev/sda2       65110014 67106815  1996802  975M  5 Extended
/dev/sda5       65110016 67106815  1996800  975M 82 Linux swap / Solaris
server@debian2:~$ parted /dev/sda
-bash: parted: command not found
server@debian2:~$ sudo parted /dev/sda
GNU Parted 3.4
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Model: QEMU QEMU HARDDISK (scsi)
Disk /dev/sda: 68.7GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End     Size    Type      File system     Flags
 1      1049kB  33.3GB  33.3GB  primary   ext4            boot
 2      33.3GB  34.4GB  1022MB  extended
 5      33.3GB  34.4GB  1022MB  logical   linux-swap(v1)

(parted) resizepart 1 100%
Warning: Partition /dev/sda1 is being used. Are you sure you want to continue?
Yes/No? y
Error: Can't have overlapping partitions.
(parted) ^C

server@debian2:~$ resize2fs /dev/sda1
-bash: resize2fs: command not found
server@debian2:~$ sudo resize2fs /dev/sda1
resize2fs 1.46.2 (28-Feb-2021)
The filesystem is already 8138240 (4k) blocks long.  Nothing to do!
 
Last edited:
I fixed the problem by

1. booting into GParted Live iso on that VM.
2. Deleting /dev/sda2 including Swap file
3. resizing the sda1 to 95% leaving 5GB free for swap
4. creating new swap file using those remaining 5GB
5. Once booted back to Debian I had to update UUID in fstab

now the system boots OK, but it is waiting for something while booting and the booting time is longer. If you ever figure out why pls ping me.
 

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!