I've got dual boot Ubuntu 20.04 in my computer and some days ago I'm frequently getting the "free up disk space" advice in my root partition (20GB).
When I check the disk usage, I can see /usr directory is using 7.2GB /var is using 6.1GB and /opt is using 1.1GB.
When I installed Ubuntu I didn't know how much space assign to root and home partitions so I followed tutorials and I've done 20GB to the first one and 130GB to the second one, now I have 92% usage on root and 13% on home, so I want to either give the root partition more of the space that home partition is not using or, in the other hand, move the /usr (/var and /opt too) inside the /home directory, in order to get /home/usr; home/var and home/opt structure.
I've just seen this post How to move /usr to a new partition? that is the unique available with sort of the same problem, but I don't want to create a new partition for usr, so I just copied the directory but I'm afraid to go on with the next steps.
I don't want to risk my OS with simply directly moving the directory due it seems dangerous from another forums; and clearly I don't want to preserve a copy in "/" because I need to free up space there.
I've already cleaned up older kernel versions and useless installed packages following other posts, but it isn't enough; currently I cannot go on with any Live CD solution since I don't have usb stick with me.
¿What could I do?
/var/log/
and check for large files there. If so examine the last 100 lines and fix the error it shows, and then dosudo > {logfile}
to empty it. "move the /usr (/var and /opt too) inside the /home directory" No, just no. More than likely to kill your system if you do./usr
to inside the/home/
sounds like a very bad idea. Ubuntu may not boot after such a move, as Linux as a very strict and well defined directory structure for its system directories.