In Linux the only file system that is automatically mounted is the root file system which is automatically mounted on the root directory. Other file systems (eg. your floppy drive, cd rom drive, windows partitions, and any linux partitions other than root) can be mounted and unmounted as required. In the case of drives used with portable media (such as floppy drives, cd rom drives, and zip drives) it is necessary to unmount the drive before being able to remove the media from the drive (some recent linux versions may handle this for you automatically).
Before we can mount and unmount file systems we need to configure them so that linux knows about them and knows whether or not to mount them when the system first starts up. This configuration information is held in the fstab file which is normally found at /etc/fstab. This file contains a one line entry for each file system that the system knows about. Each entry within the file contains the following fields:
- Device the name of the special file where the file system resides (eg. /dev/fd0 for the first floppy drive).
- mount is the directory where the file system is to be mounted.
- type is the type of file system that the device uses (eg. ext2, nfs, iso9660, swap, msdos, hpfs).
- options that identify the available access to the file system (eg. ro = read only, rw = read/write, noauto = don't automatically mount at system startup).
- dump frequency at which the file system will be backed up by the dump utility (your system may not actually use this).
- fsck a number identifying the order in which the file systems should be checked and mounted at system startup (the / directory must be 1).
If you log in as root (or use the su command) you will have access to edit this file to allow you to add any additional file systems that your network may have as well as changing any of the options relating to the entries that are already in the file. You can use any of the many available text editors that linux has in order to make these changes.
This takes care of defining all of your file systems.
Next we need to ensure that all of the actual mountpoints are defined. You need to log in as root or use the su command to get access to do this as well as to be able to mount and unmount file systems.
To define a mount point, go to a command prompt and cd /mnt. This takes us to the /mnt directory which is the most appropriate place to define the mount points. To define a mount point type mkdir /floppy (where floppy is whatever you want the mount point to be called).
For those entries in the fstab where noauto wasn't specified, this is all that you need to do. The next time that you reboot the computer, those file systems will be mounted automatically.
Where noauto was specified, the file system will need to be mounted manually by going to a command prompt and entering a mount command eg. mount /dev/fd0 /mnt/floppy. Going into the mounted directory will now display all of the files and sub-directories that are available within the mounted file system.
You can also unmount any file system except the root file system by entering a umount command eg. umount /dev/fd0 or umount /mnt/floppy.
If you have a dual or multi boot system then you might consider automatically loading partitions belonging to the other operating systems as read only (assuming that you will never want to write anything to those partitions) or specify noauto and only mount them when you need them (if you need update access). This will protect those partitions from being impacted unintentionally from any actions that you perform while using Linux.