Mounting an external hard-drive on Linux

I am using a fedora 32 bit machine for this exercise

First open up a terminal and type in

tail -f /var/log/messages

This will show you the activity about to take place.

Plop your hard drive into a dock and connect it (via USB in my case) to the computer.

You should see output similar to this in the logs.

drive

Notice the sdb stuff down at the bottom. Mounted devices are managed in /dev/ and /dev/sd* is usually used for mounting USB’s. 

Cool. Let’s try looking for files like /dev/sdb*

I do an ls /dev/sdb* and only get one file /dev/sdb

Makes since, because the hard drive I plugged in is formatted. It has no partitions. Partitions are specified as such.

/dev/sdb1 — first partition

/dev/sdb2 — second partition

etc etc.

Since I don’t have a partition on this drive, I will use

fdisk /dev/sdb

to make one. FOLLOW THE INSTRUCTIONS (press ‘m’ for the options).

After you’ve set that up, now it’s time to make a FILE SYSTEM on the partition.

Your new partition should appear under /dev/sdb1 (if you chose 1 as your partition).

Use this command to make a file system on the partition

mkfs -t ntfs /dev/sdb1 (or wherever your partition is)

CONGRATS, you now have an empty partition ready for use. Now, let’s mount the partition.

Simply

mount /dev/sdb1

Now do what ever you want with it! It’s all yours.
If you did not find this helpful, please ask me questions below.