automounting CD-ROMs USB drives
Hi,
I have debian base install(sarge). What is the best way to mount CD-ROMS/USB jump drivers automatically when the system starts? Does the answer lies in .bashrc or .bash_profile? Is there any tool(light weight) which does this job? What abt pmount? Again, I am not planning to have GNOME or KDE or any other Graphical Environemnt. I just have text base login console. Thanks |
Hats off to those who can live without the GUI. :bows:
|
The traditional way of automounting is just to edit /etc/fstab. Or you can use udev and autofs ... deb-admin article 126, and followup article 127.
|
Quote:
Code:
|
Code:
# /etc/fstab: static file system information. You need the "noauto" flag to stop the cd mounting at boottime (when there may not be media in it). My system is Ubuntu Dapper - but the base system should behave similarily to debian. I gave you a couple of links about how to automount using udev - and another about how to use autofs (which is what you want) for the same. Have you tried the suggestions there? |
Quote:
Yes, I can try the udev/autofs way but frist I would like to resolve the issue with /etc/fstab because that is the most basic/common methods for console based system. Again, I may be wrong in what I am saying. Your suggestions are most welcome. Thanks |
Quote:
I agree with Simon Bridge. You should set up autofs. It is truly what you want. |
Quote:
Ok I see what you guys are trying to say. so if I have line like this exits in my fstab file: Code:
/dev/hdc /media/cdrom0 udf,iso9660 user,noauto 0 0 mount /dev/cdrom in order to mount the CDROM? Right? In this entire thread when I say 'automatic mouting' I mean not giving the command: mount /dev/cdrom # TO mount the CDROM when we log into the system and still the CDROM drive gets mounted at /media/cdrom0. Also from the man pages: Quote:
Please help me in clearing all this confusion. Thank you once again. |
Quote:
The fstab entry by itself will not automount your disks. You need to configure udev and/or autofs as suggested. Please read the article on this and you'll see. Let me be pedantic for a moment: you do not mount devices. You mount file systems. Removable media devices usually do not contain file-systems unless there is media inserted into them. For this reason, it can be quite misleading to talk about "mounting a cdrom drive" or "mounting a cd rom". Though we usually know what we mean. Also, for this reason, it is inappropriate to attempt to mount fs on media unless we know it is present. (You could get erzats automounting by setting the mount -a command in cron for every few seconds... <shudder>) CD drives and USB media stuff inform the kernel when there is media inserted. We can poll for this message, or trap it, and so intellegently time a mount command to correspond to when media is inserted. (Floppy drives usually don't do this... so you won't find many distros automounting floppies.) The thing that handles this is autofs ... with usb devices, you want to be able to find the media at the same place each time (if a pendrive is /dev/sda then you want to always find it there). The thing that handles this is called udev. To exploit this, though, you need a 2.6 kernel or a very recent 2.4 kernel with autofs enabled. So I reiterate: this information is in the articles I supplied. Do read them all the way through before your next post. Thank you. |
Quote:
Note: I've made some changes. You can't mount CDs read/write, so you must include the "ro" option. You'll still be able to write CDs, because you don't have to mount a CD to write it. The "unhide" option helps when trying to read CDs burned by other OSes. You don't really need udf support. I've never had problems mounting DVDs as iso9660 filesystems. udf is only really used by movies, and mounting a movie DVD is pretty pointless most of the time. You don't have to mount a DVD to play it. The same goes for CDs. Quote:
|
Quote:
|
Quote:
|
It seems dapper is using udev entirely for automounting and autofs isn't even installed.
apt-get install autofs (installs fine) it is activate on reboot or by sudo /etc/init.d/autofs start but I have to set up the correct maps. sudo gedit /etc/auto.master ... uncomment the bits that seem right. /etc/auto.misc has an entry for floppy, so uncomment that and also the key=/misc line in auto.master ... nope, dosn't seem to do the trick. What did I miss? I'll have to go look in my other box running breezy - AFAIK: that is running autofs by default. I did find this: http://lists.debian.org/debian-user/.../msg00684.html ... but the represented auto.master file looks nothing like mine. Perhaps I need the floppy option in auto.master? |
I'll post my auto.misc here when I get home from work.
|
I have this line in my /etc/auto.master file:
Code:
/mnt/auto /etc/auto.misc Code:
floppy -fstype=auto,user,umask=000 :/dev/fd0 |
All times are GMT -5. The time now is 12:24 AM. |