LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 02-16-2013, 09:42 AM   #1
Curiosity42
LQ Newbie
 
Registered: Jan 2013
Location: Earth
Posts: 20

Rep: Reputation: 0
Disable automount on RHEL 6.1


Always when a USB stick or CD/DVD-ROM is inserted in the PC, RHEL 6.1 automounts this hardware.
How can I permanently disable automount that only the root user can mount these devices manually?
 
Old 02-16-2013, 02:30 PM   #2
John VV
Guru
 
Registered: Aug 2005
Posts: 12,078

Rep: Reputation: 1574Reputation: 1574Reputation: 1574Reputation: 1574Reputation: 1574Reputation: 1574Reputation: 1574Reputation: 1574Reputation: 1574Reputation: 1574Reputation: 1574
edit /etc/fstab
add "noauto" and root only access

see
Code:
man mount
man fstab
also 6.1 is a bit out of date
RHEL 6.3 is current
you might want to upgrade soon

Code:
su -
yum --releaseserver=6.3 upgrade
 
Old 02-18-2013, 02:56 PM   #3
Curiosity42
LQ Newbie
 
Registered: Jan 2013
Location: Earth
Posts: 20

Original Poster
Rep: Reputation: 0
I have added to the /etc/fstab file the following lines:

Code:
/dev/sr0         /media          auto      ro,noauto,mount,exec    0 0
/dev/sdb1        /media          auto      rw,noauto,mount,exec    0 0
/dev/sr0 was always automounted to CDs/DVDs and /dev/sdb1 always to USB devices.
Now I have the problem that I cannot write to an USB stick in the root account even I specified rw in the fstab.
 
Old 02-18-2013, 09:00 PM   #4
John VV
Guru
 
Registered: Aug 2005
Posts: 12,078

Rep: Reputation: 1574Reputation: 1574Reputation: 1574Reputation: 1574Reputation: 1574Reputation: 1574Reputation: 1574Reputation: 1574Reputation: 1574Reputation: 1574Reputation: 1574
the /media part is a bit off

you can not mount directly in media .There needs to be a folder

" /dev/sr0 /media/CD.DVD.drive "
" /dev/sdb1 /media/USB.drive "

and make those two folders in /media "CD.DVD.drive" and "USB.drive" or whatever you want to call them
 
Old 02-19-2013, 12:26 PM   #5
Curiosity42
LQ Newbie
 
Registered: Jan 2013
Location: Earth
Posts: 20

Original Poster
Rep: Reputation: 0
@John VV Thanks for you help.

Just as reference for future questions about this problem.
To permanently disable the automount in RHEL 6.1 that only root can mount/umount USB or CD-ROM/DVD-ROM devices, I have done the following:

Code:
cd /media
mkdir dvdrom
mkdir usb

vim /etc/fstab (and added the following lines)

/dev/sr0         /media/dvdrom          auto      ro,noauto,mount,exec    0 0
/dev/sdb1        /media/usb             auto      rw,noauto,mount,exec    0 0

Last edited by Curiosity42; 02-19-2013 at 12:28 PM. Reason: Corrected.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RHEL 6 - Disable Gnome DVD Automount mijohnst Red Hat 1 11-18-2012 06:43 PM
Disable automount under xfce cccc Debian 2 03-09-2011 05:12 PM
Disable Automount FC4 fuzzyheadedfreak Linux - Newbie 1 12-18-2005 01:39 AM
How to disable automount in Mandrake 10.1 deathbyswiftwin Linux - Hardware 3 04-11-2005 02:54 AM
Disable automount zokik Linux - General 5 12-07-2003 06:59 AM


All times are GMT -5. The time now is 10:49 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration