Mount USB to Custom Directory in Ubuntu
To mount a USB drive to a specific directory on the Ubuntu system, follow these steps:
- Firstly, insert the USB drive into the computer’s USB port, and the system will automatically detect and mount the USB drive to a default directory (usually located in the /media directory).
- Open the terminal (Ctrl + Alt + T) and use the following command to view the device name of the USB drive:
lsblk
Identify the device name corresponding to the USB drive in the output information, typically in a format like /dev/sdb1.
- Create a target mounting directory by using the following command to make a new directory:
sudo mkdir /mnt/myusb
- partition sdb1
- the directory /mnt/myusb
sudo mount /dev/sdb1 /mnt/myusb
Currently, the USB drive has been successfully mounted to the specified directory /mnt/myusb. To unmount the USB drive, you can use the following command:
sudo umount /dev/sdb1