How to disable media automount in GNOME - Red Hat Customer Portal (2024)

Environment

  • Red Hat Enterprise Linux 9
  • Red Hat Enterprise Linux 8
  • Red Hat Enterprise Linux 7
  • Red Hat Enterprise Linux 6
  • Red Hat Enterprise Linux 5
  • GNOME

Issue

  • How can I disable the cd/dvd automount feature in GNOME?
  • How to disable automount of removable media in GNOME ?

Resolution

Media auto-mount can be disabled by using following methods.

RHEL 7, RHEL 8, RHEL 9

To disable it per user:

  • Open dconf-editor and goto org > gnome > desktop > media-handling and uncheck automount and automount-open checkbox on right hand side pane.
  • Alternatively, use the command below :

    # gsettings set org.gnome.desktop.media-handling automount false# gsettings set org.gnome.desktop.media-handling automount-open false # systemctl restart gdm.service

To disable it for all users :

  • Create a file /etc/dconf/db/local.d/00-media-automount with following content:

    # cat /etc/dconf/db/local.d/00-media-automount[org/gnome/desktop/media-handling]automount=falseautomount-open=false
  • After creating the file, apply the changes using below command :

    # dconf update

RHEL6

To disable it per user:

  • Open System->Preferences->File Management Preferences->Media .
  • Alternatively, use the command below:

    $ gconftool-2 --type bool --set /apps/nautilus/preferences/media_automount false$ gconftool-2 --type bool --set /apps/nautilus/preferences/media_automount_open false

To disable it for all users :

  • Run the command below:

    # gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory -s /apps/nautilus/preferences/media_automount -t bool false# gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory -s /apps/nautilus/preferences/media_automount_open -t bool false

RHEL5

To disable it per user:

  • Open System->Preferences->Removeable Drives and Media Preferences .
  • Alternatively, use the command below:

    $ gconftool-2 --type bool --set /desktop/gnome/volume_manager/automount_drives false$ gconftool-2 --type bool --set /desktop/gnome/volume_manager/automount_media false

Comment

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

How to disable media automount in GNOME - Red Hat Customer Portal (2024)

FAQs

How to disable media automount in GNOME - Red Hat Customer Portal? ›

To disable it per user:

How do I turn off automount in Linux? ›

Disable Automatic Mounting a Specific Drive in /etc/fstab. The /etc/fstab file contains relevant information for mounting and unmounting devices. If we add the noauto option in the /etc/fstab file for a specific device, the system won't automatically mount the device but we'll still be able to mount it manually.

How do I turn off automount in Fedora? ›

go to the path in /org/gnome/desktop/media-handling/automount and deactivate the option.

How to disable autofs? ›

Solution
  1. Run the following command to disable autofs :
  2. # systemctl --now disable autofs.
  3. OR. Run the following command to remove autofs.
  4. # apt purge autofs.
Jan 1, 2023

How do I disable automount in gnome? ›

To disable it per user:
  1. Open System->Preferences->Removeable Drives and Media Preferences .
  2. Alternatively, use the command below: $ gconftool-2 --type bool --set /desktop/gnome/volume_manager/automount_drives false $ gconftool-2 --type bool --set /desktop/gnome/volume_manager/automount_media false.
Feb 14, 2024

How do I change automount in Linux? ›

In the "Disk Drives" list select the hard drive you want to change the automount point. In the "More actions..." button select "Edit Mount Options..." Turn off the "Automatic Mount Options" In the "Mount Point" entry, write the new mount point you wish for the disk, for example /media/Data.

How to check if automount is disabled? ›

First, you can check if the automount feature is enabled or disabled currently. Press Win + R keys on the keyboard to open Run box. Then type diskpart in the box to open it. In the pop-up window, type automount and press Enter key to execute the command.

How do I disable removable media access? ›

All editions can use Option Two.
  1. Open the Local Group Policy Editor.
  2. Navigate to the key below in the left pane of the Local Group Policy Editor. ( ...
  3. In the right pane of Removable Storage Access in Local Group Policy Editor, double click/tap on the All Removable Storage classes: Deny all access policy to edit it. (
Jan 7, 2019

Why disable removable media? ›

Drives and disks can house threats and malware, any of which can devastate infrastructure. And, because removable media bypass security guardrails, such as firewalls and intrusion detection systems, malware can be easily transferred onto the network.

How do I turn off media automount in Ubuntu? ›

You can turn this functionality off entirely in your GUI. Within "Settings" > "Removable Drives and Media": uncheck all of the "removable storage" boxes. This should disable the feature entirely.

How does automount work in Linux? ›

automountd locates the file system information in a map, creates the trigger nodes, and performs the mount. Autofs allows the intercepted request to proceed. Autofs unmounts the file system after a period of inactivity.

How to disable automount raspbian? ›

Open the file manager (pcmanfm); go to the settings / preferences. In one of the tabs of this dialog you can disable all the automount stuff...

How do I check automount status? ›

Check if Automount is Currently Enabled or Disabled

1 Open an elevated command prompt. 3 Type automount into the elevated command prompt, and press Enter . 4 The command will now return with a Automatic mounting of new volumes enabled or disabled message to let you know the current status.

Why do we use AutoFS in Linux? ›

Purpose. The goal of autofs is to provide on-demand mounting and race free automatic unmounting of various other filesystems.

How do I disable automount on Windows 10? ›

Type in diskpart to open Microsoft DiskPart. Next, type in automount and Windows will respond by letting you know if automount is enabled or disabled. If you change your mind later, repeat the steps above and type in automount enable.

How to check automount status in Linux? ›

df -a -t autofs or mount -t autofs will show you mounted autofs points. The issue with the /etc/init. d/autofs status command is due to the now widespread use of systemd instead of init style (e.g. SysV) for initialization / PID 1 / user space bringup.

What is the automount command in Linux? ›

It is similar to the unmounting process also. But if we would need functionality to mount the file system automatically and no need to add the manual commands in it, then we need to use the “autofs” utility. In this utility, the file system will automatically mount when there is an access request.

What is automount in Linux? ›

The automount utility can mount and unmount NFS file systems automatically (on-demand mounting), therefore saving system resources. It can be used to mount other file systems including AFS, SMBFS, CIFS, and local file systems.

Top Articles
Latest Posts
Article information

Author: Dong Thiel

Last Updated:

Views: 6132

Rating: 4.9 / 5 (59 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Dong Thiel

Birthday: 2001-07-14

Address: 2865 Kasha Unions, West Corrinne, AK 05708-1071

Phone: +3512198379449

Job: Design Planner

Hobby: Graffiti, Foreign language learning, Gambling, Metalworking, Rowing, Sculling, Sewing

Introduction: My name is Dong Thiel, I am a brainy, happy, tasty, lively, splendid, talented, cooperative person who loves writing and wants to share my knowledge and understanding with you.