LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   What is taking up all the space on sda6? (https://www.linuxquestions.org/questions/linux-server-73/what-is-taking-up-all-the-space-on-sda6-793918/)

Leirith 03-08-2010 03:53 AM

What is taking up all the space on sda6?
 
Hi everyone,

I have run out of space in /var, and the following output confirms that there is no space on the partition mounted to /var.


lukee@au-web-1:/var$ df –h

Filesystem Size Used Avail Use% Mounted on
/dev/sda1 327M 152M 158M 50% /
tmpfs 2.0G 0 2.0G 0% /lib/init/rw
udev 10M 808K 9.3M 8% /dev
tmpfs 2.0G 390M 1.6G 20% /dev/shm
/dev/sda9 249G 3.0G 234G 2% /home
/dev/sda8 373M 11M 343M 3% /tmp
/dev/sda5 4.6G 588M 3.8G 14% /usr
/dev/sda6 2.8G 2.7G 7.0M 100% /var


The next part is where it gets confusing. What is taking up all of the space? I examine /var with the following command:


lukee@au-web-1:/var$ sudo du -skh /var
60M /var


May I ask for some help in identifying what is taking up the remaining 2.7G or more on this filesystem?

Thank you.

troop 03-08-2010 04:04 AM

sudo fsck /dev/sda6
sudo du -hs /var/*

AlucardZero 03-08-2010 06:34 AM

unmount /var

If it won't let you, reboot, or kill the processes using /var, then unmount it. Use "fuser -cu /var" to list the processes using it. THEN fsck.

On the other hand, if you have a runaway process holding large files open, merely unmounting /var may fix your problem.

troop 03-08-2010 09:43 AM

mount -o remount,ro /var is better, IMHO.

raju.mopidevi 03-08-2010 10:58 AM

Hi Leirith,
this link has a article which say every directory under /var.

/var/log

Log files from the system and various programs/services, especially login (/var/log/wtmp, which logs all logins and logouts into the system) and syslog (/var/log/messages, where all kernel and system program message are usually stored). Files in /var/log can often grow indefinitely, and may require cleaning at regular intervals. Something that is now normally managed via log rotation utilities such as 'logrotate'. This utility also allows for the automatic rotation compression, removal and mailing of log files. Logrotate can be set to handle a log file daily, weekly, monthly or when the log file gets to a certain size. Normally, logrotate runs as a daily cron job. This is a good place to start troubleshooting general technical problems.


so please check the size of the /var/log. It may be possible that it's size may increase indefinitely.

Leirith 03-08-2010 05:48 PM

Thanks AlucardZero and everyone who replied. I ran AZ's and troop's advice and all looks well again.

$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 327M 152M 158M 50% /
tmpfs 2.0G 0 2.0G 0% /lib/init/rw
udev 10M 808K 9.3M 8% /dev
tmpfs 2.0G 46M 1.9G 3% /dev/shm
/dev/sda9 249G 3.0G 234G 2% /home
/dev/sda8 373M 11M 343M 3% /tmp
/dev/sda5 4.6G 563M 3.9G 13% /usr
/dev/sda6 2.8G 159M 2.5G 6% /var

Leirith 03-14-2010 10:41 PM

Hey folks,

The problem seems to have resurfaced since I performed the above commands. Something is slowly filling sda6 and /var is staying the same size. Could anyone offer insight into how this could be happening, and what to do about it?

Thanks!

vendtagain 03-15-2010 02:29 AM

what I do to track down what is taking up space is to use the command:

sudo du -a -h --max-depth=1

this will show you the size of all files and folders in the current directory, just start from the root directory and look which dir has lots of space, cd to that directory and type the command again.

note: you can do this without sudo, but it will probably spit out alot of "permission denied" errors as the command traverses all dirs.

catkin 03-15-2010 03:07 AM

One possibility is open unlinked files; these will not show up in du output but are counted in df's "used" total. See here, here and here for how to find them. rsync is one program that writes to unlinked open files.

Poki 04-17-2012 02:54 PM

Quote:

Originally Posted by catkin (Post 3898698)
One possibility is open unlinked files; these will not show up in du output but are counted in df's "used" total. See here, here and here for how to find them. rsync is one program that writes to unlinked open files.

this helped me.. i had a process running. which when i killed it.. freed a lot of space.. thank you


All times are GMT -5. The time now is 03:24 AM.