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
- Find the device:
lsblklists disks and partitions with their mount points, andlsblk -fadds filesystem types and UUIDs. A USB stick often appears as something like/dev/sdb1. - Create a mount point:
sudo mkdir -p /mnt/usb - Mount it:
sudo mount /dev/sdb1 /mnt/usb - Verify:
df -hshows size and free space for each mounted filesystem, andfindmntshows mounts as a tree. - 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
| Example | Purpose |
|---|---|
-t ext4, -t vfat, -t exfat | States the filesystem type when it is not detected automatically |
-o ro | Mounts 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/iso | Mounts an ISO image file as if it were a disc |
mount -t cifs //server/share /mnt/share | Mounts a Windows SMB share (needs the cifs-utils package) |
mount -t nfs server:/export /mnt/nfs | Mounts 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.
cdout of it, close open files, and uselsoforfuser -m /mnt/usbto 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
findmntordf -h. - A filesystem turned read-only by itself: Linux can remount a filesystem read-only after disk errors. Check
dmesgorjournalctl, then runfsckon 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.