- 论坛徽章:
- 0
|
能touch 一个文件吗?如果不能就很有可能是没有连续的block造成的,虽然INODE和磁盘空间都未满。\r\n方案一\r\nThe JFS2 filesystem performs many operations to gain greater performance when reading and writing to files and directories within it. One such operation is that when a block of data is allocated in the filesystem, JFS2 attempts to pre-allocate the next contiguous block as well. This is done to speed up performance of file creation, as in general use a file will consist of more than one block of data, and is usually more performant if in a contiguous area of the filesystem. \r\n\r\nHowever, in a filesystem that is very nearly full, or very fragmented, there may not be enough contiguous space to allocate two such contiguous blocks (or extents in JFS2) of 16Kb in size, and the file creation may fail. \r\n\r\nThis can be illustrated with a simple \'touch\' command, to create a new zero-length file. This will attempt to allocate a pair of 16Kb extents of data in the filesystem: \r\n\r\n $ touch myfile\r\n touch: cannot create \r\n\r\nIf \"df\" shows the filesystem is approaching being full, or even as little as 50-60% full in a heavily fragmented filesystem, then it may be that you are encountering this issue. In some cases running the defragfs command to defragment the filesystem may give you enough contiguous space to allow the creation of new files. However defragfs may not help if it cannot defragment the filesystem enough, or it truly is very full. \r\n\r\n\r\nIf this is on an NFS, JFS, or other filesystem that is NOT JFS2, then this is NOT your issue and enabling Variable Inode Extents will not help. \r\n\r\n\r\nVariable Inode Extents were a feature added with APARs: \r\n\r\nAPAR IY68589 for AIX 5.2 - included in 5200-07 \r\n\r\nAPAR IY68174 for AIX 5.3 - included in 5300-03 \r\n\r\n\r\nBy default the filesystem needs contiguous 16Kb extents. Using Variable Inode Extents allows JFS2 to allocate a smaller extent if 16Kb is too large. \r\n\r\nTo enable Variable Inode Extents, unmount the filesystem and use chfs with the following option, from the man page: \r\n\r\n\r\n -a vix={yes|no}\r\n Specifies whether the file system can allocate inode\r\n extents smaller than the default of 16K if there are no\r\n contiguous 16K extents free in the file system. After a\r\n file system is enabled for small free extents, it cannot\r\n be accessed on earlier versions of AIX and the marking \r\n cannot be removed.\r\n\r\n yes\r\n File system can allocate variable length inode\r\n extents.\r\n no\r\n File system must use default size of 16 KB for \r\n inode extents. This has no effect if the file \r\n system already contains variable length inode \r\n extents.\r\n\r\nSo if there is a filesystem /myfs you wish to enable VIX on, follow these steps:\r\n\r\n# umount /myfs\r\n# chfs -a vix=yes /myfs\r\n# lsfs -q /myfs\r\n\r\n# lsfs -q /myfs\r\nName Nodename Mount Pt VFS Size Options Auto Accounting\r\n/dev/fslv01 -- /myfs jfs2 131072 rw no no\r\n (lv size: 131072, fs size: 131072, block size: 4096, sparse files: yes, inline log: no, inline log size: 0, EAformat: v1, Quota: no, DMAPI: no, VIX: yes)\r\n\r\n# mount /myfs\r\n\r\n\r\nNote there may be a performance degradation of writes or file creation to the JFS2 filesystem after enabling VIX, as you are disabling or limiting a previous performance characteristic of the JFS2 filesystem. \r\n\r\n方案二\r\n扩大该文件系统或者用defragfs命令,治标不治本,不删早晚还会满\r\n\r\n方案三(我碰到大量小文件时解决方法)\r\n/bak/FPF下面不是还有一些目录吗?前提是你知道该文件系统下有哪些目录。假设为目录A,进入到/bak/FPF/A下面,用ls命令能否列出文件。如果能,另建文件系统,将A目录下内容拷贝出来,然后删掉A目录下内容,只拷贝A目录的,如成功,则其他目录也如此。如果进入A目录不能用ls列出文件,除非你知道A下还有哪些目录,否则该方案无效。 |
|