Disable auto-mounting

I need to disable the auto-mount, and mount my USB dive manually.

I'm also struggling with how to find my USB drive after the auto-mounting has been disabled.


Solution 1:

To figure out which device you just connected, you will get some good hints from running dmesg.

Try:

dmesg | tail

And look for something like this:

[ 7445.572614] usb 2-1.2: new high-speed USB device number 4 using ehci_hcd
[ 7445.710242] Initializing USB Mass Storage driver...
[ 7445.710746] scsi6 : usb-storage 2-1.2:1.0
[ 7445.710971] usbcore: registered new interface driver usb-storage
[ 7445.710978] USB Mass Storage support registered.
[ 7446.707999] scsi 6:0:0:0: Direct-Access     Kingston DataTraveler 2.0 PMAP PQ: 0 ANSI: 0 CCS
[ 7446.708940] sd 6:0:0:0: Attached scsi generic sg2 type 0
[ 7448.482520] sd 6:0:0:0: [sdb] 2015232 512-byte logical blocks: (1.03 GB/984 MiB)

Notice the [sdb] on the last line I pasted. That means that this device can be found at /dev/sdb.

Check you devices by doing ls /dev/sdb* and you are likely to see something like:

$ ls /dev/sdb*
  /dev/sdb  /dev/sdb1

From there on you can go ahead with the exercise of mounting the partition sdb1to an empty directory. Skim through the start of man mount as a start.

Regarding disabling automount, take a look at: https://help.ubuntu.com/community/Mount/USB

Configuring Automounting

To enable or disable automount open a terminal and type dconf-editor followed by the [Enter] key.

Browse to org.gnome.desktop.media-handling.

The automount key controls whether to automatically mount media. If set to true, then Nautilus will automatically mount media such as user-visible hard disks and removable media on start-up and media insertion.

There is another key org.gnome.desktop.media-handling.automount-open. This controls whether to automatically open a folder for automounted media.

If set to true, then Nautilus will automatically open a folder when media is automounted. This only applies to media where no known x-content/* type was detected; for media where a known x-content type is detected, the user configurable action will be taken instead. This can be configured as shown below.