1

I have a server running Ubuntu Server 12.xx. Today some services stopped and I found some messages about full disk, so I ran df -h:

Filesystem                Size  Used   Disp Use% 
/dev/mapper/ubuntu-root   455G   434G     0 100% /
udev                      1,7G   4,0K  1,7G   1% /dev
tmpfs                     689M   4,2M  685M   1% /run
none                      5,0M      0  5,0M   0% /run/lock
none                      1,7G      0  1,7G   0% /run/shm
/dev/sda1                 228M    51M  166M  24% /boot
overflow                  1,0M      0  1,0M   0% /tmp

I tried to delete some files remotely from a Windows computer by right-clicking and choosing "delete", but the hard drive remained full.

Is there a Trash folder in Ubuntu Server? What could be happening?

ændrük
  • 76,794
julio
  • 11
  • 1
  • 2

4 Answers4

1

Use du to find where the most space is used:

sudo du -xs /* 2>/dev/null |sort -n

This will give you a list of all directories in / sorted by size (2>/dev/null just serves to hide error messages, -x restricts the search to one file system).

e.g.

3510468 /var
6398936 /usr
14496756    /home

Now the last lines in the output tell you the biggest directories, the next step (in my example) would be

sudo du -xs /home/* 2>/dev/null |sort -n

and so on, until you find where all your space is used up.

There use ls -lS to see all the files, sorted by size, the decide what you want to delete. Caution don't just delete any big file if you don't know what its purpose is :-))

guntbert
  • 13,134
0

If you deleted the files through the filemanager, it probably only moved them to the rubbish bin. There should be an icon in the left pane for you to navigate to the rubbish bin.

The files should be placed in ~/.local/share/Trash/.

You can find out more about your disk usage using du or a grpahical frontend like filelight.

Frederick Nord
  • 549
  • 5
  • 9
0

If you want to look for "big fish" to delete, you could use find.

# find / -xdev -size +1G

The above will find files greater than 1 Gigabytes in size starting at "/" and only descending into subdirectories that stay on the filesystem that hosts "/".

The command below will look for files greater than 250 Megabytes in size.

# find / -xdev -size +250M

Refer to the find man page for more details.

0

In case anyone else has this problem again, do

sudo tune2fs -m 0 /dev/sdaX
# /dev/sdaX is your partition, check with df

Credits go here: Why doesn't deleting files increase available space?

Tomato
  • 101