Ubuntu - Mount or unmount USB Drive
Solution 1: Try the Disks program (if you run Ubuntu with a GUI).
(check that the gnome-disk-utility package is installed) (make sure that udisk2 package is installed)
Hit SUPERA to open the Application Lens and type
(SUPER is probably the key with the Windows icon.)
In Disks you can play with the automount options.
For example:

You have to click on the little icon with the two gears and choose 'Edit Mount Options'.

Solution 2: Using the CLI (for a headless installation)
Step 1. Check the blockdevices and the file systems that are assigned to those block devices.

Here you see the blokdevice sdb with partition /sdb1. But it's not mounted. There's no file assigned to it.
Step 2. What kind of device is sdb?

So the USB stick - the block device /sdb - has the logical name /dev/sdb. And the FAT32 filesystem on that stick has the logical name /dev/sdb1.
Step 3. Mounting the USB-stick
We will mount /dev/sdb1 to /media/usbstick
Step 4. Did it work?

Yes, we can see that the filesystem on the USB stick is mounted to /media/usbstick
(check that the gnome-disk-utility package is installed) (make sure that udisk2 package is installed)
Hit SUPERA to open the Application Lens and type
Disks
in the Search Applications field.(SUPER is probably the key with the Windows icon.)
In Disks you can play with the automount options.
For example:

You have to click on the little icon with the two gears and choose 'Edit Mount Options'.

Solution 2: Using the CLI (for a headless installation)
Step 1. Check the blockdevices and the file systems that are assigned to those block devices.
lsblk

Here you see the blokdevice sdb with partition /sdb1. But it's not mounted. There's no file assigned to it.
Step 2. What kind of device is sdb?
sudo lshw
orsudo lshw | less

So the USB stick - the block device /sdb - has the logical name /dev/sdb. And the FAT32 filesystem on that stick has the logical name /dev/sdb1.
Step 3. Mounting the USB-stick
We will mount /dev/sdb1 to /media/usbstick
sudo mkdir /media/usbstick
sudo mount -t vfat /dev/sdb1 /media/usbstick
Read the manpage of mount for other options.Step 4. Did it work?
lsblk

Yes, we can see that the filesystem on the USB stick is mounted to /media/usbstick
Unmounting the Drive
When you are
finished with the device, don't forget to unmount the drive before
disconnecting it. Assuming /dev/sdb1 is mounted at /media/external, you
can either unmount using the device or the mount point:
sudo umount /dev/sdb1
or:
sudo umount /media/externalYou cannot unmount from the desktop by right-clicking the icon if the drive was manually mounted.
Comments