首页 > 代码库 > Centos 6.5版本,df -h出来的容量与du -sh的容量不对应是怎么会事呢?

Centos 6.5版本,df -h出来的容量与du -sh的容量不对应是怎么会事呢?

问题如题,df -h 出来的容量与du -sh 查看的容量信息不一样,是那里出了问题了吗?

下面分别是du -sh *与df -h出来的结果

[root@mail /]# du -sh *
6.2M    bin
22M    boot
172K    dev
29M    etc
165G    home
130M    lib
26M    lib64
16K    lost+found
4.0K    media
4.0K    mnt
4.0K    opt
du: 无法访问"proc/9139/task/9139/fd/4": 没有那个文件或目录
du: 无法访问"proc/9139/task/9139/fdinfo/4": 没有那个文件或目录
du: 无法访问"proc/9139/fd/4": 没有那个文件或目录
du: 无法访问"proc/9139/fdinfo/4": 没有那个文件或目录
0    proc
0    result.txt
201M    root
15M    sbin
4.0K    selinux
4.0K    srv
0    sys
40K    tmp
6.3G    usr
349M    var
[root@mail /]# df -h
Filesystem                    Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root   50G   44G  3.4G  93% /
tmpfs                         2.4G     0  2.4G   0% /dev/shm
/dev/sda1                     485M   32M  428M   7% /boot
/dev/mapper/VolGroup-lv_home  586G  165G  392G  30% /home
[root@mail /]# cat /etc/redhat-release 
CentOS release 6.5 (Final)
[root@mail /]# 

以上是相关查询命令的输出,下面是硬盘fdisk -l的输出信息

[root@mail /]# fdisk -l

Disk /dev/sda: 536.9 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00014e84

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              64       65271   523774976   8e  Linux LVM

Disk /dev/sdb: 161.1 GB, 161061273600 bytes
255 heads, 63 sectors/track, 19581 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/VolGroup-lv_root: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/VolGroup-lv_swap: 5217 MB, 5217714176 bytes
255 heads, 63 sectors/track, 634 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/VolGroup-lv_home: 638.5 GB, 638494703616 bytes
255 heads, 63 sectors/track, 77625 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

[root@mail /]# 

之前也使用 badblocks 进行扫描了下,坏的块为0。

实在是找不出来相关的原因了,遂发出来希望路过的大神指点一下。

在此步骤之前也曾怀疑是否是因为有删除文件而没有释放出来而导致的,然后删除了一些文件,容量间也会直接减少,也有进行重启过服务器,小弟菜鸟。在发贴期间仍也会不停的自已进行寻找答案。

 

谢谢!

 

Centos 6.5版本,df -h出来的容量与du -sh的容量不对应是怎么会事呢?