磁盘空间已满

磁盘空间已满

设置 Ubuntu 10.04 服务器时,/ 磁盘空间在 df 下显示已满,但 du 未显示任何已使用的空间。这有多个 Gluster FS 挂载。

我尝试过强制 FSCK,但无济于事。

~# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/md0              141G  132G     0 100% /
none                  3.0G  224K  3.0G   1% /dev
none                  3.0G     0  3.0G   0% /dev/shm
none                  3.0G   76K  3.0G   1% /var/run
none                  3.0G     0  3.0G   0% /var/lock
none                  3.0G     0  3.0G   0% /lib/init/rw

我尝试过 tune2fs,但出现了同样的问题

# du -h --max-depth=1 --one-file-system /
4.0K    /selinux
0   /proc
47M /boot
31M /mnt
8.0K    /brick1
8.0K    /brick2
391M    /lib
4.0K    /opt
7.4M    /bin
0   /sys
379M    /var
5.6M    /etc
16K /lost+found
43M /root
4.0K    /srv
5.7M    /home
4.0K    /media
7.0M    /sbin
0   /dev
4.0K    /tmp
4.0K    /cdrom
631M    /usr
1.6G    /

更多信息

# df -ih
Filesystem            Inodes   IUsed   IFree IUse% Mounted on
/dev/md0                9.0M     91K    8.9M    1% /
none                    746K     770    745K    1% /dev
none                    747K       1    747K    1% /dev/shm
none                    747K      32    747K    1% /var/run
none                    747K       1    747K    1% /var/lock
none                    747K       3    747K    1% /lib/init/rw
localhost:/sanvol09      25G     76M     25G    1% /mnt/sanvol09

最后一个问题:df 显示已 100% 使用,但没有其他已知的修复方法?

tune2fs

:~# tune2fs -l /dev/md0
tune2fs 1.41.11 (14-Mar-2010)
Filesystem volume name:   <none>
Last mounted on:          /
Filesystem UUID:          a94d2b93-35f8-4b59-81f1-38bf48833d0c
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal ext_attr resize_inode dir_index filetype needs_recovery extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize
Filesystem flags:         signed_directory_hash 
Default mount options:    (none)
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              9371648
Block count:              37475824
Reserved block count:     3747582
Free blocks:              2374280
Free inodes:              9304627
First block:              0
Block size:               4096
Fragment size:            4096
Reserved GDT blocks:      1015
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         8192
Inode blocks per group:   512
RAID stride:              1
Flex block group size:    16
Filesystem created:       Tue Oct 16 17:41:02 2012
Last mount time:          Tue Nov 27 11:51:07 2012
Last write time:          Tue Dec  4 08:54:43 2012
Mount count:              3
Maximum mount count:      34
Last checked:             Tue Nov 27 10:08:25 2012
Check interval:           15552000 (6 months)
Next check after:         Sun May 26 10:08:25 2013
Lifetime writes:          24 GB
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:           256
Required extra isize:     28
Desired extra isize:      28
Journal inode:            8
First orphan inode:       1048583
Default directory hash:   half_md4
Directory Hash Seed:      6dc653fe-dd10-46b6-8c7d-a6a292e92ea9
Journal backup:           inode blocks

答案1

我也遇到过这个问题。这里为您提供解决方案,请卸载 /mnt/sanvol09 并检查原始文件夹。在安装之前,您可能在该文件夹中有文件。安装后,您将无法看到它们。因此,请继续卸载,清理该文件夹,就这样。

答案2

您可以使用以下工具检查打开的文件(任何进程仍在使用但被删除的文件)

lsof | sort -nrk 7,7 | head -20df -h /du -x -sh /

在 lsof 输出中,你可以看到已删除文件的关键字 removed。例如

root@demobox:/root : lsof | grep -i deleted
dsmcad    25449       root  txt       REG              253,0  4843037     459377 /opt/tivoli/tsm/client/ba/bin/dsmcad (deleted)
root@demobox:/root : ls -l /opt/tivoli/tsm/client/ba/bin/dsmcad
ls: cannot access /opt/tivoli/tsm/client/ba/bin/dsmcad: No such file or directory

相关内容