LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Find used drive space (https://www.linuxquestions.org/questions/linux-software-2/find-used-drive-space-736791/)

IceTerminal 06-30-2009 05:11 PM

Find used drive space
 
I've done a search for my problem but could not find anything, so please forgive me if I've missed it.

My problem is that my drive is reporting that its 97% full. Doing some initial checks, I can't find any reason why it would say this as my drive is 250GB in size but only about 83GB is being used.
I'm using Ubuntu 9.04 server 32bit. The drive is a standard Maxtor SATA drive.
Quote:

$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 229G 210G 7.6G 97% /
As you can see, its saying its almost full. But doing a check on what directories are using what, it only shows that 83% is being used.
A further break down shows:
Quote:

# du -xhc --max-depth=1
6.1M ./bin
186M ./boot
700K ./root
4.0K ./downloads
0 ./sys
88K ./tmp
4.0K ./opt
4.0K ./selinux
4.0K ./srv
12K ./media
0 ./proc
16K ./lost+found
76G ./files
556M ./home
2.9G ./usr
2.6G ./var
1.5G ./lib
16K ./audio
20K ./mnt
23M ./etc
4.0K ./initrd
0 ./dev
7.3M ./sbin
83G .
83G total
Doing a manual check of du -h shows basically the same.
Directories within the / partition
Quote:

/bin = 6.1M
/boot = 186M
/cdrom -> media/cdrom = 0
/dev = 312K
/etc = 23M
/files = 76G
/home = 556M
/initrd = 4.0K
/lib = 1.5G
lost+found = 0
/media = 12K
/mnt = 20K
/opt = 4.0K
/proc = 0 ???
/root = 700K
/sbin = 7.3M
/selinux = 4.0K
/srv = 4.0K
/sys = 0
/tmp = 88K
/usr = 2.9G
/var = 2.6G
So I"m looking for help on this one. I"m not running anything weird, just a normal server running web, email, etc. Can someone point me in the right direction that can help me find and clear this? Thank you very much in advance.

pljvaldez 06-30-2009 05:28 PM

http://www.blindhog.net/linux-find-large-directories/

IceTerminal 06-30-2009 06:17 PM

Quote:

Originally Posted by pljvaldez (Post 3592161)

Yes, I've done those commands before. They always come up and show the drive space being used is 83GB, not the 209GB that the df command shows.

Any other ideas on how to sleuth out the usage?

pljvaldez 06-30-2009 06:32 PM

Have you recently moved any mount points? Once I moved /home to a new partition and forgot to delete all the files before mounting the new /home directory. Did that make any sense?

I'll try to explain better, just in case. I installed linux with a single / partition that then started running out of space. /home had 15GB of files in it. Then I created a mount point /mnt/newhome on a new disk (like /dev/sdb1) and copied all the files over to newhome. Then I changed fstab and remounted /dev/sdb1 as /home without deleting the files on the old /home directory. So /dev/sda1 was still "using" the 15GB, even though it wasn't shown. So I had to unmount the new home directory, change fstab back, delete all the files from /home, then remount /dev/sdb1 as /home. Then the 15GB were free again.

IceTerminal 06-30-2009 09:25 PM

Quote:

Originally Posted by pljvaldez (Post 3592233)
Have you recently moved any mount points? Once I moved /home to a new partition and forgot to delete all the files before mounting the new /home directory. Did that make any sense?

I'll try to explain better, just in case. I installed linux with a single / partition that then started running out of space. /home had 15GB of files in it. Then I created a mount point /mnt/newhome on a new disk (like /dev/sdb1) and copied all the files over to newhome. Then I changed fstab and remounted /dev/sdb1 as /home without deleting the files on the old /home directory. So /dev/sda1 was still "using" the 15GB, even though it wasn't shown. So I had to unmount the new home directory, change fstab back, delete all the files from /home, then remount /dev/sdb1 as /home. Then the 15GB were free again.

I understand, but I'm pretty sure that i didn't mount / remount / unmount anything. In fact, everything was fine until I tried to copy a file over to it and it ran out of space. In checking, I found the drive reporting 97% full, but could only account for 83GB of the 250GB total space.

pixellany 06-30-2009 10:22 PM

There must be a simple answer to this......but: More often than I can count, I have solved such things by brute force--in the limit, by reinstalling the system.

You certainly could copy everything to another drive, and then see what's left......AND--I assume you have ruled out hidden files or directories.

chrism01 07-01-2009 01:58 AM

How about sparse files: see --appparent-size here http://linux.die.net/man/1/du
Another thing to check (although prob not the answer) is inode usage (-i) http://linux.die.net/man/1/df


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