3

Screenshot of gparted Three months ago I dual booted my PC with Windows 8 and Ubuntu 18.04.03. Now I'd like to reduce the size of the Windows partition and increase that of the Ubuntu partition. I can reduce the size of the Windows partition from the disks application, but between the unallocated space and the Ubuntu partition there is the swap partition, so I can't allocate the space to Ubuntu. Is there a way to get around the problem? EDIT:

I don't know why, but after shrinking the Windows partition both Windows and Ubuntu failed to boot, so since I had backed up my important files and didn't use Windows anymore I used the live USB to do a clean install. Thanks anyway for your advices

6
  • A windows swap partition, or Ubuntu?
    – JasonF4
    Jan 3, 2020 at 22:39
  • Honestly I don't even know what it is. I don't know much about partitions Jan 3, 2020 at 22:41
  • It's an ubuntu swap partition Jan 3, 2020 at 22:41
  • 1
    Should use Windows tools for Windows partitions. After Windows is shrunk, can delete or move the two small partitions over and increase ubuntu's size. Use the ubuntu installer USB and backup everything you don't want to lose. Moving partitions can be damaging to data.
    – crip659
    Jan 3, 2020 at 23:06
  • 2
    Does this answer your question? How to resize partitions?
    – karel
    Jan 4, 2020 at 15:31

3 Answers 3

1

You can only extend your root Ubuntu partition to the left from a USB/CD boot, as the file system being moved can't be mounted at the time. You can use the USB/CD you used to install Linux. Back up critical data (documents,...) just in case. (You indicated in your post you could use Windows to shrink its own partition. Just as a note - it's best to shrink this partition from Windows, rather than GParted)

Once in the Ubuntu live setup, start GParted. Delete the swap partition (note its size). Then extend your root Ubunto partion to the left (click on the border line, and drag it over). Apply the change. This could take a long time, as it has to copy the data. Then recreate your swap partition. Apply the change. Done.

3
  • Thanks. I'll try it, but how do I recreate the swap partition? Jan 3, 2020 at 22:57
  • You have to create space on the right hand side. So reduce the size of the Ubuntu partion on the right. Then create a new partion, and set the type. (Check the type before you delete the swap partition by looking at its properties.)
    – JasonF4
    Jan 3, 2020 at 22:59
  • If you use 18.04 or newer, and do not use Hibernation in Linux, you can dispense with a dedicated swap partition and make a swap file instead, which is very much easier to upsize when you need to run an app which needs more virtual memory, and then downsize if you no longer need that app. HOWEVER if you use Hibernation, keep the swap partition. See askubuntu.com/a/1186786/197910
    – K7AAY
    Jan 3, 2020 at 23:38
0

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.

  • First, you must reduce the Windows C: NTFS partition, using the Windows Disk Management tool, to make room to resize your Ubuntu partition.
  • boot to a Ubuntu Live DVD/USB
  • start gparted
  • move /dev/sda7 partition left
  • move /dev/sda8 partition left
  • resize the right side of /dev/sda8 all the way right
  • click the Apply icon
9
  • Hi. I tried but I can't move any partition graphically Jan 6, 2020 at 19:42
  • @GabrieleTerrana Did you boot to a Ubuntu Live DVD/USB first? Had you already reduced the /dev/sda4 Windows partition?
    – heynnema
    Jan 6, 2020 at 22:12
  • I did boot an ubuntu live USB, but I didn't reduce the Windows partition since I thought I could do it after moving the partition. Also, the Windows disk management tool doesn't let me reduce the Windows partition more than 8 gigabytes Jan 7, 2020 at 6:46
  • 1
    @GabrieleTerrana no, you must reduce your Windows C: partition to make room to increase your Ubuntu partition. Use the Windows Disk Management app. If it won't let you make it smaller than 8G, then you have to temporarily disable hibernation (full Windows shutdown), and your page file (System control panel), first.
    – heynnema
    Jan 7, 2020 at 9:08
  • Are swapoff/swapon needed if the resizing is done from a live session? By the way, swap partitions are never mounted literally, they don’t show in the output of mount.
    – Melebius
    Jan 7, 2020 at 9:18
0

I don't know why, but after shrinking the Windows partition both Windows and Ubuntu failed to boot, so since I had backed up my important files and didn't use Windows anymore I used the live USB to do a clean install. Thanks anyway for your advices

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.