The Invisible Hard Drive
In Windows or macOS, when you plug a USB drive into the computer, it instantly pops up on your screen as a new icon (like “Drive D:” or “My Passport”). You can immediately double-click it and browse the files.
Linux servers do not do this. If you plug a massive 10TB backup array into a Linux server, the operating system registers the physical hardware, but it makes the data completely invisible. Linux requires you to explicitly “attach” the physical hardware to a specific, blank folder on your existing hard drive before you can read the files.
This attachment process is called “mounting,” and it is controlled by two essential terminal commands: mount and umount (Unmount).
1. Identifying the Physical Drive
Before you can mount a drive, you need to know what Linux named the physical hardware. The best command for this is lsblk (List Block Devices).
lsblk
This outputs a tree-like structure. Your main hard drive is usually sda. If you just plugged in a new USB drive, it will likely appear at the bottom as sdb, and its primary formatted partition will be called sdb1.
The absolute hardware path to that partition is /dev/sdb1.
2. Creating the Mount Point
As mentioned, you cannot just open /dev/sdb1. You have to create an empty folder somewhere on your main drive to act as a “window” into the new hardware.
Administrators traditionally create these empty folders inside the /mnt or /media directories.
sudo mkdir -p /mnt/usb_backup
3. Executing the Mount Command
Now, you use the mount command to bridge the physical hardware to the empty folder.
sudo mount /dev/sdb1 /mnt/usb_backup
That’s it. The command outputs nothing if successful. If you now navigate into the /mnt/usb_backup folder and type ls, you will suddenly see all the files that are physically stored on the USB drive.
4. Making Mounts Permanent (fstab)
If you reboot the Linux server right now, the mount connection is destroyed. The hardware remains, but the folder becomes empty again.
If you just installed a permanent second hard drive for database storage, you must configure Linux to auto-mount it every time the server boots. You do this by editing the File System Table (/etc/fstab).
sudo nano /etc/fstab
You carefully add a new line to the bottom of this file detailing the hardware, the mount point, the format type, and the permissions. (Warning: A typo in the fstab file can cause a Linux server to completely fail to boot).
/dev/sdb1 /mnt/database_storage ext4 defaults 0 2
5. Safe Removal (The umount Command)
If you physically yank a USB drive out of a Linux server while it is mounted, you will likely corrupt the data because the operating system might be holding files open in memory.
You must safely detach the folder from the hardware before unplugging the cable using the umount command. (Note: There is no ‘n’ in the command name).
sudo umount /mnt/usb_backup
If the terminal returns a “Target is busy” error, it means you or another user are currently inside that folder, or a background program is actively reading a file. You must stop the program or change directories before you can unmount the drive.
Conclusion
The concept of manually mounting file systems is often jarring to new Linux users. However, by mastering lsblk, mount, and the fstab file, administrators gain absolute, granular control over exactly how, where, and when storage is accessed by the operating system.