mount Linux Command
Mounts a filesystem (attaches a device to the directory tree).
What does mount do?
Mounts a filesystem (attaches a device to the directory tree).
Syntax
mount [options] device mount_pointPractical example
sudo mount /dev/sdb1 /mnt/usbQuestions about mount
How do I mount a USB drive?
Use `sudo mount /dev/sdb1 /mnt/usb` to mount a USB drive. First create the mount point with `sudo mkdir -p /mnt/usb`.
How do I see all mounted filesystems?
Use `mount` or `mount | column -t` to see all currently mounted filesystems with their mount points.
How do I mount an ISO file?
Use `sudo mount -o loop file.iso /mnt/iso` to mount an ISO image as a loopback device.
How do I mount with read-only access?
Use `sudo mount -o ro /dev/sdb1 /mnt/usb` to mount with read-only permissions.
How do I unmount a filesystem?
Use `sudo umount /mnt/usb` or `sudo umount /dev/sdb1` to unmount a filesystem.
What is /etc/fstab?
fstab is the filesystem table file that defines which filesystems are mounted at boot. Edit it to auto-mount drives.
How do I mount all filesystems in fstab?
Use `sudo mount -a` to mount all filesystems defined in /etc/fstab that are not already mounted.
How do I mount a NFS share?
Use `sudo mount -t nfs server:/share /mnt/nfs` to mount a Network File System share.
Related Disk Commands
fdiskManipulates disk partition table (create, delete, resize partitions).
umountUnmounts a filesystem (detaches a mounted device from the directory tree).
duEstimates file and directory space usage (disk usage).
mkfsCreates a filesystem (formats) on a disk partition.
dfReports disk space usage for all mounted filesystems (human-readable with -h).
fsckChecks and optionally repairs a filesystem for errors.