Monday, January 6, 2020

linux - df shows negative values for used?



I have a CentOS 5.2 server and running df -h I get this:



Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
672G -551M 638G 0% /
/dev/hda1 99M 12M 82M 13% /boot
tmpfs 2.0G 0 2.0G 0% /dev/shm



that space wasn't even near 10% usage the last time it showed a correct value. I'm at a loss with whats going on.



EDIT #1



Ok so I had to reboot the server because SSHD hanged up, I'm guessing it was related to this.



Some new info, after rebooting, df -h showed 12Gb used (2%), but if I run du -hcs / it shows 46Gb total, theres a big difference here.



EDIT #2




After about 15mins of uptime df -h is showing negative values again:



Filesystem            Size  Used Avail Use% Mounted on  
/dev/mapper/VolGroup00-LogVol00
672G -24G 660G - /


EDIT #3




More info, ran a fsck and this is the output:



Checking all file systems.
[/sbin/fsck.ext3 (1) -- /] fsck.ext3 -f -y /dev/VolGroup00/LogVol00
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/VolGroup00/LogVol00: 204158/181633024 files (1.3% non-contiguous), 9224806/181633024 blocks

[/sbin/fsck.ext3 (1) -- /boot] fsck.ext3 -f -y /dev/hda1
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/boot: 34/26104 files (5.9% non-contiguous), 15339/104388 blocks

Answer



I think it is a file system corruption. You should unmount the partition and run a fsck.
Check also the logs and the console for any file system errors.



No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...