How to Mount a USB Drive in Debian

29/12/2020
Chưa phân loại
Most Linux distributions are configured to automatically mount USB devices as soon as they are inserted into the USB ports. The system itself mounts the USB drives to a directory under /media folder and you can access them using your File Manager. However, in some cases, you are still required to mount the USB drives manually in order to access them.

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:

$ sudo fdisk –l

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:

$ sudo mkdir /media/<mountpoint_name>

For instance,

$ sudo mkdir /media/USB

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:

$ sudo mount <device_name> <mountpoint_directory>

For instance, to mount our USB drive /dev/sdb1 to the mount point /media/USB/, we have used the following command:

$ sudo mount /dev/sdb1 /media/USB/

Step 5: Use the following command to verify if the USB drive is mounted successfully.

$ mount | grep device_name

For instance, in our case:

$ mount | grep sdb1

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:

$ cd /media/USB/

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:

$ sudo umount <mountpoint_directory>

Or

$ sudo umount <device_name>

For instance, in our case it would be:

$ sudo umount /media/USB

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:

$ sudo rmdir <mountpoint_directory>

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.

ONET IDC thành lập vào năm 2012, là công ty chuyên nghiệp tại Việt Nam trong lĩnh vực cung cấp dịch vụ Hosting, VPS, máy chủ vật lý, dịch vụ Firewall Anti DDoS, SSL… Với 10 năm xây dựng và phát triển, ứng dụng nhiều công nghệ hiện đại, ONET IDC đã giúp hàng ngàn khách hàng tin tưởng lựa chọn, mang lại sự ổn định tuyệt đối cho website của khách hàng để thúc đẩy việc kinh doanh đạt được hiệu quả và thành công.
Bài viết liên quan

How to Update the Pacman Databases on Arch Linux

Every Linux distribution has a package repository where precompiled packages are kept. Of course you can download and install...
28/12/2020

Install Gnome Boxes on Ubuntu

GNOME boxes is an alternative to virtual box and VM Player to install and run multiple local or remote virtual machines...
28/12/2020

Linux chown command examples

Every file and folders are associated with particular users and groups in Linux for security. The permission for every...
29/12/2020
Bài Viết

Bài Viết Mới Cập Nhật

mua Proxy riêng ở đâu, và nó đem lại lợi ích gì cho người sử dụng
22/11/2022

Hướng dẫn sử dụng Proxy Helper Fakeip khi thuê proxy
21/11/2022

PROXY NUÔI TÀI KHOẢN FACEBOOK – KINH NGHIỆM FAKE IP – THUÊ PROXY GIÁ RẺ
14/11/2022

Mua Proxy Nuôi Zalo Giá Rẻ Tại Onet.com.vn
14/11/2022

BẢNG GIÁ MUA PROXY VIỆT NAM và PROXY US Onet.com.vn
14/11/2022