How do I resize a partition in Ubuntu linux without losing data?

I ran out of space in my on the drive only to find that there was another unformatted partition in the system that is available. I now want to resize the current partition to take in the empty partition without losing data. Any ideas?

Here is Solutions:

We have many solutions to this problem, But we recommend you to use the first solution because it is tested & true solution that will 100% work for you.

Solution 1

boot from live Linux distro (you can use Ubuntu install disk) and use gparted

But always something can go wrong, so it is advisable to make a backup.

The other option is to format the unused partition and mount it and use it (depending on the size) as /home or /usr

Solution 2

LVM is the way to go. Turn your whole spindles into PV’s and migrate from legacy partition-based model to LVM model. RedHat has some good documentation on LVM, check it out.

Solution 3

Try this live CD: PartedMagic

Solution 4

I’ve resized my partition successfully without the loss of any data using the method described here, which generally is about deleting the current partition and creating a new one with the same start and a greater end.

But that is probably not the recommended way, especially when the partition to be resized is in between other partitions, because, in my case I had to remove all my partitions (primary storage and swap) and had to recreate them all.

Solution 5

to find that there was another unformatted partition

Are you sure that this isn’t your swap-partition? Beside from that I would recommend LVM as mentioned before by slashdot.

Note: Use and implement solution 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply