Welcome, Guest. Please login or register.
Did you miss your activation email?

Author Topic:  Resize Root  (Read 2416 times)

Offline sotnik

  • User
  • Posts: 110
Resize Root
« on: 2022/06/21, 00:28:11 »
I run out of space on my root partition and I would like to increase it.
The partition scheme I have is a bit messy as you can see in the following pic https://drive.google.com/file/d/111d6FgEDG2fUl_dwdrABlbdrtkMes76u/view?usp=sharing
I had a windows partition that I deleted and there are many portions left behind that I use as data storage.
Any help is welcome

Online ayla

  • User
  • Posts: 1.744
Re: Resize Root
« Reply #1 on: 2022/06/21, 09:25:50 »
what I'm doing when my root partition is running out of space is an "apt autoremove" and an "apt clean".
root@siducer:~# du -sh /var/cache/apt/archives
4,6G    /var/cache/apt/archives
root@siducer:~# du -sh /var/cache/apt/archives
368K    /var/cache/apt/archives

This last one empties the archive of apt, which get filled  by every  upgrade of the system.

If thats not enough free space after, your "gparted" offers under "Partition" the easy to use option "resize", where you can give your root partition a few GB from your /home by simply moving the borders in the diagram of your partiton. I had used this option now and then with no problems ever.
First shrink your home the amount of storage you like to give your root, eventually shift your home to the position needed, then resize your root in the now freeed space. Of course this is not working on a running system, so you have to use a live system to do so.

« Last Edit: 2022/06/21, 09:59:59 by ayla »

Offline unklarer

  • User
  • Posts: 824
Re: Resize Root
« Reply #2 on: 2022/06/21, 10:24:30 »
As I write, @ayla has already replied.
I forgot about the "mucking out system" and the siduction live system.

I do something like this with gparted.
Nevertheless, you should have a backup.

The easiest way is:
shrink -swap (why do you need 32GB)
move -swap to the back
shrink -home
move -home to the gained space (home+swap) in the back
enlarge -root accordingly

To be on the safe side, it is recommended to reinstall grub and possibly adjust the fstab.

gparted offers the option to simulate all this "in one go". If something is only grayed out and cannot be selected, then the order is wrong. You have to determine the future size of root. It also makes sense to have a calculator and the conversions (1 MiB = 1024) at hand. It is practical to "drag" the sizes with the mouse.

Offline eriefisher

  • User
  • Posts: 269
Re: Resize Root
« Reply #3 on: 2022/06/22, 15:03:37 »
Agreed. I see no reason for such a large /swap. Myself, I keep /home to a minimum and put everything in /data. I use links from /home to /data for folders like pictures, docs etc. My /home only contains mostly the hidden stuff. Configs and stuff. This allows me to upgrade or reinstall without touching my files. It also makes back up simpler by just copying /data.