Ubuntu – Partition keeps filling up, don’t know why

hard drivepartitionUbuntu

My partition /dev/sda1 keeps filling up. Besides the "/" directory, I cannot tell what directories are even on this partition in order to search for files to delete. I was able to get it down to 97% full yesterday, but already today it is as 100% again.

I did not set up this machine. But looks like /home is on /dev/sda6 (which has tons of space) so no problems there.

Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda1              9611492   9059720     63532 100% /
tmpfs                 12368424         0  12368424   0% /lib/init/rw
udev                  12363580       172  12363408   1% /dev
tmpfs                 12368424         0  12368424   0% /dev/shm
/dev/sda6            452427328 146862508 282582832  35% /home
tmpfs                  2048000   1212456    835544  60% /mnt/ramdisk

EDIT: Still don't know why /dev/sda1 is filling up, but I"m now trying to delete unnecessary packages to free up disk space. However, it won't let me do anything with an apt-get command. It says:

The following packages have unmet dependencies:
 vim : Depends: vim-runtime (= 2:7.2.445+hg~cb94c42c0e1a-1) but it is not installed
E: Unmet dependencies. Try using -f.

This occurs also when I try install something.

EDIT 2: While rebooted got me down to 46% full, now just two days later I am back up to 62% full, and rising. What is filling up my disk?

EDIT 3: Looks like it's going up about 6% per day…already 68% full. That's about 60 mb/day.

EDIT 4: Looks like I am going up 0.03 MB/HR constantly. How can I tell what is filling and where?

Best Answer

This command will give you a list of what is using your disk space, in largest to smallest order, without traversing onto other filesystems (so just / and anything sda1)

du -xkc / | sort -r -n | tee /home/diskusage.log
less /home/diskusage.log

It will take a while to run, but hopefully that gives you a better idea of what folders are using your disk space. The command dumps the output file to /home since you said it was on a different partition. The results are in KB.

Update: From what you're saying, the used diskspace doesn't equal the partition size; you might want to check for deleted files to see if there is anything big being held open. Deleted files won't be freed until they are closed. Use lsof to check for deleted files:

lsof -n | grep -i '(deleted)'

To free such files, close or restart the process that is holding those deleted files open.