LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Missing hard drive free space (https://www.linuxquestions.org/questions/linux-server-73/missing-hard-drive-free-space-630572/)

encomium 03-25-2008 02:30 PM

Missing hard drive free space
 
I have a couple servers that are running low on disk space, but I can't figure out what is consuming the space. These are using LVM, but I don't know a lot about LVM yet so I can't determine if it may be part of the issue or not (though it doesn't look like it based on the output that I will post below). If I do a df -h, it tells me that / has 57G used:

Code:

[root@zeus01 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                      66G  57G  5.1G  92% /
/dev/sda1              99M  14M  80M  15% /boot
none                  501M    0  501M  0% /dev/shm

However if I do a "du -hs /" it tells me that there is only 24GB of data:

Code:

[root@zeus01 ~]# du -hs /
24G    /

There is nothing mounted that would mask the amount of data:

Code:

[root@zeus01 ~]# mount
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
none on /proc type proc (rw)
none on /sys type sysfs (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
usbfs on /proc/bus/usb type usbfs (rw)
/dev/sda1 on /boot type ext3 (rw)
none on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)

Here's some LVM info:

Code:

[root@zeus01 ~]# pvdisplay
  --- Physical volume ---
  PV Name              /dev/sda2
  VG Name              VolGroup00
  PV Size              68.12 GB / not usable 0
  Allocatable          yes
  PE Size (KByte)      32768
  Total PE              2180
  Free PE              2
  Allocated PE          2178
  PV UUID              ibUQJu-HayX-U3qK-8Me4-HbQB-MCiA-08SXxr

[root@zeus01 ~]# vgdisplay
  --- Volume group ---
  VG Name              VolGroup00
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  3
  VG Access            read/write
  VG Status            resizable
  MAX LV                0
  Cur LV                2
  Open LV              2
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size              68.12 GB
  PE Size              32.00 MB
  Total PE              2180
  Alloc PE / Size      2178 / 68.06 GB
  Free  PE / Size      2 / 64.00 MB
  VG UUID              Xzi1d1-sJdh-7WAS-mB9T-nKGP-85aF-ItuDJ6

[root@mxfarm /]# lvdisplay
  --- Logical volume ---
  LV Name                /dev/VolGroup00/LogVol00
  VG Name                VolGroup00
  LV UUID                mxK5MZ-favb-4jGg-q4q4-1C75-5Wg6-4VUDft
  LV Write Access        read/write
  LV Status              available
  # open                1
  LV Size                63.34 GB
  Current LE            2027
  Segments              1
  Allocation            inherit
  Read ahead sectors    0
  Block device          253:0

  --- Logical volume ---
  LV Name                /dev/VolGroup00/LogVol01
  VG Name                VolGroup00
  LV UUID                ah30ar-XpRl-BhbE-zGmS-7vJ9-9Cic-tVDKp3
  LV Write Access        read/write
  LV Status              available
  # open                1
  LV Size                4.25 GB
  Current LE            136
  Segments              1
  Allocation            inherit
  Read ahead sectors    0
  Block device          253:1

Googling & searching the forum haven't turned up anything similar. I'm pretty much stumped on this one, so I'm hoping someone might have some insight.

Thanks.

BrianK 03-25-2008 03:01 PM

I didn't think you could accurately du on /? Regardless, what do you get if you du the folders in / rather than / itself, i.e.

cd /
du -h --max-depth=1

and then, do you know where most of your files are? Do you have tons of little files by chance?

rednuht 03-25-2008 03:02 PM

although its a shot in the dark run
Code:

find / | wc -l
this will count the the number of files, if its more than you expect then investigate.
files with a zero size still take up space, I have had applications write 700,000+ log files with 0 size that then took up space of the drive without taking up 'space'.
this was many years ago and you would have to have a heck of alot of 0b/small files to lose 25g+
find can be run with options to look for small files.

encomium 03-26-2008 02:11 AM

Thanks for the replies.

Code:

[root@zeus01 ~]# du -h / --max-depth=1
22G    /usr
66M    /install
0      /sys
6.2M    /bin
8.0K    /mnt
19M    /sbin
96M    /lib
1.1G    /proc
20M    /lib64
16K    /scripts
8.0K    /opt
2.3M    /queryperf
8.5M    /boot
8.0K    /misc
28K    /tmp
23M    /root
168K    /dev
8.0K    /initrd
59M    /etc
8.0K    /srv
16K    /media
16K    /lost+found
102M    /var
8.0K    /home
8.0K    /selinux
24G    /

Good call on the small files guys, I should've thought of that. However I'm not sure that's the issue. Looks like there's 153,277 total files, of which 109,142 are less than 5k, and 4663 are 0 bytes (the block size of the filesystem is the default of 4k):

Code:

[root@zeus01 ~]# find / | wc -l
153277

[root@zeus01 ~]# find / -size 0 | wc -l
4663

[root@zeus01 ~]# find / -size -5k | wc -l
109142

I guess I need to figure out how many blocks are actually in use to see if this might be partly the issue.


All times are GMT -5. The time now is 07:44 PM.