In this article, we will discuss how to mount a USB drive in a Debian OS in case it is not detected by the system automatically.
We have used Debian 10 OS for describing the procedure mentioned in this article.
Mounting a USB drive
Step 1: Plug-in the USB drive to any of the available USB ports in your system.
Step 2: After plugging the drive, you will need to find out the USB device name and the file system type it is using. For that, open the Terminal application in your Debian OS and execute the following command as sudo:
When you execute the above command, you will get the output similar to below. you will find the USB device probably at the end of the output labeled as sdb, sdc or sdd, etc.. Note down the device name and the file system. In our case, it is sdb1 running a FAT32 file system.
Step 3: Now we will have to create a mount point directory where we want to mount our USB drive. To do so, use the following syntax in Terminal:
Step 4: Next, in this step, we will mount the USB drive to the mount point we created above. The syntax of command would be:
For instance, to mount our USB drive /dev/sdb1 to the mount point /media/USB/, we have used the following command:
Step 5: Use the following command to verify if the USB drive is mounted successfully.
For instance, in our case:
The above output shows our USB drive has been mounted. In case you receive no output, then it implies the device has not mounted.
Step 6: To access and browse the mounted device, use the cd command as follows:
Also, you can access and browse the USB drive through the Debian File manager program.
Unmounting a USB drive
Once you are done with using the mounted USB drive, you will need to unmount or detach it. But before going to unmount, make sure no other process is running on the drive, otherwise the drive will fail to detach and you will receive the error message.
To unmount the USB drive, type umount followed by the mount point directory or the device name as follows:
For instance, in our case it would be:
Now the USB drive will be detached from the system and you will no longer see the mounted drive in your File manager.
After that, you can remove the mount point directory too by using the following command:
That is all there is to it! In this article, we have learned how to mount a USB drive in our Debian OS and also learned to safely unmount it. I hope it will be helpful whenever you need to mount/unmount the USB drive in your system.