Managing RAID on Linux - Derek Vadala [118]
Creating a filesystem
Use mkfs.jfs to create a new JFS filesystem:
# mkfs.jfs /dev/sdb1
mkfs.jfs version 1.0.21, 12-Aug-2002
Warning! All data on device /dev/sdb1 will be lost!
Continue? (Y/N) y
Format completed successfully.
17920476 kilobytes total disk space.
The default block size, and the only one that is currently usable, is 4 KB. There are a few options for mkfs.jfs that are outlined in detail in its manual page. Mount the new JFS partition normally, using the -t flag to specify the filesystem type:
# mount -t jfs /dev/sdb1 /mnt/jfs
Several other utilities are also included with JFS that can be used to maintain and analyze the filesystem and the journals. fsck.jfs is used to replay transaction logs and ensure that the filesystem is clean. It is normally invoked automatically when the system boots, although system administrators can also invoke it manually. Also included in the jfsutils package are logdump, xchkdmp, xchklog, and xpeek. These utilities provide various low-level methods for examining and repairing the filesystem and its journals. Please read the associated manual pages before working with them.
Further Information
For more information about IBM JFS, consult the project web site at http://oss.software.ibm.com/developer/opensource/jfs/. Manual pages for each of the JFS utilities are also available. A short installation and overview document, created during the patch process, can be found in the sources under /usr/src/linux/Documentation/filesystems/jfs.txt.
You can also use Moshe Bar's JFS FAQ, located at http://www.moelabs.com/modules.php?op=modload&name=FAQ&file=index&myfaq=yes&id_cat=1&categories=JFS. In addition, there is a mailing list, complete with an archive, for JFS users. Subscription information is available at http://oss.software.ibm.com/developerworks/opensource/mailman/listinfo/jfs-discussion.
SGI XFS
XFS has long been the default filesystem for SGI's IRIX operating system. It is a journaling filesystem designed with an eye toward performance and crash recovery. Since mid-2000, SGI developers have been working on a port of XFS for Linux. In May 2001, version 1.0 of XFS for Linux was released. Development continues, and version 1.1 is currently available.
Like the other filesystems covered in this chapter, XFS provides fast crash recovery through journaling. An XFS filesystem is divided into allocation groups not unlike the block groups used in ext2. Files, data, and free space within allocation groups are organized using B-trees. For a detailed overview of the XFS layout, refer to http://oss.sgi.com/projects/xfs/design_docs/xfsdocs93_pdf/space_overview.pdf.
XFS has been time-proven on the IRIX operating systems. Given that history, XFS's port to Linux is used by groups in the scientific community, such as Fermilab and the Sloan Digital Sky Survey. One of Quantum's NAS product lines is also based on XFS. So even though XFS is handicapped by its lack of inclusion in the standard Linux kernel and its lack of direct support across many Linux distributions, it is being used successfully in some high-demand projects.
Distribution Support
The most recent versions of Mandrake and SuSE support direct installation onto XFS. If you want to use another distribution to install directly onto XFS partitions, you will need to download and create XFS-compatible boot media. I recommend checking the XFS FAQ for a list of compatible distributions and links to alternative boot media that supports XFS. SGI keeps the list quite up-to-date, and it is an excellent resource.
SGI also distributes customized Red Hat CD-ROM images that allow you to install a new system directly to an XFS partition. You can use these images to burn a bootable Red Hat CD-ROM. Since Red Hat also provides installation onto software RAID partitions, you can use the custom SGI disk to install a new system that supports