Question & Answer
Question
How do I configure AIX to support files greater than 2 GB (gigabytes)?
Answer
This TechNote addresses the file size limitations and configuration changes that are necessary for writing, uncompressing or creating a file over 2 gigabytes (GB).
Viewing Soft User Limits
To view soft limits, run:
# ulimit -a
Information similar to the following should be displayed:
time(seconds) unlimited
file(blocks) 2097151
data(kbytes) 131072
stack(kbytes) 32768
The "file" or "fsize" limit controls the user's ability to write files. The output is in 512-byte blocks.
To Create a File over 2GB
Two requirements exist for creating a file over 2GB:
1. The file system must be large file enabled (if JFS).
JFS2 filesystems already support files over 2GB.
To view the filesystem settings:
a. Run "smitty fs"
b. Select "Add/Change/Show/Delete File Systems".
c. Choose "Journaled File Systems".
d. Select "Change/Show Characteristics of a Journaled File
System"
e. Choose the file system that you are using.
f. Scroll down until you get to "Large File Enabled".
If that says "false" then the filesystem is not large-file enabled. If it says "true" it is enabled for large files.
From the command-line you can use lsfs to show this. To use the "-q" option you must be root, su'ed to root, or have appropriate RBAC entitlement.
# lsfs -q /mtpt
Name Nodename Mount Pt VFS Size Options Auto Accounting
/dev/lv01 -- /mtpt jfs 20971520 -- no no
(lv size: 20971520, fs size: 20971520, frag size: 4096, nbpi: 4096, compress: no, bf: false, ag size: 8)
bf = false means big files are not supported
bf = true means the filesystem supports large files
- NOTE: If the file system is large file enabled, you may use it as it is. If it is not large file enabled, you cannot use this file system. Once a JFS filesystem has been created and the "bf" flag has been set, it cannot be changed. Choose one of the options below to correct the problem.
--> Use a file system that is large file enabled or create one
that is large file enabled
Or
-> Back up, remove and recreate the file system large file
enabled and then restore from backup the filesystem that
you intend to use.
2. The fsize ulimit setting for root and the user must be large enough to support the file size being created.
First check the user's limit for the "fsize" parameter in /etc/security/limits using
# lsuser -a fsize username
The output will be in multiples of 512-bytes. For example:
# lsuser -a fsize newguy
newguy fsize=2097151
In this example fsize is 2097151 512-byte increments, or 1073741312 bytes (approx 1 GB)
Commonly the fsize will be 2097151 in 512k bytes, just over 1GB. If you have a file system that is not large file enabled, then the largest recognised fsize value is 4194302 (or 2GB). After 2GB, the
fsize is not scalable and must be set to -1, which equals unlimited. -1 actually allows for the creation of up to a 64GB file.
Once both the above criteria are met, the user should be able to create a file above 2GB in the specified file system.
Verify the Creation of 1, 2, and 3 GB Files
Run the following commands to create 1, 2 and 3GB files:
a. Create a 1GB file:
$ /usr/sbin/lmktemp filename1 1073741824
b. Create a second 1GB file:
$ cp filename1 filename2
c. To create a 2GB file, append the first file to the second
file:
$ cat filename1 >> filename2
d. To create a 3GB file, append the first file to the second
file again:
$ cat filename1 >> filename2
Was this topic helpful?
Document Information
Modified date:
17 June 2018
UID
isg3T1023245