How to Attach Storage Drives Using the mount Command in Linux

Unlike Windows, which automatically assigns physical drives random letters (like C:\ or D:\) when you plug them in, Linux relies on a strictly unified, hierarchical directory tree. Everything on a Linux server originates from the root directory (/). When you install a new hard drive or plug in a USB thumb drive, it exists in the hardware layer, but it is entirely invisible to your software and users. To make the storage drive accessible, you must graft it into the unified directory tree using the mount command.

How the Mounting Process Works

Mounting is the process of linking a physical hardware block device (e.g., /dev/sdb1) to an empty folder (a directory) somewhere on your filesystem. This empty folder acts as a portal. Once the drive is mounted, any file you save inside that specific folder is physically written to the new hard drive.

By standard Linux convention, temporary drives (like USB sticks) are usually mounted inside the /mnt or /media directories.

How to Manually Mount a Drive

Assuming you have just plugged in a new USB drive, and the lsblk command confirms it is recognized by the kernel as partition /dev/sdb1, you must execute the process as the root user.

  1. Create the Mount Point (Portal): First, you must create the empty folder that will serve as the access point for the drive. Run:
    sudo mkdir /mnt/usb_backup
  2. Mount the Drive: Now, you use the mount command to link the hardware to the folder. The syntax is always mount [source hardware] [destination folder]. Run:
    sudo mount /dev/sdb1 /mnt/usb_backup

If the command is successful, the terminal will output absolutely nothing and return you to a blank prompt. You can now use the cd /mnt/usb_backup command to navigate into the folder and begin saving your files directly to the USB drive.

How to Safely Unmount a Drive

Because Linux aggressively caches files in RAM to improve performance, the system does not always write data to the physical USB drive immediately. If you physically yank the USB drive out of the port after copying a file, the cached data will be lost, and the file will be corrupted.

You must instruct the kernel to flush the cache and sever the link before you unplug the hardware. This is done using the umount (un-mount) command.

To safely detach the drive, simply point the command at your folder portal:

sudo umount /mnt/usb_backup

Once the prompt returns, the link is broken, and you can safely remove the hardware from the server.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.