JFS
JFS (Journaled File System) 是一个由 IBM 创造的 64 位日志文件系统. 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.
安装
内核
标准 Linux 内核已经支持了 JFS:
File systems --->
<*> JFS filesystem support
可选的 JFS 特性支持:
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:
文件系统的实用程序位于 sys-fs/jfsutils 软件包中:
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
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:
test/
├── a
├── b
├── c
First, the inode needs to be known for the root of the directory.
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).