Free disk space disparity
Hey all, I wonder if someone can help me stop banging my head against a wall with disk space issues?
I have a Red Hat Enterprise 64-bit 6.2 server that is reporting the root partition is 100% used. Code:
[root@servername /]# df -h Code:
[root@servername /]# du -h --max-depth=1 Can anybody please help me to find what is using the extra space on my root partition? |
Another thing that could use space and be hidden from du would be files hidden under an active mount point. Do this:
Code:
mkdir /tmp/rootfs |
Thanks, that was really helpful.
Running du on /tmp/rootfs/mnt I could see that 25GB of data was being held with /tmp/rootfs/mnt/backups. Ls on that directory showed me lots of files, that have been copied to the /mnt/backups samba partition, but for whatever reason have stayed within the tmp partition and not been cleared out. The earliest file in the /tmp/rootfs/mnt directory was 27th July 2013, so this has been working with no issues for a year, until then. Very odd. I've cleared the data in that directory, and unmounted the /tmp/rootfs partition, and now my df -h / is looking much more healthy. I'll keep a close eye on that /tmp directory over the next few weeks to check it's not filling up again, and if it is I'll troubleshoot why. Thanks again for your reply, I've been frustrated with this all week. |
Quote:
FWIW, I protect myself from having that happen by putting my backups into a subdirectory "rback" on my backup drive. My backup script refuses to run if it doesn't see a directory /mnt/backups/rback, and that directory would not be present unless my backup drive were mounted. |
Other possibilities include:
Data that is in / itself, since du shows the space of the sub-directories. Until the very last hit, but unless you add up all the previous hits and subtract you could miss a large chunk of data on / without looking at / directly. When /var/log/ gets archived via logrotate and therefor cron, you need to restart the syslog daemon to recover the space saved. Most times that's automagically done (in a perfect world). But sometimes things don't always go as planned. /tmp is basically the new swap space. So applications that used /tmp and crashed do not clear out /tmp. They might clean up when started again, or might not. In days of old /tmp was cleared at boot time. So the microsoft methodology of rebooting could indeed fix some ills. This differs slightly from actual RAM that is automatically reclaimed when the parent application terminates. A sometimes overlooked thing is that filesystems are a linked list of sorts. And is basically a bunch of chunks of data. If you have large chunks and small files you can waste a bit of storage potential there. Block size or nodes or whatever you want to call it these days. If you have 4k chunks and all 1k files, you can reach capacity while using just 25% of the storage. In a crunch you can safely remove or move data from /usr/share/doc/ most of the time. Some distros give you some options to not install the -doc portion of packages. Others install everything. Not likely your issue, but if you're not using it, one source of potential real-estate when no other is available. And /usr/share/doc/ can be quite girthy if you install a decent percentage of the 20k+ potential packages these days. |
Thanks all. I've learned a lot from this problem so it hasn't been all bad :)
|
All times are GMT -5. The time now is 09:46 AM. |