|
Journaled File System (JFS) for Linux is based on the IBM JFS file system for OS/2 Warp. JFS was donated to open source in early 2000 and was ported to Linux soon after. JFS is well suited to enterprise environments. It uses many advanced techniques to boost performance, provide for very large file systems, and journal changes to the file system. Some of the features of JFS include the following:
JFS has other advanced features, such as allocation groups (which speed file access times by maximizing locality) and various block sizes ranging from 512 bytes to 4096 bytes (which can be tuned to avoid internal and external fragmentation). Note that at this time 4K is the only block size currently supported. Kernel Configuration Support for JFSJFS was merged into the 2.4.20 release of the kernel.org source tree. You can set JFS options from the File Systems section of the configuration menu and enable the following option: JFS filesystem support (CONFIG_JFS_FS=y,m,n) Click y next to the JFS enTRy if you want to build JFS into the kernel. Click m beside the JFS entry if you would like to build JFS as a module. Other options are available in the JFS section for JFS configuration. Working with JFSThere are two ways to tune a JFS file system:
These tuning options are discussed in the following sections. Creating a JFS File SystemThe program that creates a JFS file system is called jfs_mkfs. This program can also be invoked by using the name mkfs.jfs. For a list of all the options of the mkfs utility, see the mkfs.jfs man page. The next example shows how to create a JFS file system using a spare partition (/dev/hdb1). (If there is unpartitioned space on your disk, you can create a partition using fdisk. After you create the partition, reboot the system to make sure that the new partition is available to create a JFS file system on it.) To create the JFS file system with the log inside the JFS partition, issue the following command: # mkfs.jfs /dev/hdb1 After the file system has been created, mount it by using the mount command. Determine the mount point and create a new empty directory, such as /jfs, to mount the file system with the following command: # mount -t jfs /dev/hdb1 /jfs After the file system is mounted, you can try out JFS. To unmount the JFS file system, use the umount command with the same mount point as the argument: # umount /jfs Increasing Speed with an External Log for JFSAn external log improves performance because the log updates are saved to a different partition than their corresponding file system. To create a JFS file system with the log on an external device, the system needs to have two unused partitions. In the following example, /dev/hda1 and /dev/hdb1 are spare partitions. /dev/hda1 is used as the external log. # mkfs.jfs -j /dev/hda1 /dev/hdb1 Mounting the File SystemTo mount the file system, use the following mount command: # mount -t jfs /dev/hdb1 /jfs To avoid having to mount the file system every time you boot, you can add it to the /etc/fstab file. First, make a backup of /etc/fstab and then edit the file and add the /dev/hdb1 device. For example, add /dev/hdb1 /jfs jfs defaults 1 2 Mount OptionsBy default, the JFS mount option integrity is set, which causes metadata changes to be committed to the journal. To change the performance of the JFS file system, use the nointegrity mount option. nointegrity causes the file system to not be written to the journal. The primary use of this option is to allow for higher performance when restoring a volume from backup media. However, the volume's integrity is not guaranteed if the system abnormally abends. Specify the integrity option to remount a volume where the nointegrity option was previously specified in order to restore normal behavior. Linux records an atime, or access time, whenever a file is read. However, this information is not very useful, and it can be costly to track. To get a quick performance boost, simply disable access time updates with the mount option noatime. Tuning JFSA performance option that the jfs_tune utility provides is the capability to change the journal's location, which allows you to move the journal to an external device. Changing a journal's location involves the following steps:
JFS UtilitiesThe following JFS utilities are available in the jfsutils package:
For more information, see the man pages for the JFS utilities. |
|