Score:1

Can I extend the root partition with adjacent unallocated space?

nl flag

I'm new to Ubuntu and have chosen this distro to be my daily driver. I have installed Ubuntu 20.04 3 LTS (Focal Fossa) on a 256 GB SSD. It was pretty much a default installation with just the boot and root partitions.

I made a backup of this installation to a disk image on an external USB SSD drive using Clonezilla.

I have now replaced the computer's internal 256GB SSD drive with a 512GB SSD one and have successfully restored the Clonezilla backup image to the new disk. However, the additional disk space now available is not included in the root partition (it seems Clonezilla has restored the partitions with their original size and left the extra 256GB space as "unallocated" on the disk). Everything in Ubuntu still works fine though, just as it did before. This is what my disk looks like now:

gparted screenshot

I want to extend the root partition using the available (and adjacent) unallocated space in the new disk. I have tried booting from a live USB drive and using gparted to extend the root partition on the 512GB SSD but it does not allow me to increase it. How can I put the unallocated space to use? (I want it all in the root partition)

I researched this issue here before posting this question but I could not find a scenario similar to mine. I'm coming from decades of using Windows and am not too savvy when it comes to Linux.

Is what I'm trying to do even possible? Am I misunderstanding some basic concept?

Thank you for your help, and a Happy New Year :)

Regards, jonnym

pasman pasmański avatar
mx flag
How gparted does not allow to resize partition ? Option is grayed? There is error message ?
heynnema avatar
ru flag
Status please...
Score:1
ru flag

Make sure that you have a good backup of your important Ubuntu files, as this procedure can corrupt or lose data.

Keep these things in mind:

  • always start the entire procedure with issuing a swapoff on any mounted swap partitions, and end the entire procedure with issuing a swapon on that same swap partition

  • a move is done by pointing the mouse pointer at the center of a partition and dragging it left/right with the hand cursor

  • a resize is done by dragging the left/right side of a partition to the left/right with the directional arrow cursor

  • if any partition can't be moved/resized graphically, you may have to manually enter the specific required numeric data (don't do this unless I instruct you to)

  • you begin any move/resize by right-clicking on the partition in the lower pane of the main window, and selecting the desired action from the popup menu, then finishing that action in the new move/resize window

Do the following...

Note: if the procedure doesn't work exactly as I outline, STOP immediately and DO NOT continue.

  • boot to a Ubuntu Live DVD/USB, in “Try Ubuntu” mode
  • start gparted
  • resize the right side of /dev/sda2 all the way to the right
  • resize the right side of /dev/sda5 all the way to the right
  • click the Apply icon
Score:0
in flag

I assume that by booting the live USB drive, your new SSD got mounted somehow.

Make sure that your SSD is unmounted before you start gparted. gparted refuses to work if the partition is already mounted. After you have unmounted it, most likely just by a sudo umount /dev/sda, there shouldn't be any problem in resizing your root partition.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.