Mounting and Unmounting and Automounting Filesytems

Before one can access and use data on a filesystem, the filesystem has to be mounted. Mounting is the mechanism supported by Linux which allows the u er to attach the filesystem to a directory on the existing tree.

This is done using the ‘mount’ command.

Example:- Mounting a cdrom and a dos floppy

$ mount /dev/cdrom /mnt/cdrom

$ mount -t msdos /dev/fd0 /mnt/floppy

Once the data access is over from a filesystem and is no longer used, the user has to unmount the filesystem. This is done using ‘umount’ command

Example: unmounting a floppy mounted on /mnt/floppy

$ umount /mnt/floppy

or

$ umount /dev/fd0

Automounting Filesytems

Filesystems can be automounted on startup by making suitable entries in ‘/etc/fstab’

Example:- a sample entries of /etc/fstab

/dev/hda2 / ext2 defaults 0 0

/dev/cdrom /mnt/cdrom auto defaults 0 0

The above entries in /etc/fstab file will cause the root filesystem on /dev/hda2 partition and the cdrom to be mounted on the system startup.

Search in this blog

My Videos Channel