Operating Systems

What is mount command?

The mount command is the Linux command that attaches a filesystem, such as a USB partition, ISO image or network share, to a directory (a mount point).

What is the mount command?

Linux has no drive letters. Everything sits in one directory tree that starts at /, and each storage device or share is attached to a folder in that tree, called a mount point. The mount command does the attaching, and umount (spelled without the first n) detaches it. Until a filesystem is mounted, its files cannot be read, even though the device shows up in hardware listings.

Basic use

  1. Find the device: lsblk lists disks and partitions with their mount points, and lsblk -f adds filesystem types and UUIDs. A USB stick often appears as something like /dev/sdb1.
  2. Create a mount point: sudo mkdir -p /mnt/usb
  3. Mount it: sudo mount /dev/sdb1 /mnt/usb
  4. Verify: df -h shows size and free space for each mounted filesystem, and findmnt shows mounts as a tree.
  5. Detach before unplugging: sudo umount /mnt/usb

Running mount with no arguments lists everything currently mounted. Desktop distributions usually mount removable media automatically under /media, but servers and exam scenarios often expect the manual steps.

Common options

ExamplePurpose
-t ext4, -t vfat, -t exfatStates the filesystem type when it is not detected automatically
-o roMounts read-only, useful when copying data off a failing disk
mount -o remount,rw /Makes the root filesystem writable again, for example in recovery mode
mount -o loop disk.iso /mnt/isoMounts an ISO image file as if it were a disc
mount -t cifs //server/share /mnt/shareMounts a Windows SMB share (needs the cifs-utils package)
mount -t nfs server:/export /mnt/nfsMounts an NFS export

Persistent mounts with /etc/fstab

Manual mounts disappear at reboot. Filesystems that should mount at every startup go in /etc/fstab, one per line with six fields: device (preferably UUID=, found with blkid), mount point, filesystem type, options, dump flag and fsck pass order. For example: UUID=<uuid> /data ext4 defaults 0 2. After editing, run sudo mount -a, which mounts everything listed that is not already mounted. If it prints an error, fix it before rebooting, because a bad entry for a required filesystem can drop the system into emergency mode at boot. The nofail option lets startup continue if a non-critical device, such as a USB backup drive, is missing.

Troubleshooting

  • "target is busy" on umount: a shell or program is still using the mount. cd out of it, close open files, and use lsof or fuser -m /mnt/usb to find the process.
  • "wrong fs type" or "unknown filesystem type": the type given is wrong, the filesystem support package is missing (common with exFAT or NTFS on minimal installs), or the partition is damaged.
  • Files "disappeared" from /home or /data: the mount probably failed and you are looking at the empty folder underneath. Check with findmnt or df -h.
  • A filesystem turned read-only by itself: Linux can remount a filesystem read-only after disk errors. Check dmesg or journalctl, then run fsck on the unmounted partition.
  • Permission denied: mounting normally needs root, so use sudo.

Comparisons

Windows gives volumes drive letters through Disk Management, can also mount a volume into an empty NTFS folder, and maps network shares with net use or File Explorer. macOS mounts volumes under /Volumes and shows them in Finder, and diskutil mount is its command-line tool. Do not confuse the mount command with physically mounting hardware, such as a drive in a bay or a TV on a wall bracket.

mount command on the CompTIA A+ exam

The mount command falls under Core 2 (220-1202) objective 1.9, Linux basics and everyday commands. Know that it attaches a filesystem to a mount point, that umount detaches it, that /etc/fstab makes mounts permanent, and that lsblk and df -h show what is attached. If a question asks how to reach a USB drive on a Linux server with no desktop, think mount. If a system stops booting right after someone edited /etc/fstab, think a bad fstab entry.

Studying for CompTIA (Operating Systems)?

ExamWizardz turns the official objectives into a guided study plan — with practice tests, realistic PBQs, and a readiness score. Start free.

Start studying free

Related terms