How to Mount a USB Drive in Debian

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>


$ 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.

Sandclock 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, Sandclock 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

Install Docker on Raspberry Pi

Docker is a containerization system for Linux. It is used to run lightweight Linux containers on top of another Linux host...

How to Benchmark Hard Disks in Linux

Monitoring read and write speeds of storage devices is a good way to determine genuine products and determine disk health...

Top 5 Vulnerability Scanning Tools

The process of recognition, categorization and mitigation of vulnerabilities present in a network or application is called...
Bài Viết

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

Hướng dẫn chuyển đổi windows server windows evaluation to standard và active windows server 2008 + 2012 + 2016 + 2019

How to Update Ubuntu Linux

Squid Proxy Manager cài đặt và quản lý Proxy Squid tự động trên ubuntu

Hướng dẫn cài đặt Apache CloudStack

Hướng dẫn ký file PDF bằng chữ ký số (chữ ký điện tử) và sửa lỗi mới nhất 2021 foxit reader