If you are looking to mount disks to your computer on the fly, you can use the following guide to help you, however if you are looking for a more longterm solution we would recommend making changes to your /etc/fstab file so that the drives mount automatically when booting up. We will cover this type of drive mounting in another guide.

You will notice that in this guide you will see eg. /dev/sdb and /dev/sdb1 – the /dev/sdb is the physical “whole” drive itself, and the /dev/sdb1 is the partition on the disk. The more partitions you have, the more numbers you will have.

Finding The Disk

First of all we need to make sure that the disk/USB drive is successfully connected to the machine, we can do this by running the command ‘fdisk’ to list all disks that are connected.

sudo fdisk -l

Your output should look something like this (obviously changing dependant on amount of drives and storage capacity):

As you can see this command will output a lot, we need to focus on the top lines of each section as highlighted in the above picture “Disk /dev/sdb: 1.8TB”. You can use this method to recognise which disk is in which motherboard connector.

Creating Our Mount Point

We are now going to create the mount point. Unlike Windows, we are able to mount our disks wherever we want making it a very flexible system. For demonstration purposes I am going to make a folder in my Home directory called ‘sdb-data’, however you can call this what ever you want.

mkdir ~/sdb-data

If you are using a pre-existing directory that you are mounting the disk too, make sure there are no contents inside that could be overwritten.

Mounting the Partition

Now we have our disk name, we want to mount the disk. As seen from the output of ‘fdisk -l’, the location of our unmounted partition is at /dev/sdb1. Use the following command to mount the partition to our previously created mount point.

sudo mount /dev/sdb1 /home/$USER/sdb-data

Now your partition or disk is mounted. Simply cd ~/sdb-data and your data will be there… or not if there is nothing on it!

Unmounting the Partition

Simply executing the following command and pointing it towards the mount point will safely unmount the partition from your system.

sudo umount /home/$USER/sdb-data

Feel free to Follow our WordPress site to get updates as soon as new posts come out, or come and join us in our Discord group! – [https://discord.gg/B3fBJ7H]

