auto mount CD on 11.4 server

Hello all,

on a “desktop” installation - if you place a CD in the tray - the OS will detect it and auto mount the CD.

is there a configuration / package that i can set up on our 11.4 server based install - that will do the same thing?

thank you,
mark

I doubt. Not because I know this execatly, but because of some logics.

The whole action of “automatic mounting” is invented for the benefit of the desktop end-user. I does only function when a desktop user is loged in (and not when desktop software is installed, but not used at that moment in time as you seem to suggest), and is also very uncertain when more desktop logins are active at the same time.

When there is no desktop login active (wether or not because it is not installed), the same questions are to be answered. For which of the CLI loged in users (if there is one) must the mount be done?

BTW, I guess, because udevd is running, you could program some udev rule(s) that may fit your need.

But I guess that most “server only” system managers will configure sudo in a way that those end-users that are allowed to mount, will be provided with a command (calling a small script) that does the things to be done as root.

On 2011-09-19 17:26, geeky2 wrote:
>
> Hello all,
>
> on a “desktop” installation - if you place a CD in the tray - the OS
> will detect it and auto mount the CD.

Not the OS; the desktop you use. Ie, KDE, Gnome…

> is there a configuration / package that i can set up on our 11.4 server
> based install - that will do the same thing?

What desktop are you using? Or is it text mode?


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

hello all,

ok - i believe i am closer to finding the answer - but still lacking something.

any help would be appreciated :wink:

after doing some hunting - i found this:

Suse 10.1 Automount Solution

i then added the autofs package to our 11.4 server and made sure that the autofs service was running.

i also added an auto.misc and an auto.master file in the /etc/ directory on my 11.4 server.

root@PrimexAMP etc > cat auto.misc

This is an automounter map and it has the following format

key -mount-options-separated-by-comma ] location

Details may be found in the autofs(5) manpage

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

the following entries are samples to pique your imagination

#linux -ro,soft,intr ftp.example.org:/pub/linux
#boot -fstype=ext2 :/dev/hda1
#floppy -fstype=auto :/dev/fd0
#floppy -fstype=ext2 :/dev/fd0
#e2floppy -fstype=ext2 :/dev/fd0
#jaz -fstype=ext2 :/dev/sdc1
#removable -fstype=ext2 :/dev/hdd

root@PrimexAMP etc > cat auto.master

Sample auto.master file

This is an automounter map and it has the following format

key -mount-options-separated-by-comma ] location

For details of the format look at autofs(5).

#/misc /etc/auto.misc

NOTE: mounts done from a hosts map will be mounted with the

“nosuid” and “nodev” options unless the “suid” and “dev”

options are explicitly given.

#/net -hosts

Include central master map if it can be found using

nsswitch sources.

Note that if there are entries for /net or /misc (as

above) in the included master map any keys that are the

same will not be seen as the first read key seen takes

precedence.

+auto.master

at this point …

i do here the CD drive “spin up” when i place the CD in the tray - but it does not look like the drive is being automounted.

any help would be greatly appreciated.

thank you,
mark

hello,

this question pertains to an 11.4 server installation with NO desktop. this is a minimal “jeOS” server install.

i understand that having a CD “auto-mount” on a server is contrary to normal protocol - but this is a request from our field customers who are “less than tech savvy” but DO have to access our servers, from time to time, and do installations from CD based media on the server.

i realize that issuing the mount command from the CLI is the quickest way to solve this issue - but this is a request directly from our field based support people.

thank you,
mark

  1. When you post copmputer texxt (as abov) please do so between ODE tags: Posting in Code Tags - A Guide

  2. When you want us more or less to help you to coniugure your automounter configuration, then I guess it would be helpfull if you told us exactly what you want to mount where (and the where does not only indicate a mount point, but also ownership).

hello,

i am sorry

i did not realize “how to ask” the question - or what question i really needed to ask :wink:

yes - i guess i do need help in configuring my automounter configuration for 11.4 server.

i would like the to:

  1. what - mount a CD drive that is part of the physical server
  2. where - the device is /dev/scd0
  3. mount it on /media
  4. who - would be root

does this make sense?

thank you,
mark

Yes, it makes sense.

For you to contemplate because (I may be wrong) I guess you may want it different:

  1. Mounting on* /media* is NOT what the desktop mounts do. The desktop mechanism mounts on* /media/<something>* where *<something> *is either the volume label of the file system or, when that is not available, a name like disk. To this a number may be added (disk-1) when more then one are to be mounted (or when devices are removed in an improper way). Thus, you may use /media (as you may use any directory), but it is diffferent from what the desktop mechanism does.
  2. As this is a read only device and as the normal access to /media is
drwxr-xr-x 2 root root 4096 19 sep 19:49 /media

which means that every user can read, the choice to leave the mountpoint owned by root is OK to me. I do not hope however that your choice of root means that the users you are making this for have root permission.

It is a long time ago that I configured automounter (and then only for NFS mounts) thus I have to do a little bit of reading. Maybe in the meantime somebody comes here and gives you a nice configuratin.

On 2011-09-19 18:16, geeky2 wrote:
> at this point …
>
> i do here the CD drive “spin up” when i place the CD in the tray - but
> it does not look like the drive is being automounted.
>
> any help would be greatly appreciated.
>

I don’t see an entry for the cdrom in the file you posted.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

Hm, a bit difficult without a system to test this.

I guess the contents of* /etc/auto.master *should be (save the original file somewhere):

/-    /etc/auto.media

and then you should create a file* /etc/auto.media* containing:

/media   -fstype=iso9660,ro,nosuid,nodev   :/dev/scd0

As the man page says that for direct maps (as I use them here) after every change in the files the deamon must be triggered with a HUP signal, you must do

kill -HUP automounter

(when automounter is the name of the deamon process, I am not sure, but you fill see that on your system).

Remind that the automount takes place when a user tries to access. That means

  1. insert the CD (and wait maybe a few moments until the hardware detects that);
  2. go to */media *by using e.g. the cd command or mentioning somewhere in the tree of the CD (ls /media/pictures).

It is all a bit guessing and I hope that it helps you (or that others correct me).

He posted the files as they are installed and did not adept them. If you Carlos are used to making automounter configs, can you please correct (or reject) my proposal?

On 2011-09-19 21:26, hcvv wrote:

> He posted the files as they are installed and did not adept them. If
> you Carlos are used to making automounter configs, can you please
> correct (or reject) my proposal?

No, I know that automounter is used for these cases, but I don’t use it
myself. But I’ll comment on one detail or two :slight_smile:

On 2011-09-19 21:26, hcvv wrote:

> and then you should create a file- /etc/auto.media- containing:
>
> Code:
> --------------------
> /media -fstype=iso9660,ro,nosuid,nodev :/dev/scd0
> --------------------

I would use “/mnt/cdrom” or “/media/cdrom”, or something of the sort.

> As the man page says that for direct maps (as I use them here) after
> every change in the files the deamon must be triggered with a HUP
> signal, you must do
>
> Code:
> --------------------
> kill -HUP automounter
> --------------------

Kill requires the PID number of the process. Giving the name you have to
use “killall” instead.

> It is all a bit guessing and I hope that it helps you (or that others
> correct me).

It will be interesting to know if it works :slight_smile:


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

Sorry about the kill eror. Yes, it must be the PID of the process.

I am as curious as you about this “solution”.

And I also suggested taking a different mount point, but I guess that when it does work basicaly, he can change the mount point after that (every other day if he wants so :wink: ).