LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Help me find where my drive space went (https://www.linuxquestions.org/questions/linux-newbie-8/help-me-find-where-my-drive-space-went-922488/)

DrinkinHomeBrew 01-06-2012 05:03 PM

Help me find where my drive space went
 
I have an apache server hosting a small website (db on another system). Disk free shows:

Code:

me@server:/$ df
Filesystem          1K-blocks      Used Available Use% Mounted on
/dev/mapper/server-root
                      11550640  10970980        0 100% /
none                  2022552      172  2022380  1% /dev
none                  2029676        0  2029676  0% /dev/shm
none                  2029676        36  2029640  1% /var/run
none                  2029676        0  2029676  0% /var/lock
none                  11550640  10970980        0 100% /var/lib/ureadahead/debugfs

The thing is, I cannot find where all my drive space got used. It is just a 12 GB drive, but it is hosting a very small site. I ran
du -k | sort -nr | more
And get the following as the top results
857900 .
411784 ./usr
231224 ./var
167596 ./lib
166772 ./var/lib
136444 ./usr/share
If I am reading this right, the whole file system is 857900 KB, or well under the 12GB allocated to the drive.

Is there another place I should be looking that might cause this?

T3RM1NVT0R 01-06-2012 05:28 PM

@ Reply
 
Hi DrinkinHomeBrew,

Run the following command and I think you will get what you are looking for:

1.
Code:

cd /
2.
Code:

du -ah | sort -nr > /output.log
3.
Code:

head output.log
or you can use

Code:

less output.log

sag47 01-06-2012 05:54 PM

If you want to step through the folders a little more then you can use du for that also.

Code:

cd /
du -shc *
cd very_large_folder
du -shc *
#rinse and repeat


singhjc 01-07-2012 12:05 AM

Hi,


first of all login through root user in graphical mode and check directory which comes under / it might possible that any directory or files has large size and second thing check your root,s home directory it also comes under / and you can check through CLI.

# cd /
# du -sh directoryname(example)
# du -sh abc
and also check hidden files

# ls -a


hope it will work and help you out.

Thanks $ Regards

Singhjc

DrinkinHomeBrew 01-07-2012 01:02 PM

Ok, thanks for the suggestions.

On a hunch I decided to take the server out of the pool and reboot it. That did the trick.

Code:

me@server:~$ df
Filesystem          1K-blocks      Used Available Use% Mounted on
/dev/mapper/server-root
                      11550640  1018036  9945852  10% /
none                  2022552      168  2022384  1% /dev
none                  2029676        0  2029676  0% /dev/shm
none                  2029676        36  2029640  1% /var/run
none                  2029676        0  2029676  0% /var/lock
none                  11550640  1018036  9945852  10% /var/lib/ureadahead/debugfs

I did do a df before rebooting at it was at the same state of 0 bytes free. Not really sure what was going on, but hopefully I'll have better skills in a few months to debug again when it happens.


All times are GMT -5. The time now is 02:33 AM.