Skip to content

mount Linux Command Guide

The Linux mount command is used to attach a filesystem to the system’s file hierarchy. It is essential for managing storage devices and network shares. With various options available, the mount command allows users to control how and where the filesystem is mounted. By using this command, users can access files and directories stored on different devices as if they were part of the local filesystem.

Terminal window
mount [options] device directory
OptionDescription
-aMount all filesystems mentioned in /etc/fstab
-tSpecify the filesystem type to be mounted
-oSpecify mount options
-rMount the filesystem read-only
-wMount the filesystem read-write
-nMount without writing to /etc/mtab (temporary mount)
ParameterDescription
deviceThe device to mount
directoryThe directory where the device is mounted
Terminal window
mount /dev/sdb1 /mnt/usb

Mounts the USB drive located at /dev/sdb1 to the /mnt/usb directory.

Terminal window
mount -t nfs 192.168.1.100:/shared /mnt/nfs

Mounts an NFS share from the server with IP address 192.168.1.100 to the /mnt/nfs directory.

Terminal window
mount -o loop ~/Downloads/ubuntu.iso /mnt/iso

Mounts the Ubuntu ISO file located in the home directory as a loop device to the /mnt/iso directory.

Terminal window
mount --bind /srv/data /mnt/data

Creates a bind mount of the /srv/data directory within the /mnt/data directory.

Terminal window
mount -t ecryptfs ~/encrypted ~/private

Mounts an encrypted file system located at ~/encrypted to the ~/private directory using ecryptfs.

Terminal window
mount -t vfat /dev/sdc1 /mnt/fat32

Mounts the FAT32 file system on /dev/sdc1 to the /mnt/fat32 directory.

Terminal window
mount -t cifs //server/share /mnt/windows -o username=user,password=pass

Mounts a Windows share from the server to the /mnt/windows directory with specified username and password.

To use the mount command in Linux, execute the following command:

Terminal window
mount --option <value>

How can I mount a specific device to a directory in Linux?

Section titled “How can I mount a specific device to a directory in Linux?”

To mount a specific device to a directory in Linux, use the following command:

Terminal window
mount /dev/sdb1 /mnt/data

How do I list all currently mounted filesystems in Linux?

Section titled “How do I list all currently mounted filesystems in Linux?”

To list all currently mounted filesystems in Linux, you can use the following command:

Terminal window
mount

How can I mount a network share in Linux using the mount command?

Section titled “How can I mount a network share in Linux using the mount command?”

To mount a network share in Linux using the mount command, you can use a command similar to this:

Terminal window
mount -t cifs //server/share /mnt/network -o username=user,password=pass

To unmount a filesystem in Linux, you can use the following command:

Terminal window
umount /mnt/data

How can I mount a filesystem with read-only permissions in Linux?

Section titled “How can I mount a filesystem with read-only permissions in Linux?”

To mount a filesystem with read-only permissions in Linux, use the following command:

Terminal window
mount -o ro /dev/sdc1 /mnt/readonly
  • Mounting a filesystem
  • Mounting a remote directory
  • Mounting a CD or DVD
  • Mounting a USB drive
  • Mounting a network share
  • Mounting a disk image