AIX JFS 单个文件大小限制

(0 comments)

AIX使用过程中,发现无法创建大小超过1G的单个文件:

# dd if=/dev/zero of=large_file bs=1024 count=2000000
dd: 0511-065 Requested a write of 1024 bytes, but wrote only 512.

# ls -l large_file
-rw-r--r--    1 root     system   1073741312 Jun 01 13:57 large_file

经过查证,JFS2本身支持文件系统大小是TB级的,所以这个并不是文件系统的限制。

Maximum JFS2 file system size:  32TB  
Maximum JFS2 file size: 16TB  
Minimum JFS2 file system size:  16MB  

这个单个文件最大1G的限制来自ulimit中,查看设置如下:

# ulimit -a
core file size          (blocks, -c) 1048575
data seg size           (kbytes, -d) 131072
file size               (blocks, -f) 1048575
max memory size         (kbytes, -m) 32768
open files                      (-n) 2000
pipe size            (512 bytes, -p) 64
stack size              (kbytes, -s) 32768
cpu time               (seconds, -t) unlimited
max user processes              (-u) 262144
virtual memory          (kbytes, -v) unlimited
-bash-3.2# exit

编辑ulimit默认配置文件/etc/security/limits,找到如下设置:

default:
fsize = 2097151

将文件最大尺寸限制更改为无限制,如下:

default:
fsize = -1

登出用户后,重新登录,再次查看文件大小限制:

# ulimit -a
core file size          (blocks, -c) 1048575
data seg size           (kbytes, -d) 131072
file size               (blocks, -f) unlimited
max memory size         (kbytes, -m) 32768
open files                      (-n) 2000
pipe size            (512 bytes, -p) 64
stack size              (kbytes, -s) 32768
cpu time               (seconds, -t) unlimited
max user processes              (-u) 262144
virtual memory          (kbytes, -v) unlimited

再次创建2G大小的文件成功。

# dd if=/dev/zero of=large_file bs=1024 count=2000000
2000000+0 records in.
2000000+0 records out.

# ls -l large_file 
-rw-r--r--    1 root     system   2048000000 Jun 01 14:28 large_file
Currently unrated

Comments

There are currently no comments

New Comment

required

required (not published)

optional

required