Software & AppsOperating SystemLinux

How To Disable Auto-Mounting and Manually Mount Your USB Drive in Ubuntu

Ubuntu 18

In this article, we will delve into the process of disabling auto-mounting and manually mounting your USB drive in Ubuntu. This is a useful skill to have, especially if you want to have more control over your system’s operations.

Quick Answer

To disable auto-mounting and manually mount your USB drive in Ubuntu, you can use the dconf Editor to disable auto-mounting and auto-opening of media. Then, you can manually mount your USB drive by identifying the device identifier, listing available partitions, creating a mount point, and finally, mounting the USB drive to the desired directory. Remember to safely unmount the USB drive before removing it from your system.

Auto-Mounting in Ubuntu

Auto-mounting is a feature in Ubuntu that automatically mounts your USB drive when you plug it into your system. While this is convenient, there might be instances where you would want to disable this feature.

Disabling Auto-Mounting

To disable auto-mounting, we will be using the dconf Editor. If you do not have it installed, you can do so by running the command sudo apt-get install dconf-editor.

  1. Launch the dconf Editor: Open a terminal and run the command dconf-editor. This will open the dconf Editor window.
  2. Navigate to the relevant settings: In the dconf Editor, navigate to org.gnome.desktop.media-handling.
  3. Disable auto-mounting: Locate the automount key and set it to false. This will disable the automatic mounting of media such as your USB drive.
  4. Disable auto-opening: If you also want to disable the automatic opening of a folder for automounted media, locate the automount-open key and set it to false.
  5. Close the dconf Editor: Once you have made the necessary changes, close the dconf Editor.

Manually Mounting Your USB Drive

Once you have disabled auto-mounting, you can manually mount your USB drive by following these steps:

  1. Connect your USB drive: Plug your USB drive into your computer.
  2. Identify your USB drive: Open a terminal and run the command dmesg | tail. This command displays the recent system messages. Look for a line that indicates the connection of your USB drive. It will look similar to [ 7445.572614] usb 2-1.2: new high-speed USB device number 4 using ehci_hcd.
  3. Note the device identifier: The device identifier is typically shown as [sdb] or similar. This indicates that the device can be found at /dev/sdb.
  4. List the available partitions: Run the command ls /dev/sdb* to see the available partitions on the USB drive. You should see something like /dev/sdb and /dev/sdb1.
  5. Create a mount point: Create an empty directory where you want to mount the USB drive. For example, sudo mkdir /mnt/usb.
  6. Mount the USB drive: Run the command sudo mount /dev/sdb1 /mnt/usb to mount the partition sdb1 to the directory /mnt/usb. Replace sdb1 with the appropriate partition identifier if needed.
  7. Access the USB drive: You can now access the contents of your USB drive by navigating to the mount point /mnt/usb.

Please note that the instructions provided here are for Ubuntu 14.04. The steps may vary slightly for different versions or distributions of Linux.

Conclusion

Disabling auto-mounting and manually mounting your USB drive in Ubuntu gives you more control over your system. It allows you to determine when and where your USB drive is mounted. This can be particularly useful in situations where you want to prevent automatic access to sensitive data or when you want to manage system resources more efficiently.

Remember to always safely unmount your USB drive before removing it from your system to prevent data loss. You can do this by using the umount command followed by the mount point, like so: sudo umount /mnt/usb.

By following the steps outlined in this article, you should now be able to disable auto-mounting and manually mount your USB drive in Ubuntu. Happy mounting!

How do I install the dconf Editor in Ubuntu?

To install the dconf Editor in Ubuntu, you can run the command sudo apt-get install dconf-editor in the terminal.

How do I open the dconf Editor?

To open the dconf Editor, you can run the command dconf-editor in the terminal.

How do I navigate to the relevant settings in the dconf Editor?

In the dconf Editor, you can navigate to the relevant settings by clicking on the folders in the left-hand sidebar. For this specific task, navigate to org.gnome.desktop.media-handling.

How do I disable auto-mounting in Ubuntu?

To disable auto-mounting in Ubuntu, you need to set the automount key under org.gnome.desktop.media-handling in the dconf Editor to false.

How do I disable auto-opening for automounted media?

To disable auto-opening for automounted media, you need to set the automount-open key under org.gnome.desktop.media-handling in the dconf Editor to false.

How do I identify my USB drive in Ubuntu?

You can identify your USB drive in Ubuntu by running the command dmesg | tail in the terminal. Look for a line that indicates the connection of your USB drive.

How do I list the available partitions on my USB drive?

To list the available partitions on your USB drive, you can run the command ls /dev/sdb* in the terminal. This will show you the available partitions, such as /dev/sdb and /dev/sdb1.

How do I create a mount point for my USB drive?

To create a mount point for your USB drive, you can run the command sudo mkdir /mnt/usb in the terminal. This will create an empty directory at /mnt/usb.

How do I mount my USB drive in Ubuntu?

To mount your USB drive in Ubuntu, you can run the command sudo mount /dev/sdb1 /mnt/usb in the terminal. Replace sdb1 with the appropriate partition identifier if needed.

How do I access the contents of my mounted USB drive?

Once your USB drive is mounted, you can access its contents by navigating to the mount point. In this case, you can access it by navigating to /mnt/usb.

Leave a Comment

Your email address will not be published. Required fields are marked *