Using the mount Command Options

The mount command offers many options. Some of these are rather advanced. For example, to perform the mount using the backup of file administration in the superblock that ordinarily sits on block 8193, you can use the following command:

mount -o sb=8193 /dev/somefilesystem /somedirectory

These, however, are options you would use only in the case of an emergency. Some other more advanced options are really useful; for example, when troubleshooting your server, you can boot it with a read-only file system (you can find out more about boot modes in Chapter 10). When the system is mounted read-only, you cannot change anything; therefore, after successfully starting in read-only mode, you would want to mount read-write mode as soon as possible. To do that, use the command mount -o remount,rw /; this would make your root file system read-writable without actually disconnecting the device first.

One of the most important options for the mount command is the -t option. This option specifies the file system type you want to use. Usually, your server will detect what file system to use all by itself. Sometimes, however, you need to help it if the file system self-check isn't working properly. Table 7-1 lists the most commonly used file system types.

Table 7-1. Linux File System Types Type Description minix This is the mother of all Linux file systems. It was used in the earliest Linux version.

Since it has some serious limitations, such as the inability to work with partitions greater than 32MB, it isn't used often anymore. Occasionally, you'll still see it on small media, such as boot disks.

ext2 This has been the default Linux file system for a long time. It was first developed in the early 1990s. The ext2 file system is a completely POSIX-compliant file system, which means it allows you to work with all the properties that are typical for a Unix environment. It has, however, one serious drawback: it doesn't support journaling, and therefore it has been replaced with journaling file systems such as ext3 and ReiserFS.

ext3 Basically, ext3 is ext2 with a journal added. The major advantage of ext3 is that it is completely backward compatible with ext2. The major disadvantage is that it is based on the ext2 file system, which is a rather old file system that was not developed for a world where partitions of several hundred gigabytes are used.

Type

Description reiserfs ReiserFS also is a joumaling file system. It was developed by Hans Reiser as a completely new file system in the late 1990s. Because it is a feature-rich file system, SUSE Linux Enterprise Server 10 uses it as its default file system.

msdos If, for example, you need to read a floppy disk with files on it that were created on a computer using MS-DOS, you can mount it with the msdos file system type. This is, however, somewhat of a legacy file system that has been replaced with VFAt.

vfat The VFAT file system is used for all Windows and DOS file systems that are using a FAT

file system, regardless of which one is used. Use it if accessing files from a Windowsformatted disk or from optical media.

ntfs On Windows systems, NTFS nowadays is the default file system. In Linux, there is no stable open source solution to write to NTFS file systems. However, it is possible to read from an NTFS file system. To do this, mount the media with the NTFS file system type.

iso9660 This is the file system that is used to mount CDs. Normally, you don't need to specify that you want to use this file system because it will be detected automatically when inserting a CD.

smbfs When working on a network, the smbfs file system type is important. This file system allows you to make a connection over the network to a share that is offered by a Windows server, as shown in the previous example.

nfs NFS is the Network File System. This file system is used to make connections between two Unix computers. You can find more about this file system in Chapter 17.

The mount command has many other options, which can be specified by using the -o option. These options are file system dependent; therefore, I won't provide a list of them here.

Tip You can mount more than just partitions and external media. It is, for example, also possible to mount an ISO file. To do this, use the command mount -t iso9660 -o loop nameofyouriso.iso /mnt.This will mount the ISO file on the directory /mnt, which allows you to work on it like you work on real optical media.

Was this article helpful?

0 0

Post a comment