Although mounting a USB drive in the operating systems like Windows is easy, it’s not the same in the case of Rocky Linux 9. As a beginner, mounting a USB drive on Rocky Linux always becomes confusing. In this short tutorial, we will describe the complete steps to mount a USB drive on Rocky Linux 9.
How to Mount a USB Drive on Rocky Linux 9
It is simple to mount a USB drive. Connect the USB drive to your system and run the following command in the terminal:
The lsblk command lists the blocked devices such as flash drives, hard disks, optical media, USB drives, etc. Similarly, you can also use the -l option to get the output in the list format:
Usually, the lsblk command lists the connected USB drive in the /dev/sdc or /dev/sdb format. Moreover, you can also use the fdisk -l command to list the available disks and drives in a more detailed manner:
Once you see the connected USB drive that is listed in the previous output, it is time to create the mount point directory. For example, let’s create the new directory, USB in /mnt, through the mkdir command:
Now, you can mount the connected USB drive to the mount point directory through the following command:
Here, /dev/sdb represents the USB drive, and /mnt/USB represents the mount point directory. If you want to verify if the system has successfully mounted the USB, run the following command:
Finally, you can access the USB drive’s data through the cd command with the path of the mount directory:
How to Unmount a USB Drive
To unmount the USB drive on Rocky Linux 9, you only need to add the path of the mount directory with the umount command:
Conclusion
This is all about the ways that you can use to mount a USB drive on Rocky Linux 9. Moreover, we also included a simple command to unmount a USB drive quickly. Remember to always unmount the USB drive before you remove it from the system to avoid data loss.