Linux tip: Mount and Unmount commands and How to use it – tutorial
By Detector | 07 December 2008
The mount command instructs the operating system that the file system is ready to use, and associates it with a particular point in the system’s file system hierarchy (its mount point). The umount command instructs the operating system that the file system should be disassociated from its mount point, making it no longer accessible.
Both commands require root user privilege. Here is some examples how to mount or unmount linux devices:
Mount:
ReiserFS partition:
sudo mount /dev/$DEVICE $MOUNT_DIR -t reiserfs -o notail
where
- $DEVICE is the device to be mounted
- $MOUNT_DIR is the directory where you want the device to be mounted
To list the devices for the various partitions:
sudo fdisk -l
ext3 partition:
sudo mount /dev/$DEVICE $MOUNT_DIR -t ext3
NTFS partition:
sudo mount /dev/$DEVICE $MOUNT_DIR -t ntfs -o nls=utf8
FAT32 partition or USB drive:
sudo mount /dev/$DEVICE $MOUNT_DIR -t vfat -o iocharset=utf8
CD/DVD:
sudo mount /dev/$DEVICE $MOUNT_DIR -t iso9660 -o unhide,ro
ISO file:
sudo modprobe loop
sudo mount $ISO_FILE $MOUNT_DIR -t iso9660 -o loop,unhide,ro
Unmount:
sudo umount $MOUNT_DIR
Force unmount:
sudo umount -l $MOUNT_DIR