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

Uninstall Ubuntu and Debian packages with apt-get and dpkg

We already saw how to create Debian packages, now we’ll see how to remove them. Removing packages in Debian or Ubuntu...
28/12/2020

Install LLVM on Ubuntu

Install LLVM 5 on Ubuntu 17.10 Artful Aardvark LLVM is a C/C++ compiler toolset just like GCC. LLVM can compile C, C++...
28/12/2020

Latest Debian Version and How To Download It

The latest stable version of Debian is Debian 9, codenamed Debian Stretch, released on June 17th, 2017.  This version...
28/12/2020
Bài Viết

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

Tìm Hiểu Về Thuê Proxy US – Lợi Ích và Cách Sử Dụng Hiệu Quả
11/12/2024

Mua Proxy V6 Nuôi Facebook Spam Hiệu Quả Tại Onetcomvn
03/06/2024

Hướng dẫn cách sử dụng ProxyDroid để duyệt web ẩn danh
03/06/2024

Mua proxy Onet uy tín tại Onet.com.vn
03/06/2024

Thuê mua IPv4 giá rẻ, tốc độ nhanh, uy tín #1
28/05/2024