Low disk space on filesystem root

rockgtr

New Member
Joined
Apr 25, 2020
Messages
2
Reaction score
0
Credits
0
I recently dual booted my laptop and assigned ~30GB of space to Ubuntu 18.04 and after a week I started to get warnings regarding low space in my root directory. I got by fine for a another week by deleting used stuff and only keeping important things, but now even after doing all that I'm still getting the message.
I have another 80GB unallocated in case I need to extend my partition.
But I don't know how to do that. I have Gparted and Yumi downloaded after looking online for a few solutions, but I don't know how to proceed.
I understand the output of "df -h" helps so I've attached that too.
Any help would be appreciated.
Thanks
Edit: I have added my gparted screenshot as well.
 

Attachments

  • Screenshot from 2020-04-25 13-31-59.png
    Screenshot from 2020-04-25 13-31-59.png
    124.5 KB · Views: 1,315
  • Screenshot from 2020-04-25 13-36-26.png
    Screenshot from 2020-04-25 13-36-26.png
    143 KB · Views: 1,293


In order to extend the root partition, you need to not be using the root partition. The only way to do that is to boot to a USB pen drive, and from there use Gparted on it.
 
One suggestion for you to think about is having 2 partitions for Linux. One for root and a second for home. I have a 40 gig root partition and still have 16 gigs of free space on it. All my settings and saved files are on my home partition which never interferes with that.
 
One suggestion for you to think about is having 2 partitions for Linux. One for root and a second for home. I have a 40 gig root partition and still have 16 gigs of free space on it. All my settings and saved files are on my home partition which never interferes with that.
Is there any way of doing that now? Or would I have to install a fresh version again?
 
You need understand what is writing to your / partition first. I run Kubuntu, but I'm pretty sure Ubuntu has a GUI that will show you the logs and what is being written to disk. There are probably error messages being created by some process or hardware. Deleting stuff won't fix that. My /partition has not had more than 12 GB in it since my last install of 18.04 almost 2 years ago.

Until you figure out what the problem is, you can make the following entries in a terminal, each line at a time, to clean things up and these won't break anything unless your install is already broken:
Code:
sudo apt autoremove
sudo apt autoclean
sudo apt clean
 
Puppy comes in handy, since it also contains Gparted. Any Live CD with Gparted will work, just be sure to
UNMOUNT ROOT (assuming it is /dev/sda1) as root
umount /dev/sda1

START Gparted

RESIZE the partitions as desired (leave 40% free space in its partition for Windows, if applicable)
 
You need understand what is writing to your / partition first. I run Kubuntu, but I'm pretty sure Ubuntu has a GUI that will show you the logs and what is being written to disk. There are probably error messages being created by some process or hardware. Deleting stuff won't fix that. My /partition has not had more than 12 GB in it since my last install of 18.04 almost 2 years ago.
Good point! I just checked my Linux Mint 19.3 desktop machine with "Disk Usage Analyzer" and after several years of use and numerous upgrades my root folder is still only using 20GB of space. I'm sure there is some "cruft" in there I could clean out.

@rockgtr Ubuntu should have the Disk Usage Analyzer in the applications.
My 'guess' would be some log files are running away. Some games take a heck of a lot of space too! This tool will show you what the 'space hogs' are but will not tell you 'why'. A good starting point though.
disk_usage.png
 
Is there any way of doing that now? Or would I have to install a fresh version again?
No, you don't need to reinstall.

I'd do this booted up to a pen drive.

You'd just need to create the new partition, format it, move everything from your current /home to the new partition. Then you need to find the UUID of the new partition by running 'sudo blkid' in terminal. Then you edit /etc/fstab and add a mount for /home to it and point that to the UUID for it. Then when you reboot, you're new partition will be mounted at /home. Make sure your permissions for your home drive are the same before rebooting. You won't be able to log in if they aren't. So check them before and after the move (ls -al).

Here are my lines in fstab for the mount, yours will be the same except for the UUID and the comment can use your own customized comment :).

# /home was on /dev/sdb1 during installation
UUID=0986bfe2-1692-4c64-b10e-00f19ebbc426 /home ext4 defaults 0 2

Another nice thing about having /home on a separate partition is that you don't have to lose all your settings everytime you reinstall Linux. Just remount /home during install and don't format.
 

Members online


Top