Resize root partition to unallocated space before
A partition can only be resized by modifying its end. Therefore first, you have to move the /
partition to the beginning of the drive, gaining some free space after the moved /
partition. Then you can grow the /
partition which will be done by changing its end block number to a bigger number.
These actions can both be made through GParted, called from a live system on an USB or a DVD, but not from the current system where the partition is currently mounted.
Related videos on Youtube
![jave.web](https://i.stack.imgur.com/rHRkY.jpg?s=256&g=1)
jave.web
Updated on September 18, 2022Comments
-
jave.web almost 2 years
I need more space on my root partition running Ubuntu 17 (using Xfce session).
I do have a lot of unallocated space BEFORE.
However, when I try to resize root partition -/dev/sdb2
, I can't add/remove a MiB...Is this even possible?
If so, can it somehow be done from the live system or do I have to use live CD/USB?
There is really just Ubuntu and Xcfe session, LUBUNTU_SYSTEM is just an old label :)
-
muclux over 6 yearsYou cannot resize a mounted partition so you have to use a live session. Then you can first move your / partition to the beginning of your disk and then resize. I would recommend a backup before any operation on the partitions - one never knows ...
-
jave.web over 6 years@muclux will the system and booting remain untouched? :)
-
muclux over 6 yearsWell, as I said, better backup before. But normally all should go well, if you pay attention at what you are doing. Boot from Live DVD/USB, call gparted, move /dev/sdb2 to create an unallocated space behind it, and then resize /dev/sdb2. Don't mount your disk partitions during this operation.
-
jave.web over 6 years@muclux Thank you, booting a linux live USB (Lubuntu Try Mode) and using GParted worked :) ... I think that I have read somewhere that in newer versions you can resize/move even when in the live system - is it impossible in this case because it is not just expanding to the right but also moving to the left?
-
psusi over 6 yearsYou can only grow to the right while it is mounted. Moving requires it to be unmounted. BTRFS can even shrink while it is mounted ;)
-
jave.web over 6 yearsI think that you 2 (@muclux and @psusi) should work on an answer together so this question has more clear and readable answer :) Thank you for your inputs !
-