LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 04-05-2012, 02:53 PM   #1
Hammo
LQ Newbie
 
Registered: Feb 2003
Posts: 29

Rep: Reputation: 1
Angry autofs does not auto-mount cdrom


Hi all,

I am using CentOS 6 (kernel 2.6.32-71.el6.x86_64) on a virtual machine and trying to test out some basic automount functions, but autofs doesn't seem to be working even with the basic configuration.

-------------------
[root@RHEL01 ~]# service autofs status
automount (pid 1635) is running...
[root@RHEL01 ~]#

[root@RHEL01 ~]# cat /etc/auto.master | grep -v ^#
/misc /etc/auto.misc
/net -hosts
+auto.master

[root@RHEL01 ~]#
[root@RHEL01 ~]# cat /etc/auto.misc | grep -v ^#

cd -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom --timeout=5

[root@RHEL01 ~]#


---------------------

I have been trying to search the internet for any possible information, but did not come across anything related.

Also /var/log/messages do not show anything suspicious.

When I try to manuall mount the CD it DOES work:

[root@RHEL01 ~]# mount /dev/cdrom /media
mount: block device /dev/sr0 is write-protected, mounting read-only


I would appreciate if anyone could give me some idea on how to further debug this, or if you encountered it before, what was the solution.

Thanks
 
Old 04-05-2012, 04:12 PM   #2
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, Ubuntu, SLES, CentOS
Posts: 1,765

Rep: Reputation: 320Reputation: 320Reputation: 320Reputation: 320
@ Reply

Hi Hammo,

How are you trying to access the autofs mount? As I can see from the post the settings are at default. So basically your cd should be accessible via following path:

Code:
cd /misc/cd
and I would suggest you to increase timeout a bit.
 
Old 04-05-2012, 08:01 PM   #3
Hammo
LQ Newbie
 
Registered: Feb 2003
Posts: 29

Original Poster
Rep: Reputation: 1
I cd into the /misc/cd directory, yet it is empty:


[root@RHEL01 ~]# cd /misc/
[root@RHEL01 misc]# ll
total 0
[root@RHEL01 misc]# cd /misc/cd
-bash: cd: /misc/cd: No such file or directory
[root@RHEL01 misc]#


I set the timeout manually to --timeout=600 (although I think this is the default value anyways) still no luck :S
 
Old 04-05-2012, 08:08 PM   #4
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, Ubuntu, SLES, CentOS
Posts: 1,765

Rep: Reputation: 320Reputation: 320Reputation: 320Reputation: 320
@ Reply

Try this:

Restart autofs using the following command:

Code:
service autofs restart
Then try to get into /misc/cd . If you still get the same error then paste the output of the following command:

Code:
tail /var/log/messages
It will be good if you share the files /etc/auto.misc, /etc/auto.master and /etc/auto.net. I just want to make sure that these files are properly configured or not.
 
Old 04-05-2012, 08:54 PM   #5
Hammo
LQ Newbie
 
Registered: Feb 2003
Posts: 29

Original Poster
Rep: Reputation: 1
[root@RHEL01 /]# date
Fri Apr 6 03:46:31 EET 2012

[root@RHEL01 /]#
[root@RHEL01 /]#
[root@RHEL01 /]# cat /etc/auto.master | grep -v ^#
/misc /etc/auto.misc --timeout=600
/net -hosts
+auto.master

--------------------------------------------------

[root@RHEL01 /]# cat /etc/auto.misc | grep -v ^#

cd -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom --timeout=5

--------------------------------------------------


[root@RHEL01 /]# cat /etc/auto.net | grep -v ^#



key="$1"

opts="-fstype=nfs,hard,intr,nodev,nosuid"


for P in /bin /sbin /usr/bin /usr/sbin
do
for M in showmount kshowmount
do
if [ -x $P/$M ]
then
SMNT=$P/$M
break
fi
done
done

[ -x $SMNT ] || exit 1

SHOWMOUNT="$SMNT --no-headers -e $key"

$SHOWMOUNT | LC_ALL=C sort -k 1 | \
awk -v key="$key" -v opts="$opts" -- '
BEGIN { ORS=""; first=1 }
{ if (first) { print opts; first=0 }; print " \\\n\t" $1, key ":" $1 }
END { if (!first) print "\n"; else exit 1 }
' | sed 's/#/\\#/g'

--------------------------------------------------
[root@RHEL01 /]# service autofs stop
Stopping automount: [ OK ]
[root@RHEL01 /]# service autofs start
Starting automount: [ OK ]
--------------------------------------------------

