0

I need to extend the / partition with all the unallocated space. The problem is that they are not adjacent so it can't be done directly from the UI.

How can I proceed via terminal?

GParted partitions

Update

du -hsx --exclude=/{proc,sys,dev,run} /* | sort -hr

39G /home
14G /usr
5,4G    /var
1,9G    /opt
1,9G    /lib
275M    /boot
31M /etc
15M /bin
14M /sbin
13M /root
1,2M    /tmp
48K /snap
28K /media
16K /lost+found
4,0K    /srv
4,0K    /mnt
4,0K    /lib64
4,0K    /cdrom
0   /vmlinuz.old
0   /vmlinuz
0   /initrd.img.old
0   /initrd.img

Update 2

Actually, most of the space is in the cache dir.

$ sudo find -maxdepth 1 -exec du -sh "{}" \; | sort -rh
37G .
14G ./.cache
3,9G    ./.sdkman
3,5G    ./.config
2,7G    ./.gradle
2,4G    ./.local
2,2G    ./.m2
2,0G    ./.minikube
1,9G    ./.npm
1,8G    ./.nvm
823M    ./snap
375M    ./.3T
370M    ./studio3t
322M    ./Desktop
271M    ./go
220M    ./.PyCharm2018.3
136M    ./.embedmongo
114M    ./.joplin
96M ./.eclipse
95M ./.vscode
93M ./.java
32M ./.var
1Z10
  • 101
  • 2
  • 2
    Does this answer your question? [How to resize partitions?](https://askubuntu.com/questions/126153/how-to-resize-partitions) – ChanganAuto May 10 '22 at 09:00
  • Sadly not because the unallocated space is not adjacent to the / partition. Maybe I need to move first the home partition at the end of the disk for them to be adjacent. – 1Z10 May 10 '22 at 09:10
  • The duplicate mentions all situations and yes, of course you'll have to move. But that isn't /home, it's an additional partition likely in removable media that you chose to label as HOME. Furthermore, **have backups**. Simply increasing a partition's size is a very low risk operation but moving is HIGH risk. – ChanganAuto May 10 '22 at 09:16
  • What do you have in / that is using so much space? Or is it all the data in /home that really should be in your partition labeled as /home. You have to mount /home in fstab to have data saved into it. To move /home uses rsync- Be sure to use parameters to preserve ownership & permissions https://help.ubuntu.com/community/Partitioning/Home/Moving – oldfred May 10 '22 at 13:23
  • I did run the du command and it seems that the home occupies more than half of the partition. – 1Z10 May 10 '22 at 13:48

0 Answers0