Novell Home

Linux Filesystem Overview

From Developer Community


   This article is a stub. If you have experience with or knowledge about this topic you can help by adding to it.


Contents

What Is A Filesystem?

A Linux filesystem is a low-level application that manages the storage and access of files on a Linux computer system. Filesystems need to provide the ability to applications and users to create files and directories, open and modify existing files or directories, delete files or directories, specify access controls on files and directories, etc. There are several different types of filesystems available for Linux (discussed below).

The Filesystem Hierarchy Standard

The Linux Filesystem Hierarchy Standard is a work produced by a loosely organized body with the intent of defining how files should be laid out on a Linux computer. The standard specifies the minimum set of subdirectories that should be located at the root level, what the names of these directories should be, and what they should contain. The Linux Documentation Project includes the Linux FHS specification.

Filesystems Available for SUSE Linux

Non-Journaled Filesystems

The standard filesystem for Linux, ext2, is a high-performing, non-journaled filesystem. Although ext2 lacks journaling features, many users choose it because of its high speed and reliability.

Journaled Filesystems

Journaled filesystems include additional record keeping that increases the ability of the filesystem to recover from a crash.

  • ext3 - the ext2 filesystem with journaling extensions.
  • jfs - Journaled File System - a filesystem contributed to Linux by IBM.
  • xfs - A filesystem contributed to open source by SGI.
  • reiserfs, developed by Namesys, is the default filesystem for SUSE Linux and is sponsored by the United States Defense Advanced Research Projects Agency.
  • nss - Novell Storage Services is a journaled filesystem from Novell that is highly dependent upon a directory service and which provides very powerful file access control capabilities.
Selecting a Filesystem

Given the variety of filesystems available for Linux, it can be hard to know which filesystem to select. Here are a few considerations to keep in mind.

  1. How important is data integrity? Do you need to be able to recover data from a crash? If data recovery is more important than raw speed, you should consider a journaled file system.
  2. What kind of file access control do you need? The NSS filesystem provides probably the most powerful file access control capabilities of any other Linux filesystem, and is a good candidate for filesystems where complex access control mechanisms need to be applied to the whole filesystem.
  3. How important is speed to you? Of the four other journaled filesystems (ext3, jfs, xfs, reiserfs), the performance of each varies depending upon the task, although ext3 is generally found to be the slowest of the four. Here are a couple of benchmarks you can refer to for more detailed information on speed:
    1. Benchmarking Filesystems - Linux Gazette
    2. Linux Filesystem Speed Comparison - squid_cache.org
    3. Benchmarks of ReiserFS Version 4
  4. Also check out Comparison of file systems for more detail.

Networked Filesystems

Linux also supports many networked filesystems, including NFS, Novell NCP, and SMB via Samba. Networked filesystems can be mounted to an existing directory, after which, applications can access the files in the mounted filesystem as though they were local.

Development Considerations

Why should you, an application developer, care about understanding the Linux filesystem?

  1. If your application has anything to do with data, you will more than likely have to interact with the filesystem eventually.
  2. Since you cannot usually predict what type of filesystem your application will be interacting with, you should take care to check for errors and catch exceptions in your code that interacts with the filesystem. For example, you may neglect to handle the possible error that can result from trying to write to the filesystem, saying, "I have never seen this error before." However, you don't know if a user of your application will make use of a network filesystem that could potentially have a failure.
  3. Understanding the Filesystem Hierarchy Standard, and supporting it in your application, means following application naming and installation location specifications. This minimizes the likelihood of name collisions and makes it much easier for your application to be supported in multiple Linux versions.


   This article is a stub. If you have experience with or knowledge about this topic you can help by adding to it.

Novell® Making IT Work As One

© 2008 Novell, Inc. All Rights Reserved.