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 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:
Disks Program
You have to click on the little icon with the two gears and choose 'Edit Mount Options'.
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
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 
or
sudo lshw | less
lshw
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
lsblk 2
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/external
You cannot unmount from the desktop by right-clicking the icon if the drive was manually mounted.

Comments

Popular posts from this blog

How to Install ‘IPFire’ Free Firewall Linux Distribution

Installing Moodle on a Debian-based LAMP server

Working with Columns on the Joomla Frontpage