0

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.

7
  • Details matter here - is either of the partitions you are trying to modify still mounted? are you trying to do this using gparted from the system in question, or from an external live CD or USB? Jul 2, 2017 at 16:17
  • 2
    Include a screenshot of what gparted shows. You may need to install it (sudo apt-get install gparted) and run it as root (sudo gparted)
    – Thomas Ward
    Jul 2, 2017 at 17:14
  • Show me a current-window-only screenshot of 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.
    – heynnema
    Jul 2, 2017 at 17:38
  • @steeldiver: my main partition (the Ubuntu one) is still mounted. THe unallocated one, I'm not sure. And I tried it with live CD to no avail. I mistyped live as "love". I used the swapoff command to no avail. Said it did not recognized it. Jul 2, 2017 at 17:41
  • Here is the screenshot: i.imgur.com/c3ZlTqr.png for thise who requested it (mainly @heynnema) Also, from the system in question, not live. Jul 2, 2017 at 17:47

2 Answers 2

0

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 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 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 left
  • resize 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
0
0

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.

1
  • 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

Not the answer you're looking for? Browse other questions tagged .