• Skip to primary navigation
  • Skip to content
  • Skip to primary sidebar

The Geek Diary

HowTos | Basics | Concepts

  • Solaris
    • Solaris 11
    • SVM
    • ZFS
    • Zones
    • LDOMs
    • Hardware
  • Linux
    • CentOS/RHEL 7
    • RHCSA notes
    • SuSE Linux Enterprise
    • Linux Services
  • VCS
    • VxVM
  • Interview Questions
  • oracle
    • ASM
    • mysql
    • RAC
    • oracle 12c
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Hadoop
    • Hortonworks HDP
      • HDPCA
    • Cloudera
      • CCA 131

How to disable media automount in GNOME for CentOS/RHEL 5,6,7

By admin

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

For CentOS/RHEL 7

To disable it per user

1. Open dconf-editor and goto org > gnome > desktop > media-handling and uncheck automount and automount-open checkbox on right hand side pane.

2. 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

1. 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=false
automount-open=false

2. After creating the file, apply the changes using below command :

# dconf update

For CentOS/RHEL 6

To disable it per user

1. Open System -> Preferences -> File Management Preferences -> Media. Disable the automount option here.

2. 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

For CentOS/RHEL 5

To disable it per user

1. Open System->Preferences->Removeable Drives and Media Preferences. Disable the automount option here.

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
Note: The RHEL6 and RHEL5 specific commands only modify the settings for the current user on the console.

Filed Under: CentOS/RHEL 5, CentOS/RHEL 6, CentOS/RHEL 7, Fedora, Linux

Some more articles you might also be interested in …

  1. How to create virtual block device (loop device/filesystem) in Linux
  2. Why Does “netstat” Output Show Many Connections in CLOSE_WAIT Status?
  3. How to transfer files securely using sftp (examples included)
  4. CentOS / RHEL 7 : How to password protect GRUB2 menu entries
  5. How to disable auto deletion of the files in /tmp and /var/tmp directories in CentOS / RHEL 5,6
  6. How to install and configure Samba in CentOS / RHEL
  7. How to configure MariaDB database to use Active Directory for user authentication in CentOS/RHEL 7
  8. CentOS / RHEL : How to Recover from deleted /etc/passwd file
  9. Understanding /proc/meminfo file (Analyzing Memory utilization in Linux)
  10. How to create the chroot from Rescue Mode in CentOS/RHEL

You May Also Like

Primary Sidebar

Recent Posts

  • How to set the order to load certain modules in CentOS/RHEL 7 and 8
  • How to configure initrd / initramfs to including kernel modules in CentOS/RHEL
  • How to configure systemd.path to trigger an event when any changes made to a directory
  • Script to monitor RMAN Backup and Restore Operations
  • Oracle RMAN Backup Shell Script Example
  • Archives
  • Contact Us
  • Copyright

© 2019 · The Geek Diary