In this article, we will walk you through the process of disabling the automatic opening of the Nautilus file manager after auto-mounting USB drives. This feature, while useful for some, can be an annoyance to others who prefer to manually open their mounted USB drives.
To disable Nautilus auto-opening after auto-mounting USB drives, you can use the terminal command
gsettings set org.gnome.desktop.media-handling automount-open false. This will prevent Nautilus from automatically opening a window for mounted media. Alternatively, you can use the
dconf-editor tool or adjust the settings in the MATE desktop environment if you’re using Caja file manager.
What is Nautilus?
Nautilus is the default file manager for the GNOME desktop environment in many Linux distributions. It’s known for its simplicity and ease of use. One of its features is the automatic opening of a new window whenever a new USB drive is mounted. While this can be convenient, it can also be disruptive to your workflow if you frequently connect and disconnect USB drives.
Disabling Auto-Opening Using Terminal
The quickest and easiest way to disable this feature is by using the terminal. Here’s how to do it:
- Open a terminal. You can do this by pressing
- In the terminal, type the following command:
Let’s breakdown this command:
gsettings set org.gnome.desktop.media-handling automount-open false
gsettingsis a command-line interface to GSettings, which is a system for storing preferences of GNOME applications.
setis the command to change a setting.
org.gnome.desktop.media-handlingis the schema that contains the setting we want to change.
automount-openis the specific setting that controls whether Nautilus should automatically open a window for mounted media.
falseis the value we want to set, indicating that we do not want Nautilus to automatically open a window for mounted media.
Enterto execute the command.
After running this command, Nautilus should no longer automatically open a window when you mount a USB drive.
Disabling Auto-Opening Using dconf-editor
If you prefer a graphical interface, you can use the
dconf-editor tool to change this setting. Here’s how:
dconf-editorby running the following command in the terminal:
This command uses
sudo apt-get install dconf-tools
sudoto run the
apt-getcommand as the root user, which is necessary for installing software.
apt-getis the package management command-line tool in Ubuntu.
apt-getto install a package, and
dconf-toolsis the package we want to install.
dconf-editor. You can do this by typing
dconf-editorin the terminal or by searching for it in your applications.
dconf-editor, navigate to
org -> gnome -> desktop -> media-handling.
- Uncheck the
Disabling Auto-Opening in MATE Desktop Environment
If you’re using the MATE desktop environment, which uses the Caja file manager instead of Nautilus, you can disable the auto-opening feature with the following command:
gsettings set org.mate.media-handling automount-open false
Alternatively, you can open Caja File Management Preferences (
caja-file-management-properties), go to the Media tab, and uncheck the “Browse media when inserted” checkbox.
Whether you’re a fan of the terminal or prefer a graphical interface, disabling the auto-opening of Nautilus or Caja after auto-mounting a USB drive is a straightforward process. By following the steps in this guide, you can customize your file manager’s behavior to better suit your workflow.
Yes, you can re-enable the auto-opening of Nautilus by following the same steps and changing the value to "true" instead of "false".
No, disabling auto-opening only affects the Nautilus file manager in the GNOME desktop environment or the Caja file manager in the MATE desktop environment. Other file managers will not be affected.
No, disabling auto-opening will not affect the functionality of your USB drives. It only changes the behavior of the file manager when a USB drive is mounted.
Yes, you can still manually open your USB drives by double-clicking on their icons in the file manager or by using the file manager’s navigation menu.
No, you do not need administrative privileges to disable auto-opening. However, you will need administrative privileges if you choose to install the
dconf-editor tool using the
sudo apt-get install dconf-tools command.