Just to clarify how I do this for anyone that is still reading this thread.
If it is the boot partition you want to resize, then you must boot from a bootcd or bootusb "rescue" drive which is just a Live Linux. This allows you to run Linux on the machine other then the drive you want to make changes to.
I think the best "rescue" cd or usb in this case would be a bootable gparted USB or CD
Cases in which you need a rescue image
1. Partition to be expanded is the last partition, but you booted from it and cannot unmount it.
sda1 = boot (or swap)
sda2 = swap (or boot)
sda3 = /
- If partition to be expanded is NOT the last partition, you must use gparted boot image to move or resize the partitions.
sda1 = boot
sda2 = / (partition to be expanded is not last)
sda3 = swap
If you want to change a mounted partition that is not the "root" partition (/), like /home which is a different partition, then there is no need to use a rescue image. This is especially true if is the last partition.
sda1 = boot
sda2 = /
sda3 = /home
sda1 = /
sda2 = /home
This is the situation I have when I take a image from a smaller drive or SSD and move it to a larger SSD.
In this case, you just need to unmount /home while you extend it. But to unmount /home, you need to make sure you are not logged into any user account whose home directory is within it. Since "root" user's home directory is directly under the system root / as in /root, if you can log into root, then you can unmount /home
I logout of a GUI (KDE / Gnome / etc) session and use [CTRL] + [ALT] + [F1] to bring up a shell session.
If you just logged out of a user log in, it can take Linux 20-30 seconds to finish closing any files, so you might get errors trying to umount /home.
1. umount /home (I retry this command if it fails for up to 30 seconds, then go look at other sessions to see if I am "cd /home/xxx" somewhere.)
2. parted /dev/sda
a. resize x (x = partition you want to resize, use "p" to get a list of partitions)
b. Enter last sector of resize = "-1" (minus 1 means 1 sector from end of disk)
c. q (quits parted)
3 resize2fs /dev/sda"x" (x = partition to be resized. This also remounts the filesystem)
4. df -m (I check /home to verify it resized)
I have never lost files or corrupted the drive using this method.