Mounting and Unmounting a File System
Red Hat Linux and other Unix-like operating systems use files in different ways from MS-DOS, Windows, and Macintosh operating systems. In Linux, everything is stored as files in predictable locations in the directory structure; Linux even stores commands as files. Like other modern operating systems, it has a tree-structured, hierarchical directory organization: the file system.All user-available disk space is combined in a single directory tree. The base of this system is the root directory (not to be confused with the root user), designated with a slash (/). A file system’s contents are made available to Linux by using the mounting process. Mounting a file system makes Linux aware of the files and directories it contains. This process is just like mounting a horse — except that no horse is involved.Unlike in the Windows world, Linux file systems, except for /root, must be explicitly mounted or unmounted, which means that file systems can be connected to or disconnected from the directory tree.
Mounting Windows files from a floppy disk
File system mounting and unmounting provide a good example of the difference between Linux and Windows. If you use a floppy disk or CD with Windows, you just insert it into the drive and you have immediate access to it. With Linux, you must insert the floppy disk into the drive and then explicitly mount it. Sound complicated? Not really.You can mount a Windows hard drive partition or floppy on your Linux computer. You can read and write to FAT or FAT32 but can only read from NTFS file systems. These steps show you how to mount a Windows floppy:
Insert a Windows MS–DOS-formatted floppy disk into the drive, click the GNOME Menu button, and choose System ToolsDisk Management. Enter the root password if requested.
Select the floppy disk and click the Mount button.
Tip You know that the floppy disk has mounted successfully when a floppy disk icon is displayed on the left side of the screen.You can now read and write to the floppy disk (unless the read-only tab on the disk is set).
Click the Exit button to close the utility.
Red Hat Linux and GNOME are configured to automatically start the process that mounts your floppy disk or CD when you insert it into the drive. We use the manual method here to show you how the process works. To manually mount the floppy in the command-line interface, log in as root, open the terminal window, and run this command:
mount _t msdos /dev/fd0 /mnt/floppy
Unmounting file systems
Unmounting a Linux file system is a little simpler than mounting one. Because the file system is already mounted, you don’t have to specify any options or other information. You just have to tell the Red Hat disk management druid to unmount the file system. Follow these steps:
Click the Main Menu button and choose System ToolsDisk Manage-ment. Enter the root password if prompted.
When the User Mount Tool window appears, click the button to the right of the file system in which you’re interested.
The button indicates whether the file system is mounted or unmounted. After a few seconds, the button changes from Unmount to Mount to show that it has been unmounted.
Click the Exit button to close the utility.
The file system is unmounted. If the file system is a removable type, such as a floppy disk or CD, you can remove it. Otherwise, the file system is simply not available for use until you remount it.
TipYou can run the eject command from a bash shell to eject a CD. You have to unmount the CD first and then enter the eject command. Otherwise, to eject a CD, you must unmount it and then press the eject button on the CD-ROM drive. In either case, you can’t eject the CD until you have unmounted it.