Files & Filesystems / Mounting & Unmounting Filesystems
Subtitles of the Movie
Exam objective 1.104.3 has a weight of 3, and verifies that candidates are able to configure the mounting of a file system. You should be able to manually mount and unmount file systems as well as configure file systems for automatic mounting at boot time. You should be able to configure user mountable file systems such as tape drives, floppies, and CD-ROMs. The heart of mounting and unmounting is in the file system table, a text file named fstab in the etc Directory. This file is only read by programs, never written. It is the duty of the system administrator to create entries in this table. Each mountable file system is on a separate line with fields separated by tabs or spaces. The order can be important because programs that use the file to perform actions do so from top to bottom. Lines beginning with the pound character are comments. The first field is the device node name, or the remote directory name that's being mounted. The second is the mount point; the name of the directory where it is to be mounted. The third column is the type of file system. The fourth column is a comma separated list of options. More on this later. The number in the fifth field, usually zero, is an instruction to the Dump utility about backing up the drive. This last number can be used as an instruction to fsck telling it in which order to check the file systems. These are some of the mount options you can specify in fstab. You can specify RO for Read only, and the file system can't be written to. In the example I showed you earlier, the CD-ROM was read only. Or, you can specify rw for Read-Write. This option prevents the set user identifier, and the set group identifier bits from having any effect. This can be dangerous. Noexec will prevent the execution of any binaries located on the file system. The Mount command has an option that will mount every file system in the table except the ones that have the Noauto option. In the example I showed you earlier, both the floppy and the CD-ROM were tagged noauto. A file system marked noauto will not automatically be mounted when the system boots. It can only be mounted manually. This option allows any user to mount and unmount the file system. By default only the super user can do it. There are some other options, but the ones I showed you are the most commonly used. If you need to do something special, check the MAN page of the Mount command. Also, you will see that there are lots of command line options for the Mount command itself. Entering the Mount command with no arguments displays all the currently mounted systems. As you can see, there are two hard drives mounted. You can unmount a drive by mentioning the device node, or mentioning the name of the directory to which it's mounted. With ls you can see all the directories in User Local. Now, to unmount it. Notice the spelling, it's UMOUNT, not unmount. Notice that I specified the directory name, not the device node. Either one will work because both are in fstab. And now you can see that the directory is still there, but the files are gone. Also, you can see that it's no longer listed as being mounted. I can put it back by naming the device node. And now, the disk has reappeared. The list of mounted items looks like this. Using the A Option on the Mount command causes it to look in fstab and attempt to mount everything that's not listed as noauto. So, now a list of mounted file systems looks like this. You need to have some experience with setting up mounts and unmounts. Create a file system on a floppy and create a directory named Floppy in the Home Directory, then add an entry for mounting it to your fstab. Mount and unmount it by naming the device, and again, by naming the directory. Add the auto option to fstab and see what happens when you boot. Do the same with the noauto option.
Tutorial Information
| Course: | Linux Professional Institute: Level 2 |
| Author: | Arthur Griffith |
| SKU: | 33894 |
| ISBN: | 1-934743-79-8 |
| Release Date: | 2008-07-21 |
| Duration: | 7.5 hrs / 113 lessons |
| Captions: | Available on CD and Online University |
| Compatibility: |
Vista/XP/2000, OS X, Linux QuickTime 7, Flash 8 |
VTC Sign up & Benefits
- Unlimited Access
- 81,350 Video Tutorials (20,800 free)
- Video Available as Flash or QuickTime
- Over 782 Courses
- $30 for One Month Access
- Multi-User Discounts Available
United States 