Disk
mount
Attach filesystems into the Linux directory tree.
filesystemmountdiskusbstorage
Additional Notes
mount attaches a filesystem to a directory called a mount point. Linux has one directory tree starting at /, and disks, partitions, USB drives, network shares, and virtual filesystems appear inside that tree when mounted.
Unmount with umount, not unmount.
Syntax
mount [options]
mount [options] DEVICE MOUNTPOINT
mount [options] -t TYPE DEVICE MOUNTPOINT
Parameters
DEVICE: Block device, partition, image, UUID, label, or remote share.MOUNTPOINT: Existing directory where the filesystem will appear.TYPE: Filesystem type such asext4,vfat,ntfs,nfs, ortmpfs.
Common Options
-t TYPE: Specify filesystem type.-o OPTIONS: Pass mount options.-a: Mount everything configured in/etc/fstab.-r: Mount read-only.-w: Mount read-write.--bind OLD NEW: Bind-mount one path at another path.
Examples
mount
Show currently mounted filesystems.
findmnt
Show mounts in a tree view. This is often easier to read.
sudo mount /dev/sdb1 /mnt/usb
Mount a partition at /mnt/usb.
sudo mount -t ext4 /dev/sdb1 /mnt/data
Mount with an explicit filesystem type.
sudo mount -o ro /dev/sdb1 /mnt/recovery
Mount read-only.
sudo mount --bind /var/www/site /srv/site
Make one existing directory appear at another path.
sudo umount /mnt/usb
Unmount a mounted filesystem.
Practical Notes
- The mount point directory must exist before mounting.
- Use
lsblk,blkid, andfindmntto identify devices and mount state. - Be careful mounting unknown filesystems read-write.
/etc/fstabcontrols many automatic mounts.- If unmount fails because a target is busy, check open files with
lsoforfuser.