used for that file when the file is deleted. To observe the existing attributes of a file, use:
# lsattr filename
The chattr
utility is part of the e2fsprogs
package.
A file's attributes include its access permissions. The traditional Unix system of permissions is controlled with chmod
. Posix Access Control Lists extend this functionality.
ACL supports permissions for users and groups beyond the traditional owner/group/world scheme. They enable finer-grained control of permissions for files.
To learn more about Access Control Lists, visit the Posix ACLs for Linux website: http://acl.bestbits.at/.
How big are these blocks? The default size is 1,024 bytes, but the size can be made smaller or larger when the file system is first created. The optimum size is determined by the application of the particular machine. If you typically use very large files, a larger block size can speed up disk I/O operations at the expense of slower I/O for smaller files; the reverse is also true. For an individual system, block size might require monitoring over time and benchmarking before an optimal value is determined. For most users, the defaults have been found satisfactory.
File System Partitions
File system partitions are ways to organize blocks of data on the physical drive media and are parts of the overall file system on your computer. No single universal partition format exists. In addition to the commonly used DOS partition format (used by Linux as well), Fedora also provides support for the following partition types:
> Amiga
> Macintosh (compiled into the kernel)
> BSD (compiled into the kernel)
> SunOS/Solaris (compiled into the kernel)
> UnixWare slices (compiled into the kernel)
> SGI (compiled into the kernel)
> Windows Logical Disk Manager
Other modules and support are likely available if you care to search the Internet for them; try searching on the keyword file systems on http://freshmeat.net/ and http://www.google.com/linux/. As is always the case with open-source operating systems, any skilled and enterprising soul can write his own file system modules.
Network and Disk File Systems
File systems can be separated into two broad categories: those that can be used over a network and local disk file systems. You are provided with all the applications necessary to work with both categories of file systems when using Fedora.
Network file systems are physically stored somewhere other than your local computer but appear as if they are mounted on your local computer.
Mounting is the Unix method of attaching a file system (also referred to as a mount
command is covered later in this chapter.
Some common network file system types are:
> NFS
— The Network File System was developed by Sun and is in common use. It has no built-in security because it was originally designed to run over friendly networks. Although considered problematic by some, it is easy to implement. It is typically used between Unix peers. Fedora supports client and server installations of this file system.
> Coda
— Similar to NFS
, Coda
offers support for disconnected operation and security caching (keeping a local copy of files in case the network connection is lost). Fedora provides only kernel compatibility with Coda
; the actual client and server code is available fromhttp://www.coda.cs.cmu.edu/.
> InterMezzo
— Similar in features to Coda
, InterMezzo
is a GPL project. The server daemon can be obtained fromhttp://www.inter-mezzo.org/.
> SMB
—The network-focused Server Message Block protocol was developed by Microsoft. The Linux implementation is known as Samba and is one of the most advanced open-source projects available. It is typically used between Linux and Microsoft Windows peers. Netatalk is the Macintosh equivalent protocol.
Disk file systems are found on a physical device; they are the hard drive in your desktop or laptop computer. Some common disk file system types are:
> FAT
is a disk-oriented, table-based (a linked list) file system used by Microsoft. It has been regularly extended to add functionality. Microsoft's Enterprise-level file system is known as NTFS. (You learn more about this system in 'DOS File Systems,' later in this chapter.)
> ext2
, ext3
, and reiserfs
are inode-based. (You learn about reiserfs
in 'The Reiser File System (reiserfs
),' later in this chapter.)
The JFS (Journaled File System from IBM) and XFS
(from Silicon Graphics) file systems are available for use with Fedora, but primarily serve as migration aids for those migrating existing file systems to Linux.
A journaling file system adds a journal, or hidden file, to the data on the drive. Because of the way data is written to a disk, the kernel might be holding some of the data while it is deciding where to place it. If your computer were to suffer a failure, that cached data would be lost. A journaling file system keeps that data in a special place until the kernel decides to formally write it to the disk. If a system failure occurs, a special application (fsck) knows that the data was never formally written and makes certain that it is written in the correct place. This ensures that no data is lost. Journaling file systems are actually much more complex than this, but the mechanics of them are beyond the scope of this chapter. Journaling file systems such as ext3
, reiserfs
, JFS
, and XFS
are major improvements over older, nonjournaling file systems.
Viewing Your System's File Systems
Your installation of Fedora might have its own unique set of useable virtual file system modules. You can view the file systems that your system can access right now (and verify your kernel's support for these file systems) by using the following command:
# cat /proc/file systems
Your output will vary, depending on your system's hardware and kernel settings. The test system we used for this chapter presented this output:
nodev rootfs
nodev bdev