I have before me the following problem:
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 28G 26G 240M 100% /
So, looking to expand this disk, I do the following:
$ sudo parted /dev/sda
GNU Parted 3.2
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Model: ATA QEMU HARDDISK (scsi)
Disk /dev/sda: 50.5GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 1049kB 30.1GB 30.1GB primary ext4 boot
2 30.1GB 40.0GB 9934MB extended
5 30.1GB 34.4GB 4293MB logical linux-swap(v1)
(parted) resizepart
Partition number? 1
Warning: Partition /dev/sda1 is being used. Are you sure you want to continue?
Yes/No? Yes
End? [30.1GB]? 40GB
Error: Can't have overlapping partitions.
I was surprised to find Number 2 and 5, and also that number 2 appears to go to 40GB and number 5 starts at the same point and only goes to 34.4GB.
Someone must have tried this before me but also failed.
Also strange: /dev/sda2 exists but does not show up in the output of df -h
.
I don't know what to do here. Do I need to merge sda1 and sda2 somehow? How would I even do that? What about that swap partition? Do I need to change it to start at the end of sda2? How do I do that?
Any help would be appreciated. I just want to get this system to be simple and orderly, easy to manage.