JFS

From Gentoo Wiki
Jump to:navigation Jump to:search

JFS (Journaled File System) is a 64-bit journaling filesystem created by IBM. An implementation for the Linux kernel is available as free software under the terms of the GNU General Public License. It is low on resource usage and comparatively fast doing all kinds of filesystem operations (as opposed to being specialized in some, e.g. XFS is fast with big files, but slower with small ones). As such JFS is especially good for usage with battery-powered devices such as laptops.

Installation

Kernel

JFS is supported in the standard Linux kernel:

KERNEL Enabling JFS support
File systems  --->
   <*> JFS filesystem support

Optional JFS features:

KERNEL Adding optional JFS features
File systems  --->
   <*> JFS filesystem support
   [*]   JFS POSIX Access Control Lists
   [*]   JFS Security Labels
   [ ]   JFS debugging
   [*]   JFS statistics

Emerge

Filesystem utilities are available in the sys-fs/jfsutils package:

root #emerge --ask sys-fs/jfsutils

Usage

Creation

root #mkfs.jfs /dev/sda1

Mount

root #mount -t jfs /dev/sda1 /path/to/mountpoint

Extracting a Fsck Log

jfs_fscklog can extract the fsck log from a JFS device.

root #jfs_fscklog -d /dev/sda1 -f fsck.log

Tuning

jfs_tune can change different parameters, to change the UUID:

root #jfs_tune -l -U random /dev/sda1

Utilities

Utility Description[1] Man page
fsck.jfs A hard link to jfs_fsck.
jfs_fsck Checks a JFS filesystem for corruption. jfs_fsck(8)
mkfs.jfs A hard link to jfs_mkfs.
jfs_mkfs Creates a new JFS filesystem. jfs_fsck(8)
jfs_debugfs A utility to perform low-level actions on a JFS filesystem. jfs_debugfs(8)
jfs_fscklog Extracts the fsck log from a JFS filesystem. jfs_fscklog(8)
jfs_logdump Dumps the journal of a filesystem into ./jfslog.dmp. jfs_logdump(8)
jfs_tune Adjusts tunable parameters of a filesystem. jfs_tune(8)

Troubleshooting

Fsck

Important
Unmount the filesystem to prevent file damage.

To check a JFS filesystem for corruption, run fsck.jfs:

root #fsck.jfs /dev/sda1

Debugfs

jfs_debugfs can be used to perform low-level actions on a JFS filesystem.

In this example, a JFS filesystem with the layout:

Tree

test/
├── a
├── b
├── c

First, the inode needs to be known for the root of the directory.

Important
The 2 is the inode number
user $ls -id
2 .

Next, enter the debugfs interface with jfs_debugfs:

root #jfs_debugfs /dev/sda1

Now list the directory using the inode number:

>dir 2
idotdot = 2
 
4096	test

4096 is the inode of the test directory, now list the contents of that directory:

>dir 4096
idotdot = 2
 
4097	a
4098	b
4099	c

To see everything that the debugfs interface do, read the man-page jfs_debugfs(8).

See also

  • XFS — a high-performance journaling filesystem
  • Ext4 — an open source disk filesystem and most recent version of the extended series of filesystems.

References