A file system is a set of files, directories, and other structures. File systems maintain information and identify the location of a file or directory's data. In addition to files and directories, file systems may contain a boot block, a superblock, bitmaps, and one or more allocation groups. An allocation group contains disk i-nodes and fragments.
The following three types of file systems are supported on an AIX system.
The Journaled File System (JFS) divides the logical volume into a number of fixed size units called logical blocks. The logical blocks in the file system are organized as follows:
The size for a Journaled File System (JFS) is defined when the file system is created considering the following parameters:
The total number of i-nodes in a file system limits the total number of files and the total size of the file system. The JFS provides the nbpi (number of bytes per i-node) parameter that affects the number of i-nodes in a file system. JFS supports nbpi values of 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, and 131072. The values 32768, 65536, and 131072 only apply to AIX Version 4.2 or later.
For example, to create an 8 MB file system with an nbpi value of 4096, an i-node will be generated for each 4096 bytes of data. This would result in a maximum of 2048 i-nodes for an 8 MB file system, which means that if every file in the file system is ideally 4 KB in length, a maximum of 2048 files can be created in the file system.
The JFS restricts all file systems to 16 MB (224) i-nodes.
AIX Version 4.2, or later, supports various allocation group sizes. The JFS
segregates file system space into groupings of i-nodes and disk blocks for user
data. These groupings are called allocation groups. The allocation group size
can be specified when the file system is created. The allocation group sizes
are 8 MB, 16 MB, 32 MB, and 64 MB. Each allocation group size has an associated
nbpi range. The ranges are defined by the following table:

Table 28: Allowable nbpi Values
The JFS supports four fragment sizes: 512, 1024, 2048, and 4096 byte units of contiguous disk space. The JFS maintains fragment addresses in i-nodes and indirect blocks as 28-bit numbers. Each fragment must be addressable by a number from 0 to 228. If a file predominately 400 byte files, a fragment size of 512 would be the most efficient, since 4096-byte fragments would be wasted space. The fragment is the smallest addressable unit of storage.
Multiple Journaled File Systems use a common log, called a JFS log, configured to be 4 MB in size. For example, after initial installation, all file systems within the root volume group use the logical volume hd8 as a common JFS log. The default logical volume partition size is 4 MB, and the default log size is one partition; therefore, the root volume group normally contains a 4 MB JFS log. When file systems exceed 2 GB, or when the total amount of file system space using a single log exceeds 2 GB, the default log size needs to be increased. The JFS log is limited to a maximum size of 256 MB.
The maximum JFS size is defined when the file system is created. For example, selecting an nbpi ratio of 512 will limit the file system to a size of 8 GB (512 * 228 = 8 GB). When creating a JFS file system, the factors listed (nbpi, fragment size, and allocation group size) need to be weighed carefully. The file system size limitation is the minimum of NPBI * 224 or Fragment Size * 228.
Every file system in AIX corresponds to a logical volume. In order to create a Journaled File System, use the following SMIT hierarchy.
| Note |
|---|
|
In AIX, all of the I/O is in 4 KB blocks; however, space is allocated in multiples of 512 byte blocks. This is done just to remain consistent with other UNIX systems. The smallest file system that you can create is equal to one PP; therefore, even if you specify that the number of blocks to be less than one PP, the system will still create a file system equal to one PP. The following example shows how to calculate the number of blocks for a given amount of space in MB.
This indicates that the equivalent number of blocks for a file system of 2 MB are 4096 (enter this number in the Size of File System field). |
Alternatively, you can perform the same task on the command line using the following command:
crfs -v jfs -g rootvg -a size=8192 -m /dummy
This will create a journaled file system of 8 MB with /dummy as the mount point in the rootvg volume group.
Mounting is a concept that makes file systems, files, directories, devices, and special files available for use at a particular location. It is the only way a file system is made accessible. Once you have created the file system, the next task is to make it available to your users. In order to do that, you must know how AIX manages the patching of the newly created file systems into its file tree using the mount points.
Figure 59 shows a file system mount point (/u/dick)
before a file system is mounted over it.
Figure 59: File Tree View before Mounting
Figure 60 shows a mounted file system /u/dick over the
/u/dick mount point.
Figure 60: File Tree View after Mounting
| Note |
|---|
|
The following command shows how to mount a file system (/FileSystemX).
mount /FileSystemX
Alternatively, if you know the name of the device associated with your file system, you can use the device name to mount your newly created file system.
If you want to mount all the file systems, you can use the following command to mount all the file systems at one time.
mount {-a|all}
A file system can be also be mounted using the following SMIT fast path hierarchy.
Mounts can be set to occur automatically during system initialization. There are two types of automatic mounts:
You can specify a file system to be mounted automatically when you either use the mount all command or the by the /etc/rc script at the initialization time. You can achieve this by setting the Mount AUTOMATICALLY at system restart field to TRUE when you are creating a file system (see Figure 57).
The following example shows the use of the command mount without a flag to display information about all the currently mounted file systems.
# mount
node mounted mounted over vfs date options
-------- --------------- --------------- ------ ------------ ---------------
/dev/hd4 / jfs Oct 25 18:20 rw,log=/dev/hd8
/dev/hd2 /usr jfs Oct 25 18:20 rw,log=/dev/hd8
/dev/hd9var /var jfs Oct 25 18:20 rw,log=/dev/hd8
/dev/hd3 /tmp jfs Oct 25 18:20 rw,log=/dev/hd8
/dev/lv01 /var/dce jfs Oct 25 18:21 rw,log=/dev/hd8
/dev/hd1 /home jfs Oct 27 15:14 rw,log=/dev/hd8
/dev/lvtest /test jfs Oct 27 15:17 rw,log=/dev/hd8
/dev/lv07 /auto1 jfs Oct 27 15:34 rw,log=/dev/hd8
The following example shows the steps involved to remove a file system.
# mount
node mounted mounted over vfs date options
-------- --------------- --------------- ------ ------------ ---------------
/dev/hd4 / jfs Oct 25 18:20 rw,log=/dev/hd8
/dev/hd2 /usr jfs Oct 25 18:20 rw,log=/dev/hd8
/dev/hd9var /var jfs Oct 25 18:20 rw,log=/dev/hd8
/dev/hd3 /tmp jfs Oct 25 18:20 rw,log=/dev/hd8
/dev/lv01 /var/dce jfs Oct 25 18:21 rw,log=/dev/hd8
/dev/hd1 /home jfs Oct 27 15:14 rw,log=/dev/hd8
/dev/lvtest /test jfs Oct 27 15:17 rw,log=/dev/hd8
/dev/lv07 /auto1 jfs Oct 27 15:34 rw,log=/dev/hd8
umount <filesystem name>
Using the SMIT fast path command smitty rmjfs to remove a Journaled
File System will display a screen similar to the one shown in
Figure 64.
Figure 64: rmjfs - Step 1
AIX provides you with the ability to increase the size of a file system dynamically provided you have enough free space available on your disk. File systems that are low on space might create unanticipated problems.
| Note |
|---|
|
Whenever a file system is full, the system cannot write to it and returns you the following error: There is not enough room in the file system |
A file system can be increased by using the chfs command as shown in the following steps:
chfs -a size=<new size in 512-byte blocks> <file system name> Filesystem size changed to <new size in 512-byte blocks>
To increase the file system size using the SMIT fast path command (smitty chjfs), perform the following steps:
At times, it is possible that you increased the size of a file system (for example if you had to install a new product, therefore, you increased the size of your /myfs manually to a large value). Later on, you de-installed the product which left you with a 99 percent un-utilized /myfs file system. Since this space has been allocated to the /myfs file system, it cannot be used by any other file system.
The following example shows how to reduce the size of the /myfs file system.
| Note |
|---|
|
If you enter a value that is less than the minimum size required to contain the current data (indicated in the LV_MIN_LPs entry), the reinstallation process will fail. Use the df -k command to see the current blocks used in the file systems, then divide this number by 1024 to get the total MB of the file system. |
The fsck command checks file system consistency and interactively repairs the file system. The general syntax of the fsck command is as follows:
fsck [ -n ] [ -p ] [ -y ] [ -dBlockNumber ] [ -f ] [ -ii-NodeNumber ] [ -o Options ] [ -tFile ] [ -V VfsName ] [ FileSystem1 - FileSystem2 ... ]
The flags commonly used with the fsck command and their meanings
are shown in Table 29.

