PDA

View Full Version : Automounting DVDs & CDs



ptackbar
3rd April 2006, 07:37 PM
I've searched the forums looking for posts about problems automounting CD & DVD drives. I found plenty, but not any that directly match my problem.

I recently upgraded from FC4 to FC5. Everything went as well as can be expected, but I've got this one lingering issue. When I insert a DVD or a CD, it is not automounted. I can, however, mount it manually (mount /dev/scd0 /media/cdrom).

HAL is running and there's no mention of my optical drive in fstab or mtab. I don't see any HAL errors in /var/log/messages either. I've set the gnome settings to automount the drive when a disc is inserted.

Does anyone have any idea what I can try to isolate the cause of the problem and try to fix it?

htinn
4th April 2006, 07:50 PM
EDIT: My method here is obsolete. Please use the HOWTO in this thread: http://forums.fedoraforum.org/showthread.php?t=103810

I didn't notice anyone else posting anything, so here's a script to work around this problem:

1) Select "Text Editor" in the Applications/Accessories menu
2) Copy/Paste the text in the code box below
3) Edit the "duhfines" as necessary for your system (what your CD device is, where to put the link point, etc.)
4) Press Ctrl+S and name the file "cd-link.sh"
5) Open the place where you saved that file from the Places menu
6) Right-click on it and select "Properties"
7) Click the "Permissions" tab and select the "Execute" checkboxes there
8) Double-click the file and select "Run" from the dialog
9) To verify that this script is running, use the System Monitor program (in the System/Administration menu) or insert a disc into your CD drive and check to see if the link point goes to the drive
10) To turn off this script, right-click on "cd-link.sh" in System Monitor and select "kill" or go to a terminal program and type killall cd-link.sh


#!/bin/sh
# cd linker script for Fedora Core 5
#
# wait for a cdrom to be inserted
# then create symbolic link to that point
#
# lame workaround for apps (like wine or gtktalog) that
# require fixed mount points
#
# *** warning ***
# -- this script runs forever --
#
# to stop this script, perform the following:
# killall cd-link.sh

# duhfines
DUHVICE=/dev/hdb # cdrom device (must be the actual dev)
DUHLNPT=/home/$USER/cd # link point
DUHWAIT=3.141592654 # sleep for Pi seconds

# main loop

for ((;;))
do
sleep $DUHWAIT

COUNT=`grep -c "$DUHVICE" /etc/mtab`
if [ $COUNT -ne 0 ]
then

# create a symbolic link to whatever was mounted

MNT_PT=`cat /etc/mtab | grep "$DUHVICE" | cut -d' ' -f2`
rm $DUHLNPT
ln -s $MNT_PT $DUHLNPT

# wait for the duhvice to be unmounted

while [ $COUNT -ne 0 ]
do
sleep $DUHWAIT
COUNT=`grep -c "$DUHVICE" /etc/mtab`
done
fi
done

d_GeNeRiT
5th April 2006, 05:04 PM
htinn,

Please be more specific on how to set up this script, where to put it ect.

A noob will not understand this. "chomd + x"

Krister Hallerg
5th April 2006, 05:10 PM
Had similar problems which disappeared after booting with a DVD disk in DVD device

htinn
5th April 2006, 07:15 PM
Okay, just fixed the instructions to be more n00b-friendly. :)

Krister Hallerg
6th April 2006, 06:13 AM
Where can I find those instructions?

htinn
6th April 2006, 05:54 PM
I put the instructions into the post itself (i.e. http://forums.fedoraforum.org/showpost.php?p=494902&postcount=2)

Krister Hallerg
6th April 2006, 06:58 PM
Are you saying that you can change a previous post??

htinn
7th April 2006, 05:56 PM
I can, and I did. :D (You're really letting me bump this thread a lot...)

jcliburn
8th April 2006, 07:14 PM
See this howto that adds a HAL rule to perform automatic mounting of optical media to a fixed mount point. http://forums.fedoraforum.org/showthread.php?t=103810