As we discussed above, we can configure the USB drive so that it can be auto-mounted when plugged in if by default it is not automounted by two different methods. We will discuss both methods in detail in this post.
UUID (universal unique identifier) is used in Linux for the detection of the USB which is plugged in or for the identification of the partition used by the USB drive. Because of this we have to become a root user. We can be a root user by the following command, it will ask for a password so enter the password:
The command sign has changed from “$” to “#” which means now we are in the root user mode.
In order to find out the details of the USB devices attached to our system we will use the following command:
Now open the /etc/fstab file with the help of nano as:
Now add the following text to the editor. You can save this by using your own address, we are using here /mnt/usb, also enter your unique UUID which you can copy from the above command that is of “blkid”.
Now exit the editor by saving the file pressing CTRL+X then type “y” and press ENTER. Now finally run the following command by using the following command.
We can see it is showing that the device is already mounted because by default it is being mounted. If it isn’t mounted by default then it will be mounted by this command.
We can mount USB in another way too. Open the terminal and use the “update” command to update the repository.
Now we will also upgrade it so all the packages are upgraded as well.
Now we will create the directory by using the command “mkdir” so that the usb drive can be mounted there:
To find out the base name of the mounted USB drive we use the following command as we find out the name of our usb is /dev/sdb1:
Now if we have the format of usb drive FAT32 or FAT16 system we will use the following command:
And for the format of NTFS we will use the following:
As our USB drive is of the FAT32 system, we will use the mentioned command for it:
The usb drive is mounted successfully and we can access it and open its files. We go to the file and can check on the left side of the window the USB drive is present.
We can unmount the USB drive by using the umount command as:
The USB drive will be unmounted successfully.
A lot of alternate methods are there to complete any task, so if we are getting issues in mounting the USB drive on the laptop, there is no need to panic, we can still manually mount the USB drive. In this post the two methods are discussed through which we can mount the USB drive; one is using the UUID command whereas the other one is more convenient by just making the directory where the USB Drive is being mounted and by running the command according to the format of your USB drive. Using the umount command we also showed how to unmount the USB drive. This post will make you understand how to mount the USB drive on Ubuntu.
Debian and Ubuntu are two popular Linux distributions. In this deep dive we will guide…
In this article, we will see how to Install Google Cloud BigQuery Python client library…
Nov 15,2024 Wallpaper Contest for Xfce 4.20 open for voting The submission phase for the…
MicroCloud 2.1.0 LTS is now available, expanding the number of Canonical infrastructure solutions with a…
Canonical is thrilled to be joining forces with Dell Technologies at the upcoming Dell Technologies…
In today’s massive private mobile network (PMN) market, one of the most common approaches to…