> journal
— The slowest, but most secure mode because all the data is written to the journal before it is written to the regular file system.
> ordered
— This is the default mode in which all data is written to the main file system prior to its metadata being committed to the journal.
> writeback
— With this option, data can be written into the main file system after its metadata has been committed to the journal. This option enables old data to appear in files after a crash and journal recovery, but it is the fastest option.
mkreiserfs
The Reiser file system journals file data and handles smaller files more efficiently than the ext3
file system. Although it is suitable for use as the root file system, Fedora does not officially support its use in that way. You use the mkreiserfs command to create a Reiser file system. The default values for mkreiserfs
work well. To create a Reiser file system, use:
# mkreiserfs
Creating a DOS File System with mkdosfs
It is possible to create DOS file systems without owning any Microsoft software if you use the mkdosfs
command. To create a DOS file system in an image file, use the -C option. The - n
option enables you to specify a volume label. To create a 1.4MB DOS file system as an image file with the label dosfloppy
, the sector size (-S
) should be 512
and the block count should be 1440
. Use the -v
option to provide verbose output so that you can observe what happens.
# mkdosfs -n dosfloppy -v -C floppy.img -S 512 1440
A complete review of all the argument options and syntax for creating a DOS file system can be found in the man page for mkdosfs
. The new file system must be mounted (as described in the following section) and then formatted with the mformat
command.
Mounting File Systems
File systems in Unix are very flexible in that they need not be physically present on your computer; you can have network access to other file systems on other machines. The Linux file system structure (the Virtual File System we spoke of at the beginning of the chapter) makes it appear as if all the file systems, regardless of type and location, are local and mounted somewhere on the root file system. As the system administrator, you decide what file systems are to be made available and where they will be attached, or mounted, to the root file system. The standard arrangement of the file system tree is that installed by default by Fedora. The source of that standard arrangement is found in the file system hierarchy standards. Although a detailed discussion of those standards is beyond the scope of this section, they can be examined at http://www.pathname.com/fhs/. In this section, you learn how to mount file systems to the root file system and add file systems to the system, and you learn the traditional mount points of commonly used file systems as well.
In Linux (and its Unix cousins), all file systems — whether local, remote, images on a disk, or in memory — are mounted on a single point known as root (which is not the same as the root operator, also known as the super-user). This mount point is written as a forward slash, /
, which is read and pronounced 'root.' The resulting file directory hierarchy all starts from /
. After they are mounted, the physical location of the files is unimportant because they all appear to be local.
Even if the file systems are different (FAT
, ext2
, HPFS
, NTFS
, and so on), the Linux kernel modules and the VFS make them all appear as part of the directory tree as native files. Listing the file systems as native files obviates the need for any applications to be aware of the physical location of the file or the true nature of the native file system. As a result, programming these applications is simplified because the applications have to work only with what they think are local, native files.
Any file system can be mounted anywhere, but some places are more traditional than others. Removable media devices are traditionally mounted under the /mnt
directory (for example, CD-ROM drives on /mnt/cdrom
). The /mnt
directory is the traditional place to mount removable or remote file systems that are unrelated to the local system directories that branch from the root mount point.
The mount
Command
File systems are mounted with the mount
command and unmounted, curiously enough, with the umount
command.
During the installation, you have the opportunity to decide where and how your partitions will be mounted. You indicate your choices, and Fedora automatically stores them in /etc/fstab
, the file system table, for you. The mount
command looks at /etc/fstab
and mounts the file system according to those set preferences. You learn more about the file system table later in this section.
The syntax for mount
is:
mount -t
Here are the components of the mount
command, and a brief explanation of each:
>
— Always preceded by the -t
argument and followed by a space, and then the type of file system you are mounting. Typical file system types are ext2
, ext3
, vfat
, iso9660
, hpfs
, hfs
, ntfs
, and others. For many file systems, mount
can detect what type they are automatically, and the -t
argument is superfluous (and is replaced with auto
).
> file system_to_be mounted
(as represented by the partition on which it resides) — This is the device name of the file system you want to mount
, typically in the form of /dev/hd
, /dev/sc
, or /dev/fd
.
> mount_point
— The place in the directory tree where you want to mount the file system. Curiously, you can mount a file system over part of an existing file system. For example, if you have an existing directory at /foo
with a single file named bar
, and you mount a file system at /foo
that includes a file named snafu
, a listing of the directory /foo
does not show the file bar
, but only the file snafu
. To show both files is a feature called
The only real restriction to 'mount anything anywhere' is that the critical system files in /bin
, /etc
, /lib
, /dev
, /proc
, and /tmp
need to be accessed at bootup, which typically means that they need to be on the same physical disk. If they cannot be accessed at bootup, Linux does not load and run.
Here are a few examples of using the mount
command:
Mounting a floppy:
# mount -t vfat /dev/fd0 /mnt/floppy
Mounting a CD-ROM: