A filesystem is composed of files and directories, all under a single
root directory. The root directory and the directories below it may
contain any number of files and subdirectories. A
filesystem often looks like an inverted tree with the
directories as branches and the files as leaves. Filesystems reside on
mass storage devices such as diskette drives, hard drives, and CD-ROMs.
For example, a diskette drive on DOS and Windows machines is typically
referenced by A:\. This describes both the device
(A:), and the root directory on that device
(\). The primary hard drive on the same systems is
typically referred to as the "C" drive because the device specification
for the first hard drive is C:. To specify the
root directory on the C drive, you would use C:\.
Under this arrangement, there are two filesystems — the one on
A:, and the one on C:. In
order to specify any file on a DOS/Windows
filesystem, you must either explicitly specify the device on which the
file resides, or it must be on the system's default drive (which is
where DOS' C prompt comes from — that's the default drive on a
system with a single hard drive).
Under Linux, it is possible to link the filesystems on several mass
storage devices together into a single, larger filesystem. This is done
by placing one device's filesystem "under" a directory on another
device's filesystem. So while the root directory of a diskette drive on
a DOS machine may be referred to as A:\, the same
drive on a Linux system may be accessible as
/mnt/floppy.
The process of merging filesystems in this way is called
mounting. When a device is mounted, it is then
accessible to the system's users. The directory under which a mounted
device's filesystem is accessible is known as the mount
point. In the previous paragraph's example,
/mnt/floppy was the diskette drive's mount point.
Note that there are no restrictions (other than common conventions) on
the naming of mount points. We could have just as easily mounted the
floppy to /long/path/to/the/floppy/drive.
One thing to keep in mind is that all of a device's files and
directories are relative to its mount point. Consider the following
example:
A Linux System:
A CD-ROM:
/ — the CD-ROM's root directory
/images — a directory of images on
the CD-ROM
/images/old — a directory of old images
So, if the above describes the individual filesystems, and you mount the
CD-ROM at /foo, the new operating system directory
structure would be:
To mount a filesystem make sure to be logged in as root, or become root
using the su command. For the latter, type
su at the shell prompt and then enter the root
password. Once you are root, type mount followed by
the device and then the mount point. For example, to mount the first
diskette drive on /mnt/floppy, you would type the
command mount /dev/fd0 /mnt/floppy.
At installation, Red Hat Linux will create /etc/fstab.
This file contains information on devices and associated mount points.
The advantage to this file is that it allows you to shorten your mount
commands and it controls which filesystems are automatically mounted
when the system is booted.
Using the information in /etc/fstab, you can type
mount and then either the mount point or the device.
The mount command will look for the rest of the
information in /etc/fstab. It's possible to modify
this file by hand, or by using Linuxconf.
We'll start by looking at your current directory structure.
The fields, as shown in Figure 14-9,
are:
Source: The physical hardware;
hd indicates an IDE hard drive,
fd indicates a diskette drive, and
cdrom typically indicates a CD-ROM drive. If
your system has a SCSI drive, you will see an
sd instead. More than one drive of a type
are listed by letters, so hda represents the
first IDE drive, while hdb would be the
second. In some cases, you'll see numbers following these
letters. On hard drives, the numbers represent the partitions on
that drive; for diskette drives, the number refers to the actual
unit.
Mount point: The place in the filesystem from
which the drive (or other device) is accessible after it is mounted.
FsType: The type of filesystem. A standard
Linux partition uses the ext2 filesystem type. A filesystem type
of vfat indicates a DOS filesystem with long filename support,
while a fat filesystem type is for DOS filesystems supporting
traditional 8.3 filenames. The iso9660 filesystem type indicates
a CD-ROM drive.
 | Note |
|---|
| | Red Hat Linux 7.1 can access FAT32 filesystems using the
vfat filesystem type.
|
Size: Size may indicate the size of the
filesystem in megabytes (M), or it may not be filled in.
Partition type: A description of the
filesystem used on that partition, but it may not be filled in.
Status: Whether the device is mounted or
not.
Filesystems from other machines on a network may also be available.
These can range from one small directory to entire volumes. No
information on Size or Partition
type is available for these partitions. Additional
information on NFS filesystems (if any are available) will be
contained under:
=> =>
The screen is similar to the Local Volume screen
(see Figure 14-9), with some notable
differences in the information provided for each entry:
Source: This will be the name of the machine
serving the filesystem, followed by the remote directory. For
example, you might see a value of
foo:/var/spool/mail where
foo is the machine serving the directory and
/var/spool/mail is the directory being
served.
FsType — This will always be "nfs."
NFS (Network File System) is a way for computers to share sections of
their local filesystem across a network. These sections may be as
small as a single directory, or include thousands of files in a vast
hierarchy of directories. For example, many companies will have a
single mail server with individuals' mail files served as an NFS mount
to each users' local systems.
To add an NFS mount:
You will need to fill in the three fields on the
Base tab next (see Figure 14-10).
Server: The hostname of the machine on which
the desired filesystem is located. For example, foo.bar.com.
Volume: The filesystem you wish to add. For
example, /var/spool/mail.
Mount point: The directory in your system
from which you want the remote file system to be accessible. For
example, /mnt/mail.
This is all you need to get the mount created.
Linuxconf will update your
/etc/fstab file accordingly. If you are aware of
additional requirements, please read the help file on the
Volume specification screen and see the
mount man page for more information.
Once you have entered the information, select
Accept.