我们遇到了一个奇怪的现象,我们无法再将文件移动到某个目录中。我们得到
lstat("NewBatches/R910140805849312.dat", {st_mode=S_IFREG|0644, st_size=2850, ...}) = 0
lstat("Imported/R910140805849312.dat", 0x7fff10424b90) = -1 ENOENT (No such file or directory)
rename("NewBatches/R910140805849312.dat", "Imported/R910140805849312.dat") = -1 ENOSPC (No space left on device)
但是我们可以将文件复制到文件夹中。还有充足的磁盘空间和 inode。而且我们不能只在导入的子目录中移动文件。所有其他文件都在同一个 EXT3 文件系统中工作。
我有点困惑
# tune2fs -l /dev/mapper/vgdmscsp-lvmaspdoc
tune2fs 1.39 (29-May-2006)
Filesystem volume name: <none>
Last mounted on: <not available>
Filesystem UUID: b4215e24-2285-46de-8398-f41bc3174b8e
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal resize_inode dir_index filetype needs_recovery sparse_super
Default mount options: (none)
Filesystem state: clean
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 33382400
Block count: 52428800
Reserved block count: 2619904
Free blocks: 5432592
Free inodes: 17432375
First block: 1
Block size: 1024
Fragment size: 1024
Reserved GDT blocks: 176
Blocks per group: 8192
Fragments per group: 8192
Inodes per group: 5216
Inode blocks per group: 652
Filesystem created: Thu Oct 6 11:19:53 2011
Last mount time: Sat Jul 12 09:26:56 2014
Last write time: Tue Aug 5 00:04:31 2014
Mount count: 40
Maximum mount count: -1
Last checked: Thu Oct 6 11:19:53 2011
Check interval: 0 (<none>)
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 128
Journal inode: 8
Default directory hash: tea
Directory Hash Seed: b975b5a1-72ad-44a4-8c53-622f7ba71e25
Journal backup: inode blocks
答案1
您的可用块数与保留块数相差不大。
Block count: 52428800
Reserved block count: 2619904
Free blocks: 5432592
在创建时,ext3 文件系统会保留一定比例的块供 root 用户使用,默认情况下为 5%。这允许 root 拥有的进程继续写入磁盘,同时锁定用户空间,人们希望这是磁盘膨胀的根源。
我怀疑您以非特权用户的身份遇到了这个问题,而空闲块的数量低于保留数量。cp
如果您以 root 身份进行干预,则操作会成功。如果您可以确认问题现在已消失,并且当前空闲块的数量高于保留数量,则这很可能是原因。