The Mount Command

The "mount" command uses the following syntax:

mount -t <**filesystem> -o <options**>

**Illegal HTML tag removed : <**

mountpoint**>**

Example: Reading a DOS / Windows floppy

  • Insert the floppy and type:

mount -t vfat /dev/fd0 /mnt/floppy

  • Now change to the newly mounted file system:

cd /mnt/floppy

  • You should now be able to navigate the floppy as usual.

  • When you are finished, EXIT OUT of the_/mnt/floppy_directory, and unmount the file system with:

umount /mnt/floppy

  • Note the proper command isu**mount, notun**mount. This cleanly unmounts the disk. DO NOT remove the disk OR SWAP the disk until it is unmounted.

  • If you get an error message that says the file system cannot be unmounted because it is busy, then you most likely have a file open from that directory, or are using that directory from another terminal. Check all you xterms and virtual terminals and make sure you are no longer in the mounted directory.

Example: Reading a CDROM

  • Insert the CDROM and type:

mount -t iso9660 /dev/cdrom /mnt/cdrom

  • Now change to the newly mounted file system:

cd /mnt/cdrom

  • You should now be able to navigate the CD as usual.

  • When you are finished, EXIT OUT of the_/mnt/cdrom_directory, and unmount the file system with:

umount /mnt/cdrom

If you want to see a list of file systems that are currently mounted, just use themountcommand without any arguments or parameters. It will list the mount point and file system type of each device on system, along with the mount options used (if any). This is actually read from a file called/proc/mounts, part of a virtual file system that keeps an up to date “snapshot” of the current system configuration. Try the following two commands:

mount**cat /proc/mounts**

The ability to mount and unmount file systems is an important skill in

Linux. There are a large number of options that can be used withmount(some we will cover later), and a number of ways the mounting can be done easily and automatically. Refer to themountinfo or man pages for more information.

results matching ""

    No results matching ""