Score:1

How to resize root partition

kr flag

I'm about to run out of space on my root partition and I have plenty of unallocated space. When creating the partitions, I thought I had enough space, but it turned out that I didn't. On the information I found it says that it is quite risky, so I want to make sure to do it properly. How should I resize the root partition? (I have a dual boot with windows)

Here is the situation:

enter image description here enter image description here enter image description here

Update: I followed your instructions and an error occured:

enter image description here enter image description here

oldfred avatar
cn flag
Little key icons say partitions are mounted. You have to use flash drive live installer so all partitions are unmounted. Any partition change has risks, so you must have good backups of everything on drive. You will have to move /home right, then with unallocated next to / you can expand it right. The move may be slow depending on amount of data it has to move, do not interrupt move as that would totally corrupt data. May sure not on battery power or anything else that might interrupt system.
Aarav Garg avatar
in flag
Use gpartition on a live preview.
heynnema avatar
ru flag
Please see my answer. If it's helpful, please remember to accept it by clicking on the checkmark icon that appears just to the left of my answer. Start comments to me with @heynnema or I'll miss them.
vn flag
Does this answer your question? [How can I resize an ext root partition at runtime?](https://askubuntu.com/questions/24027/how-can-i-resize-an-ext-root-partition-at-runtime)
Name avatar
kr flag
@PabloBianchi I already solved it but thanks!
Score:2
ru flag

gparted

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 left side of /dev/nvme0n1p6 to the right by approximately 70G
  • resize the right side of /dev/nvme0n1p5 all the way to the right
  • click the Apply icon

When done, quit gparted and reboot.

Update #1:

GRUB

Edit /etc/default/grub and edit these two lines at the top of the file...

GRUB_DEFAULT=saved    # edit this line
GRUB_SAVEDEFAULT=true # add this line

sudo update-grub # write the changes to disk

reboot # verify results

At the GRUB menu, manually select Ubuntu to boot. It will remember this selection until you manually change it to something else.

Update #2:

Windows

Source: How do I install Ubuntu alongside a pre-installed Windows with UEFI?

Another issue that could make the system boot directly to Windows (without even showing the GRUB menu) is if either Windows took hold of the boot manager or after installing Ubuntu, the EFI partition was not properly configured for Windows. To solve this, simply go to Windows and open a terminal, then type the following (Need Administrative Privileges):

bcdedit /set {bootmgr} path \EFI\ubuntu\shimx64.efi

This will configure the Windows Boot Manager to take into consideration the GRUB Boot Manager. This could still happen even after running the Boot Repair from within Ubuntu. So making sure that Windows reads the Ubuntu EFI partition, in case you are using an EFI boot system instead of the old BIOS will solve it. In the above command line, the difference between shimx64.efi and grubx64.efi is that shimx64 is the actual Microsoft signed binary that works with Secure Boot enabled while grubx64 is the normal grub binary (Not signed).

Name avatar
kr flag
Thanks for the instructions, it was really clear. I updated the post with more pictures of the error I had. What should I do now? I have a backup of my root and home directories.
Name avatar
kr flag
I forgot to mention you ;)
heynnema avatar
ru flag
@Name You were booted to a Ubuntu Live DVD/USB, correct? Did you follow the instructions in the error dialog... "Partition-->Check"?
Name avatar
kr flag
Yes I was using a USB and no I didn't follow the instructions because you said to stop immediately and don't continue if the procedure doesn't work exactly as you outline. So I stopped to don't mess it up. I'm going to follow the instructions in the error and tell you how it goes.
heynnema avatar
ru flag
@Name Good job! Let me know how it goes.
Name avatar
kr flag
it worked! Thank you very much. Also I don't have installed correctly the boot files, to boot to ubuntu I have to press f11 to get the grub maneger and then select ubuntu. I read that I should change the boot order on the UEFI but that doesn't work. Do you know why is that? Or how can I solve it? Thanks again.
Name avatar
kr flag
Now I see that I used the wrong tutorial for the installation xd
heynnema avatar
ru flag
@Name See Update #1 in my answer.
Name avatar
kr flag
It didn't work. Then I checked if the file is still updated after reboot and it is. The pc boots directly into windows if I don't press f11.
heynnema avatar
ru flag
@Name You did Update #1, yes? Try booting again, and this time continue to tap the ESC key as soon as you see the BIOS splash screen, and see if you get to the GRUB menu.
Name avatar
kr flag
No, it didn't. I booted into windows.
heynnema avatar
ru flag
@Name If you can't get to the GRUB menu, then the problem is either in your UEFI settings in the BIOS (but I think you've already checked that), or it's a setting in Windows that causes the problem. See the lengthy answer at https://askubuntu.com/questions/221835/how-do-i-install-ubuntu-alongside-a-pre-installed-windows-with-uefi and look down to the Troubleshooting section for what to do in Windows.
Name avatar
kr flag
all right, I'll check that, thank you.
heynnema avatar
ru flag
@Name See Update #2 in my answer.
Name avatar
kr flag
IT WORKED!! It was update #2. Thank you a lot!
heynnema avatar
ru flag
@Name Great news! You're on your way!
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.