How to Mount and Unmount Filesystems with mount and umount
The mount command attaches a filesystem (like a USB stick or a second disk) to a directory, and umount detaches it. sudo mount /dev/sdb1 /mnt makes the drive available at /mnt. Both need root, so they are prefixed with sudo.
Find the device with lsblk
Before mounting, identify the drive. lsblk lists disks and partitions with their device names like sdb1.
Mount a device
Create a mount point directory, then mount the device to it. Everything under that directory is now the drive's contents.
See what is mounted
Run mount with no arguments to list everything attached, or check free space per filesystem with df -h, which shows the mount point for each disk.
Unmount safely with umount
Always unmount before unplugging a USB drive, or writes may be lost. Use the mount point or the device:
Handle the busy error
If umount says the target is busy, a process is using a file on the drive. Close it or use fuser -vm /mnt/usb to see who. See mount and umount for the full references.
Keep learning
Related guides: How to Check Disk Usage with df and du · How to Run Commands as Root with sudo · How to Create and Remove Directories with mkdir and rmdir. Read all tutorials on the Learn Linux blog.