30 days with JFS

By Keith Winston

Printer friendly page Print
Comment on this article Comments

The Journaled File System (JFS) is a little-known filesystem open sourced by IBM in 1999 and available in the Linux kernel sources since 2002. It originated inside IBM as the standard filesystem on the AIX line of Unix servers, and was later ported to OS/2. Despite its pedigree, JFS has not received the publicity or widespread usage of Linux filesystems like ext2/3 and ReiserFS. To learn more about JFS, I installed it as my root filesystem. I found it to be a worthy alternative to the bigger names.

To give JFS a try, I installed Slackware 12 on a laptop, choosing JFS as the filesystem during installation. I performed no special partitioning and created one JFS filesystem to hold everything. Installation was uneventful and the system booted normally from GRUB. Not all distributions offer JFS as an install option, and some may not have JFS compiled into their default kernels. While Fedora and SUSE users can use JFS, they both default to ext3. Slackware, Debian, Ubuntu, and their derivatives are good choices for anyone who wants to try JFS.

One of the first things I noticed about my new system was the absence of a lost+found directory, which is a relic of lesser filesystems.

JFS is a fully 64-bit filesystem. With a default block size of 4KB, it supports a maximum filesystem size of 4 petabytes (less if you use smaller block sizes). The minimum filesystem size supported is 16MB. The JFS transaction log has a default size of 0.4% of the aggregate size, rounded up to a megabyte boundary. The maximum size of the log is 32MB. One interesting aspect of the layout on disk is the fsck working space, a small area allocated within the filesystem for keeping track of block allocation if there is not enough RAM to track a large filesystem at boot time.

JFS dynamically allocates space for disk inodes, freeing the space when it is no longer required. This eliminates the possibility of running out of inodes due to a large number of small files. As far as I can tell, JFS is the only filesystem in the kernel with this feature. For performance and efficiency, the contents of small directories are stored within the directory’s inode. Up to eight entries are stored in-line within the inode, excluding the self (.) and parent (..) entries. Larger directories use a B+ tree keyed on name for faster retrieval. Internally, JFS uses extents to allocate blocks to files, leading to efficient use of space even as files grow in size. This is also available in XFS, and is a major new feature in ext4.

JFS supports both sparse and dense files. Sparse files allow data to be written to random locations within a file without writing intervening file blocks. JFS reports the file size as the largest used block, while only allocating actually used blocks. Sparse files are useful for applications that require a large logical space but use only a portion of the space. With dense files, blocks are allocated to fill the entire file size, whether data is written to them or not.

In addition to the standard permissions, JFS supports basic extended attributes, such as the immutable (i) and append-only (a) attributes. I was able to successfully set and test them with the lsattr and chattr programs. I could not find definitive information on JFS access control list support under Linux.

Read more at Linux.com

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s