Table 29: fsck Command Flags
The fsck command checks and interactively repairs inconsistent file systems. You should run this command before mounting any file system. You must be able to read the device file on which the file system resides (for example, the /dev/hd0 device).
Normally, the file system is consistent, and the fsck command merely reports on the number of files, used blocks, and free blocks in the file system. If the file system is inconsistent, the fsck command displays information about the inconsistencies found and prompts you for permission to repair them. If the file system cannot be repaired, restore it from backup.
Mounting an inconsistent file system may result in a system crash. If you do not specify a file system with the FileSystem parameter, the fsck command will check all the file systems with attribute check=TRUE in /etc/filesystems.
| Note |
|---|
|
By default, the /, /usr, /var, and /tmp file systems have the check attribute set to False (check=false) in their /etc/filesystem stanzas. The attribute is set to False for the following reasons:
|
The logform command initializes a logical volume for use as a JFS log device, which stores transactional information about file system metadata changes and can be used to roll back incomplete operations if the machine crashes. The following is the general syntax of the logform command.
logform LogName
| Note |
|---|
|
AIX 4.3 provides support for file sizes in excess of 2 GB. 64-bit processes can open files without specifically indicating that they understand large files.
With the large file support in AIX Version 4.2, there was no underlying support for file size limits in excess of 2 GB.
In file systems enabled for large files, file data stored before the 4 MB file offset is allocated in 4096 byte blocks and the file data stored beyond the 4 MB file offset is allocated with large disk blocks of 128 KB in size. The large disk blocks are actually 32 contiguous 4096 byte blocks.
For example, a 132 MB file in a file system enabled for large files has 1024 number of 4 KB disk blocks and 1024 number of 128 KB disk blocks. In a regular file system, the 132 MB file would require 33 single indirect blocks (each filled with 1024 number of 4 KB disk addresses). However, the large file geometry requires only two single indirect blocks for the 132 MB file.
You can determine large file enabled file systems using the lsfs -q
filesystem command as shown in Figure 68.
Figure 68: lsfs -q Command Output
The bf: output field in the preceding example indicates a big file. This field specifies the file system is a large file enabled if it has a value of true.