-3

I have 2 disk on my vps one is 40 GB and other is 80 GB, today I see my 40GB disk is 100% full, I cant understand what is using that space.

here is full info

[root@topsites]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/xvda1       40G   38G     0 100% /
tmpfs           3.9G     0  3.9G   0% /dev/shm
/dev/xvde1       79G   51G   25G  68% /var/www

My all site in /var/www directory, this directory total usage is 57GB (total /var directory). I checked all others directory one by one but not found any big data. Almost all others directory using total 5GB maximum so I can't understand where is my other space gone.

my calculation like this my all website files is total 51GB and its using from 2nd 80GB disk, /var using more 6 GB and I think that using from my 40GB disk. after minus all others directory usage at least 50% space remain on 40GB disk but as you see its showing 100% used.

Can anyone please give me a clue about this?

[root@topsites ~]# du -sh /* --exclude /proc --exclude /var/www
6.5M    /bin
42M     /boot
4.0K    /cgroup
124K    /dev
26M     /etc
60K     /home
254M    /lib
18M     /lib64
20K     /lost+found
4.0K    /media
4.0K    /mnt
4.0K    /opt
44K     /root
9.2M    /sbin
4.0K    /selinux
4.0K    /srv
0       /sys
8.0K    /tmp
518M    /usr
6.6G    /var
3
du -sh /* --exclude /proc --exclude /var/www

Then work your way down to see where all the files are. Your logs are probably smashing the volume.

Then see if there are any open files that were deleted but the file usage hasn't been deleted. Look for all the large files that are returned from:

sudo lsof | grep deleted
  • <code>[root@topsites ~]# du -sh /* --exclude /proc --exclude /var/www 6.5M /bin 42M /boot 4.0K /cgroup 124K /dev 26M /etc 60K /home 254M /lib 18M /lib64 20K /lost+found 4.0K /media 4.0K /mnt 4.0K /opt 44K /root 9.2M /sbin 4.0K /selinux 4.0K /srv 0 /sys 8.0K /tmp 518M /usr 6.6G /var</code> – Mi2 Dec 31 '14 at 21:32
  • @user219457 First, add --exclude /var/www, second paste the output in your question in a code block so it's easy to see – Wesley Dec 31 '14 at 21:35
  • I have added on post – Mi2 Dec 31 '14 at 21:38
0

Are you running RHEL/CentOS? Confirm your file system in /etc/fstab.

Assuming you are using ext3 or ext4, you should confirm how much space is reserved for the partition(s) by running tune2fs -l /path/to/partition | grep -i "reserve". For example;

/dev/xvda1 | grep -i "reserve"

Usually 5 - 10% is not usable because it is reserved. Calculate the reserved space by multiplying block size with reserved blocks, see the next step.

Next you can check how many files are excluded from the tally. First confirm the block size for your partition with tune2fs.

tune2fs -l /dev/xvda1 | grep "Block size"

Most partitions use a default block size of 4096 bytes, or 4 Kb.

Next, find the files on your partitions that do not exceed 4 Kb in size, and are therefore not counted. We can do this with find:

find / -size -4k | wc -l

The last line printed will be the number of files found. Since every file occupies at least one block, we can calculate the disk space used by multiplying the block size by the total file count. Assuming a total of 1083357 files;

1083357 x 4 = 4333428 Kb (4.333428 Gb)

Unless, of course, you are using some other OS :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.