ITEM: AG4666L
Problem copying files >32K into a filesystem >95%
Question:
ENV: 3.2.5
DESC: Customer is trying to copy a file larger than 32K to a
filesystem that is greater than 95% full. Even though the filesystem
is close to being full df shows he has sufficient room to store
the file. The file is almost 40K and the filesystem shows 264K
free.
This is a sample of the customer's testing.
df /usr
Filesystem Total KB free %used iused %iused Mounted on
/dev/hd2 229376 264 99% 12519 21% /usr
file test1 >32k
-rw-r--r-- 1 root system 39556 Feb 27 14:44 test1
cp test1 /usr/bin/test1
cp: /usr/bin/test1: There is not enough space in the file system.
df /usr
Filesystem Total KB free %used iused %iused Mounted on
/dev/hd2 229376 232 99% 12520 21% /usr
ls -l /usr/bin/test1
-rw-r--r-- 1 root system 32768 Feb 27 14:45 /usr/bin/test1
Copying files less than 32K work fine. Customer can continue to copy
in the file over and over, but it will only copy in 32768 bytes of the
file. It seems to be the combination of files over 32K and filesystems
over 95% full.
ACT:
The reason for the problem is due to the filesystem being TOO FRAGMENTED.
The problem manifests itself for files bigger than 32k because
those files are using INDIRECT(or double indirect blocks(when > 4M)).
The DESIGN of the VMM and the journaled filesystem requires that
for a file bigger than 32k (i.e one which needs an indirection)
two consecutive 4K blocks must be allocated for the indirect block;
one for the IndirectBlock itself and one for the first data block.
If a filesystem becomes too fragmented and there are no two
consecutive blocks, then one can not copy or create a file bigger
than 32k regardless of how much space may be available.
When the system is unable to group these blocks together,
the allocation fails (and thus the write() system call
within the cp command).
Another note: In the BSD fast filesystem, it reserves 10% of the
filesystem for exactly this reason: efficient 'cluster' allocation.
AIX's jfs doesn't reserve any space. However, as the filesystem
approaches 100% full, the odds of hitting this appear to increase
dramatically.
The solution is to do one of two things:
1. Backup the filesystem by name, recreate the filesystem,
and restore the files, thus clearing up the
filesystem fragmentation or
2. Increase the filesystem, which will allocate more
blocks.
Support Line: Problem copying files >32K into a filesystem >95% ITEM: AG4666L
Dated: March 1995 Category: N/A
This HTML file was generated 99/06/24~13:30:27
Comments or suggestions?
Contact us