Qual sistema de arquivos o disco está usando? Se for ext4, você poderá fazer isso com resize2fs:
link
Algumas informações relevantes:
You can use fdisk to change your partition table while running. The stock Ubuntu install has created 3 partitions: one primary (sda1), one extended (sda2) with a single logical partition (sda5) in it. The extended partition is simply used for swap, so I could easily move it without losing any data.
- Delete the primary partition
- Delete the extended partition
- Create a new primary partition starting at the same sector as the original one just with a bigger size (leave some for swap)
- Create a new extended partition with a logical partition in it to hold the swap space
Make the file system bigger with resize2fs online on a mounted partition:
sudo resize2fs /dev/sda1
After rebooting the swap space wasn’t active. Turned out you need to run mkswap, adjust /etc/fstab to the new UUID and turn the swap on
As conseqüências das coisas darem errado são bem terríveis, então se você puder encontrar outra maneira de fazer isso, eu escolheria isso.