So this is driving me mad. I tried using gparted but it won't let me merge them. I have unallocated space that I want merge with my partition. I used the unallocated space for an XP dualboot, however, after learning about VT-x and hardware virtualization, I removed it and installed XP in virtualbox. Now I want to merge the unallocated space with Ubuntu. I tried doing it love to no avail. I even tried swapoff and that, too, failed.
2 Answers
Make sure that you have a good backup of your important Ubuntu files, as this procedure can corrupt or loose data.
The use of an extended partition (sda3) makes this a little difficult. I'll outline the easiest way first, and we can add more to the procedure if we have to.
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 aswapon
on that same swap partitiona 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 part 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 the a Ubuntu Live DVD/USB
- start
gparted
- right-click on sda6 in the bottom pane and select
swapoff
- right-click on sda3 in the bottom pane and select
move/resize
resize
the left side of sda3 all the way left- right-click on sda5 in the bottom pane and select
move/resize
move
sda5 all the way leftresize
the right side of sda5 all the way right- if it all looks OK, then click on the "Apply" icon
- right-click on sda6 in the bottom pane and select
swapon
- quit
gparted
- reboot
First, be aware that unallocated space is just that. It's like empty space on a bookshelf -- unused. Although it's clear what you mean, describing that as "merging" unallocated space with an existing partition makes about as much sense as "merging" empty space on a bookshelf with books. You can add new partitions (or books) or expand a partition (or book -- but here the analogy breaks down a bit) to fill unused space. Thinking about it as "merging" is likely to set up a misleading mental model that could lead you astray. Indeed, some of the comments asking about whether the partitions (plural) are mounted are examples of this -- you can't mount unallocated space.
Second, there are numerous existing tutorials on how to use GParted, such as:
There are lots more, as Google will reveal.
Your specific case is not out of the ordinary, but you may run into some stumbling blocks:
- You must unmount all the partitions you intend to adjust. This means you must boot from an emergency disk of one form or another, since you want to modify your Ubuntu root (
/
) partition. - The partition you want to expand is a logical partition inside an extended partition. This means that you must first expand the extended partition (
/dev/sda3
in your case) and then expand the logical partition (your/dev/sda5
.) - Extending a partition from its start point is both riskier and more time-consuming than extending a partition from its end. Thus, you should set aside enough time, and if you do this without having backups, you're taking a grave risk.
As an alternative to resizing that partition, you might consider creating a new one and mounting it somewhere convenient (say, /home/joey/extradata
). This will be quicker and safer than expanding your existing partition, but it will limit your options about what goes where. As you've got over 450 GiB in both the existing Ubuntu root (/
) partition and the free space, and only about 30 GiB used, this may not be a big deal unless you expect to add a lot of (or very large) new files.
-
Yeah, sorry; been busy studying Tax prep. It's getting late here (9:25PM) so I'll do it in conjunction with studying tomorrow. Jul 3, 2017 at 1:25
gparted
shows. You may need to install it (sudo apt-get install gparted
) and run it as root (sudo gparted
)gparted
and I'll take a look. Do you have a Ubuntu Live DVD/USB? If not, you'll need to make one. Start new comments to me with@heynnema
or I may miss them. Let me know when you've got the screenshot.