Search This Blog

Tuesday 23 February 2010

Mounting a drive twice

I didn't think such a thing was possible. Not only is it so, but I have inadvertently done so, as I could see by my disk usage going haywire.

Disk space = 120GB.

Disk usage analyser shows 55GB taken, but df -h shows only around 5GB free. However, a glance at this post shows my problem.

The command of

sudo du -hx --max-depth=1 /media


produces this outcome:

root@ubuntu:~# sudo du -hx --max-depth=1 /media
4.0K    /media/floppy0
55G    /media/sdc1
4.0K    /media/cdrom0
4.0K    /media/sdb1
4.0K    /media/sda1
55G    /media

So it is mounted within itself.

But how to solve?

Well, fortunately it was no more difficult than umount /media/sdc1

But the shortage of space was still there, which after some investigating, and using Disk Usage Analyzer, seemed to be a result of logs

sudo du -h --max-depth=1 / | sort -n

and

tail /var/log/syslog

(and running the second command on other logs) allowed the culprits to be found, deleted, and space restored....