# Help: autofs 4.1.3-r2 won't automount local cdroms!

## Jimmy Jazz

Hello,

I'm using autofs in the same way as submount. You don't need to mount or unmount manually your cdrom. At least, that was true until the last stable release 3.1.7-r5. 

The configuration is rather simple.

Here are my config files

# cat /etc/conf.d/autofs

```

# Config file for /etc/init.d/autofs

localoptions=''

# additional options for automount, ie. timeout

daemonoptions='--timeout 1'

```

expressions are separated by tabulation ^I (you can see them under vi "^ESC :set list", followed by a "^ESC :se nolist"  to restore the initial view.

# cat /etc/autofs/auto.master

```

/media  /etc/autofs/auto.media

```

# cat /etc/autofs/auto.media

```

cdrw            -fstype=auto,ro,user    :/dev/cdroms/cdrom1

dvd             -fstype=auto,ro,user    :/dev/cdroms/cdrom0 

floppy          -fstype=auto,user       :/dev/fd0

```

Modify udev accordingly to your configuration and give the users access to the devices (hdb, hdd in my case are cdroms)

# cat /etc/udev/permissions.d/10-udev.permissions

```

hdb:root:cdrom:660

hdd:root:cdrom:660

floppy/*:root:floppy:660

```

modprobe autofs4

/etc/init.d/autofs start

So, you only need to access/leave the directory to mount/unmount your cdrom.

Of course, the directories have not to be create except /media.

But after merging autofs 4.1.3-r2, i cannot make it work anymore.

/etc/conf.d/autofs is a more complex file and really badly documented, like auto.xxx files

They are a lot of new options that i don't understand  :Sad: 

Has someone tried or perhaps succeed to automount dynamically cdrom devices in the same way i have with the new version ?

Any clues are welcome...

Thanks

Jj

----------

## DrWoland

I don't have any users set up yet (still using root for everything since im on a relatively fresh install), but my stuff works fine. 

Try this how-to

https://forums.gentoo.org/viewtopic.php?t=277721

----------

## Jimmy Jazz

@DrWoland,

thx above all for the link  :Smile: 

Perhaps, my problem stays in the fact i didn't use the nodev option. But after all, why were my configuration working fine until i emerged the last one ?

Another question without answer  :Wink: 

ps: are you using the  4.1.3-r2 version ?

Jj

----------

## Jimmy Jazz

Hello,

after following the howto given above, i always cannot make it work.

I have changed the auto.master and auto.media config with:

```

cat /etc/autofs/auto.master

/media  /etc/autofs/auto.media  --timeout=1

```

```

cat /etc/autofs/auto.media

cdrw            -fstype=auto,ro,nosuid,nodev    :/dev/cdroms/cdrom1

dvd             -fstype=auto,ro,nosuid,nodev    :/dev/cdroms/cdrom0

floppy          -fstype=auto,nosuid,nodev       :/dev/fd0

```

but without luck. It works with the old release but not with the last one.

Same problem if i use -fstype=iso9660.

I get the following message after upgrading to 4.1.3-r2 

```

$ cd /media/cdrw

-bash: cd: /media/cdrw: Aucun fichier ou répertoire de ce type

```

and the automount returns:

```

Jan 12 15:05:08 [automount] mount(generic): failed to mount dev/cdroms/cdrom1  (type iso9660) on /media/cdrw

Jan 12 15:05:08 [automount] failed to mount /media/cdrw 

Jan 12 15:05:08 [automount] >> mount: périphérique spécial  /dev/cdroms/cdrom1  n'existe pas

```

There really is an issue i didn't understand  :Sad: , mount returns that  /dev/cdroms/cdrom1 doesn't exist. 

Has someone encountered the same problem ?

Jj

----------

## Taladar

 *Quote:*   

> (still using root for everything since im on a relatively fresh install

 

You should add a normal user and only configure X and the other programs with user-specific config (except perhaps a text-editor and ssh) for this user. That way you are not tempted to use root for things it should not be used.

----------

## andyknownasabu

 *Jimmy Jazz wrote:*   

> Hello,
> 
> I'm using autofs in the same way as submount. You don't need to mount or unmount manually your cdrom. At least, that was true until the last stable release 3.1.7-r5. 

 

Did you ever think of using hal/dbus/ivman|gvm|kvm to deal with this (if you have a 2.6.xx kernel)?

Perhaps you will find it easier than aufofs... and AFAIK autofs is kind of deprecated/the combination of the three the future  :Wink: 

----------

## Jimmy Jazz

Hello andyknownasabu,

yes , i'm playing with the kernel version 2.6.10

I have read posts about hal/dbus/ivman but that seems to be a bit more difficult to configure than autofs, but after all  if you have some hints they are welcome  :Wink: 

About, gvm and kvm they need respectively gnome and kde. But i'm under xfce.

Thx,

Jj

----------

## andyknownasabu

 *Jimmy Jazz wrote:*   

> I have read posts about hal/dbus/ivman but that seems to be a bit more difficult to configure than autofs, but after all  if you have some hints they are welcome 
> 
> About, gvm and kvm they need respectively gnome and kde. But i'm under xfce.

 

Well, hal and dbus only have to be installed. No special configuration has to be done here. The only thing you have to configure is ivman (which you can use if you're using xfce - you don't need kvm/gvm, I don't use them either): Two or three lines in the corresponding config file AFAIK and as far as I read  :Wink: 

----------

## Jimmy Jazz

 *andyknownasabu wrote:*   

> 
> 
> Well, hal and dbus only have to be installed. No special configuration has to be done here. The only thing you have to configure is ivman (which you can use if you're using xfce - you don't need kvm/gvm, I don't use them either): Two or three lines in the corresponding config file AFAIK and as far as I read 

 

i will have a try...

@+

Jj

----------

## jsosic

https://bugs.gentoo.org/show_bug.cgi?id=77077

autofs-4.1.3-r2 (and r1 as I understood) had the same umount bug. I've noticed it today cause I was using 3.x till now, and this update gave me much of a haidache  :Sad: 

Try emerging autofs-4.1.3, it is said to be working, so...

You've got to umask it first in /etc/portage/package.keywords.

Also I will have to update my howto with this bug report...

----------

## el_compa

Hi,

I had the same problem, I fixed it by modifying /etc/conf.d/autofs. Here's my file:

```

# Config file for /etc/init.d/autofs

# e.g. localoptions='rsize=8192,wsize=8192'

localoptions=''

# additional options for automount, ie. timeout

daemonoptions=''

# NIS

nis_mapname='auto.master'

# LDAP

# By default autofs-ldap-auto-master will check the old style structure defined

# here, and if that fails, it will check the new style structure before

# failing. If this generates too much traffic for you, just change to use the

# new style here.

```

FWIW, here's my /etc/autofs/auto.master:

```

# $Id: auto.master,v 1.1 2000/08/08 17:53:33 achim Exp $

# Sample auto.master file

# Format of this file:

# mountpoint map options

# For details of the format look at autofs(8).

/var/autofs-usb /etc/autofs/auto.usbdrive       --timeout=2 --ghost

/var/autofs     /etc/autofs/auto.cdrom          --timeout=5 --ghost

```

and /etc/autofs/auto.cdrom

```

madd@xyu /etc/autofs $ cat /etc/autofs/auto.cdrom

cdrom    -fstype=iso9660,ro,sync,nodev,nosuid   :/dev/cdroms/cdrom0

```

I think the problem was in auto.master, with the LDAP entries. When I removed them everything was working again.   :Very Happy: 

BTW, I'm running autofs-4.1.3-r3.

Good luck!

----------

## Jimmy Jazz

 *el_compa wrote:*   

> Hi,
> 
> I had the same problem, I fixed it by modifying /etc/conf.d/autofs. Here's my file:
> 
> ```
> ...

 

thx el_compa,

i will follow your advice too. I had left autofs, ivman and co for rox because i get some trouble when i try to burn some cdroms  :Sad: .

Peraphs i will continue using it but only for the floppy device  :Wink: 

@+

Jj

----------

## Revellion

i gotta thank one of the posters here for just fixing my issue a bit, i searched and found this topic when i noticed my autofs did'nt umount my cdrom properly after the timeout, probably f*ed up after a emerge -u world someway back, but i used the ~x86'ed autofs (added it to /etc/portage/package.keywords)  so i got the r3 version and i must say.... Thanks!  :Wink: , it works splendid now  :Very Happy: 

----------

