Score:-2

How do I extend root partition?

za flag

My root partition is 90% full because, when I installed Ubuntu, I thought that my /home partition needed more space. So right now I have a 20 GB root partition, 150 GB for my /home partition, and 40 GB of unallocated space that I would like to give to my root partition! Note that I am dual booting Ubuntu with Windows 11.

I tried using GParted, and the disk manager from Ubuntu, but it was unsuccessful. Using lsblk does not show where my partition starts, so I cannot use fdisk to delete my partition and extend it to where it starts.

screenshot of GParted

Nmath avatar
ng flag
The **minimum** requirements for Ubuntu Desktop are 25GB. 20GB is insufficient. It would be wise to allocate more space than the bare minimum. If you want to expand the root partition to unpartitioned space, that unpartitioned space must be adjacent to the root partition. Your question lacks sufficient detail to understand your partition layout. If I were you, I'd just reinstall the system. Do you even really need a separate home partition?
pLumo avatar
in flag
See https://askubuntu.com/questions/404361/extending-my-root-paritition?rq=1
heynnema avatar
ru flag
Edit your question and show me a screenshot of `gparted`. Start comments to me with @heynnema or I'll miss them.
Fed_ avatar
za flag
@Nmath idk if i need a separate home partition.. I thought that it would be where all my file and apps would be installed..
Fed_ avatar
za flag
@heynnema ok now the post is edited with the screenshot!
Fed_ avatar
za flag
@heynnema do i need to move the partition before the unallocated space, or even before the partition where win is installed? Thx!!
heynnema avatar
ru flag
@Fed_ Moving the /dev/nvme0n1p5 partition left moves it to the beginning of the unallocated space. Just follow my instructions :-)
Fed_ avatar
za flag
@heynnema ok! i'm setting up my Ubuntu Live usb!! i'll let u know!
heynnema avatar
ru flag
@Fed_ Good luck! Report back.
heynnema avatar
ru flag
@Fed_ MAKE GOOD BACKUPS FIRST!
Nmath avatar
ng flag
No, apps won't be installed there. Some configs will go there but the space used by configs is insignificant. A separate home is not very useful except in some niche situations. If you don't have a clear need for one I'd use the default options which installs the whole system to a single partition. Then you won't encounter these kinds of roadblocks due to rigid partitioning
heynnema avatar
ru flag
@Nmath True. Exactly as I stated in my answer :-)
Fed_ avatar
za flag
@heynnema thx! it worked!!
heynnema avatar
ru flag
@Fed_ Great news!
Pilot6 avatar
cn flag
Does this answer your question? [How to resize partitions?](https://askubuntu.com/questions/126153/how-to-resize-partitions)
Score:2
ru flag

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

Note: Manual multi-partitioning during install (example: a separate / and /home), especially on smallish disks, usually causes partition sizing problems later.

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
  • move the entire /dev/nvme0n1p5 partition all the way left
  • resize the right side of /dev/nvme0n1p5 all the way right
  • click the Apply icon
Satoshi Nakamoto avatar
lc flag
"Move all way to the left" - depending on the type of disk that's not possible, a lot of times moving `/` is a risk and you will need to reconfigure something there to boot.
heynnema avatar
ru flag
@Tyþë-Ø Good news is that my procedure worked, without any drama. Please clarify "type of disk" and "reconfigure something".
Satoshi Nakamoto avatar
lc flag
I tested it on 300 machines. In my experience, *some* disks failed that task not allowing them to move further and if did it completely broke the system. I believe that's not the case with SSD disks anymore, mostly I've tested was HHD
heynnema avatar
ru flag
@Tyþë-Ø I think the difference is that I MOVE the entire partition, and then RESIZE it. Some would just RESIZE the left/beginning part of the partition, and although I don't know for sure, I think that can cause a problem. On your 300 machines, which way did you do it? SSD vs HDD shouldn't make any difference.
Satoshi Nakamoto avatar
lc flag
You're right you made me remember something about moving and resizing they are very different, one can cause a loss of data. It's related to block sizes and I wouldn't remember now as I'm more focused on programming, blocks of data in SSD vs HDD are not the same! I tested few SDDs without the fuzz it was compared to HDD, old BIOS, old H20 vs. new H20, Intel Itanium, which all resulted in different ways to boot the system. Old gparted vs. new GParted, little details matter.
heynnema avatar
ru flag
@Tyþë-Ø I **think** what might break is GRUB, but that can be fixed.
Satoshi Nakamoto avatar
lc flag
Your answer is pretty much valid for today's computers. If I remember I could resize and move many times as I wanted an SSD partition before it corrupts. While in HHD it easily breaks. GRUB was one of the problems, mistake formatting, and block size limits.
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.