How to Mount a Hard Drive on Linux

Temporarily mount a hard disk

1. Find the Information of disk

1
fdisk -l

2. Get Device Name

like /dev/sdb or /dev/sdc

1
mount /dev/sdb /your_direcotory_name

Automatically mount devices at startup

Step 1: Find the UUID of the Device

1
blkid

This command will output something like:

1
/dev/sdb: UUID="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" TYPE="ext4"

Step 2: Create the Mount Point Diretory

1
mkdir -p /your_direcotory_name

Step 3: Edit \etc\fstab

1
nano /etc/fstab

Step 4: Add the Mount Entry

To add the mount entry, you can use the UUID or the device name(/dev/sdb)

1
UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx /your_directory_name ext4 defaults 0 0

Step 5: Test the Mounting

1
mount -a

If no errors occur, the mount should work properly.

Step 6: Reboot the System

1
reboot

How to Mount a Hard Drive on Linux
https://www.hardyhu.cn/2024/08/28/How-to-Mount-a-Hard-Drive-on-Linux/
Author
John Doe
Posted on
August 28, 2024
Licensed under