[root@RHEL01 /]#
[root@RHEL01 /]# date
Fri Apr 6 03:48:56 EET 2012
[root@RHEL01 /]#
[root@RHEL01 /]# tail /var/log/messages
Apr 6 03:36:32 RHEL01 kernel: attempt to access beyond end of device
Apr 6 03:36:32 RHEL01 kernel: loop0: rw=0, want=3623889368, limit=8278597
Apr 6 03:37:44 RHEL01 kernel: attempt to access beyond end of device
Apr 6 03:37:44 RHEL01 kernel: loop0: rw=0, want=3623889368, limit=8278597
Apr 6 03:37:51 RHEL01 kernel: attempt to access beyond end of device
Apr 6 03:37:51 RHEL01 kernel: loop0: rw=0, want=3623889368, limit=8278597
Apr 6 03:41:48 RHEL01 kernel: attempt to access beyond end of device
Apr 6 03:41:48 RHEL01 kernel: loop0: rw=0, want=3623889368, limit=8278597
Apr 6 03:42:18 RHEL01 kernel: attempt to access beyond end of device
Apr 6 03:42:18 RHEL01 kernel: loop0: rw=0, want=3623889368, limit=8278597


--------------------------------------------------
--------------------------------------------------
--------------------------------------------------


Please not that these errors in the var/log/messages are not related to this (I was trying to mount an ISO file which didnt work as well, but this is another topic), you can see this from the timestamp and date command outputs
 
Old 04-05-2012, 09:37 PM   #6
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, Ubuntu, SLES, CentOS
Posts: 1,765

Rep: Reputation: 320Reputation: 320Reputation: 320Reputation: 320
@ Reply

Remove timeout option from both /etc/auto.master and /etc/auto.misc. You are confusing the system by setting up different timeouts on different files. You should not mention timeout in /etc/auto.misc on the first place.

Things to do:

1. Remove timeout switch.
2. Restart autofs
3. Run cd /misc/cd and if it fails then paste the output of tail /var/log/messages.

You posted the output without trying to get into cd /misc/cd
 
Old 04-05-2012, 09:51 PM   #7
Hammo
LQ Newbie
 
Registered: Feb 2003
Posts: 29

Original Poster
Rep: Reputation: 1
I removed the timeout from both files and it is working now Thanks!

The 5 sec timeout was recommended in some site so that /dev/cdrom gets unmounte shortly after the physical CD is removed. Still confused though why this should cause a problem.
 
Old 04-05-2012, 10:04 PM   #8
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, Ubuntu, SLES, CentOS
Posts: 1,765

Rep: Reputation: 320Reputation: 320Reputation: 320Reputation: 320
@ Reply

Glad that it worked.

If you want to mention timeout then just mention it in /etc/auto.master. Do not mention anywhere else and see if that works. If not, then remove it and we can take troubleshooting up from there.
 
Old 04-06-2012, 09:28 AM   #9
Hammo
LQ Newbie
 
Registered: Feb 2003
Posts: 29

Original Poster
Rep: Reputation: 1
I tried to change the timeout value in auto.master only to 3 seconds and /dec/cdrom gets unmounted correctly after that timeout.

However when I put the timeout setting in auto.misc it does not work at all, so it seems this option can't be specified in that file.


So I will create a different auto.* file for mounts that I want to set a longer timeout to and specify that timeout in auto.master.

Thanks a lot for your help.

Cheers!
 
1 members found this post helpful.
Old 12-28-2012, 04:08 AM   #10
mssm06
LQ Newbie
 
Registered: Dec 2012
Posts: 2

Rep: Reputation: Disabled
autofs not working

Hello,

I'm experiencing the same issue here. I got RHEL 6.2 installed. I've started the autofs service and checking if autofs is working with default settings in /etc/auto.mater and /etc/auto.misc. However, when I go into /misc directory there is nothing, it is empty. I'm testing to check if default mounting of cd works.

Whenever I mount CD/DVD, it gets mount automatically in /media directory. I can unmount and mount it back to any other directory. however, /misc directory doesn't contain cd sub-directory.

Thanks,
mssm
 
  


Reply

Tags
autofs, automount, cdrom


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Autofs auto.smb attempts to mount printer drivers sixerjman Linux - Networking 1 06-20-2006 07:50 PM
Autofs auto.smb attempts to mount printer drivers sixerjman Linux - Software 0 06-16-2006 07:31 PM
using autofs to auto mount my usb drives DesertWolf0132 Slackware 8 07-30-2004 10:27 AM
autofs enabled in kernel but auto.mount and auto.master are NOT in /etc! Alybyzrp Linux - General 0 11-11-2003 12:26 PM
auto mount cdrom demmylls Linux - General 1 10-04-2003 09:25 AM


All times are GMT -5. The time now is 10:22 AM.

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