DVD-R not auto-mounted by Gnome

Bug #157775 reported by ingo
This bug report is a duplicate of:  Bug #218834: dvd or cd does not mount . Edit Remove
4
Affects Status Importance Assigned to Milestone
HAL
Fix Released
Unknown
hal (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: hal

This bug has already been evaluated at the tail of Bug #112584, please see also there.

Last action was:

strace -f -p <pid of the hald-addon-storage polling your drive device> -o /tmp/addon-storage.strace.txt
   - insert the cd
   - wait
   - ctrl+c
   - send the /tmp/addon-storage.strace.txt file

Which is attached here. Bug applies to both, Feisty and Gusty

Revision history for this message
ingo (ingo-steiner) wrote :
Revision history for this message
Yann Rouillard (yann-pleiades) wrote :

I am bit puzzled.
The hald-addon-storage seems to work correctly.

But you miss lines like that in the hal daemon debug output:

[12217]: 19:57:47.742 [D] addon-storage.c:670: **************************************************
[12217]: 19:57:47.742 [D] addon-storage.c:671: Doing addon-storage for /dev/scd0 (bus scsi) (drive_type cdrom) (udi /org/freedesktop/Hal/devices/storage_model_...)
[12217]: 19:57:47.742 [D] addon-storage.c:672: **************************************************
[12217]: 19:57:49.751 [I] addon-storage.c:346: Checking whether device /dev/scd0 is locked on HAL
[12217]: 19:57:49.764 [I] addon-storage.c:354: ... device /dev/scd0 is not locked on HAL

Could you try again to have hal debug output ?

Revision history for this message
ingo (ingo-steiner) wrote :

I did again. Now I waited until the drive (after 2 spin-up's) has spun down again. Her what I did in the xterm (as root):

root@pp:/home/ingo# ps -Af | grep hald-addon-storage
107 7447 7317 0 13:00 ? 00:00:00 hald-addon-storage: polling /dev/sdb (every 2 sec)
107 7474 7317 0 13:00 ? 00:00:00 hald-addon-storage: polling /dev/scd0 (every 2 sec)
107 7481 7317 0 13:00 ? 00:00:01 hald-addon-storage: polling /dev/scd1 (every 2 sec)
root 7968 7954 0 20:50 pts/0 00:00:00 grep hald-addon-storage
root@pp:/home/ingo# strace -f -p 7474 -o /tmp/addon-storage.strace.txt.2
Process 7474 attached - interrupt to quit
Process 7474 detached
root@pp:/home/ingo#

Revision history for this message
ingo (ingo-steiner) wrote :

This is just to prove that the DVD-R is working manually:

root@pp:/home/ingo# mount /dev/sr0 /media/cdrom0
mount: block device /dev/scd0 is write-protected, mounting read-only
root@pp:/home/ingo# ls -lR /media/cdrom0
/media/cdrom0:
insgesamt 14184
-r--r--r-- 1 root root 14521900 2007-02-17 17:47 NVIDIA-Linux-x86-1.0-9746-pkg1.run
dr-xr-xr-x 3 root root 88 2007-02-18 21:12 parallels-vm

/media/cdrom0/parallels-vm:
insgesamt 2
dr-xr-xr-x 2 root root 196 2007-02-18 21:12 oswarp4

/media/cdrom0/parallels-vm/oswarp4:
insgesamt 2850318
-r--r--r-- 1 root root 2918721536 2007-02-18 21:05 oswarp4.hdd
-r--r--r-- 1 root root 1411 2007-02-17 21:03 oswarp4.pvs
-r--r--r-- 1 root root 21 2007-02-17 21:04 serial1.txt
root@pp:/home/ingo#

Please note: I issued the mount command for /dev/sr0!

Revision history for this message
Yann Rouillard (yann-pleiades) wrote :

/dev/sr0 is probably a symlink to /dev/scd0 like on my computer:

$ ls -l /dev/sr0
lrwxrwxrwx 1 root root 4 2007-10-27 11:45 /dev/sr0 -> scd0

Revision history for this message
ingo (ingo-steiner) wrote :

here too:

lrwxrwxrwx 1 root root 4 2007-10-27 12:46 sr0 -> scd0

worth to mention that /dev/sr0 is a sATA-recorder?

Revision history for this message
Yann Rouillard (yann-pleiades) wrote : Re: [Bug 157775] Re: DVD-R not auto-mounted by Gnome

Concerning the debug to retry, I was talking about he hald daemon debug
log, the one you got
with:
sudo su -s /bin/sh haldaemon -c "hald --daemon=no --verbose=yes"
>/tmp/hal.debug.txt 2>&1

If hald-addon-storage is properly launched, you should get some lines
like these one:

[12217]: 19:57:47.742 [D] addon-storage.c:670:
**************************************************
[12217]: 19:57:47.742 [D] addon-storage.c:671: Doing addon-storage
for /dev/scd0 (bus scsi) (drive_type cdrom)
(udi /org/freedesktop/Hal/devices/storage_model_...)
[12217]: 19:57:47.742 [D] addon-storage.c:672:
**************************************************
[12217]: 19:57:49.751 [I] addon-storage.c:346: Checking whether
device /dev/scd0 is locked on HAL
[12217]: 19:57:49.764 [I] addon-storage.c:354: ... device /dev/scd0 is
not locked on HAL

I didn't see them in your hal.debug.txt file, I don't understand why
since hald-addon-storage seems to properly work.

So can you do it again to be sure ?

Revision history for this message
ingo (ingo-steiner) wrote :

So, I did repeat the test. Here the output in the root-xterm:

root@pp:/home/ingo# /etc/init.d/hal stop
 * Stopping Hardware abstraction layer hald [ OK ]
root@pp:/home/ingo# su -s /bin/sh haldaemon -c "hald --daemon=no --verbose=yes" >/tmp/hal.debug.txt.2 2>&1
             ++++++++ here I inserted the DVD +++++++++++
root@pp:/home/ingo# /etc/init.d/hal start
 * Starting Hardware abstraction layer hald [ OK ]
root@pp:/home/ingo#

During the command 'su -s /bin/sh haldaemon -c "hald............' I got a pop-up message telling me:
"Cannot mount volume.
You are not privileged to mount this volume."

Debug-output is attached here (all in Gusty)

Revision history for this message
Yann Rouillard (yann-pleiades) wrote :

I made have a mistake, you can launch hald as root, so can you do it again, I would like to understand why you don't have the hald-addon-storage debug messages:

eject the dvd if in the drive
stop hal
sudo hald --daemon=no --verbose=yes >/tmp/hal.debug.txt 2>&1
wait 10 seconds
ps -Af | grep hal
strace -f -p <pid of the hald-addon-storage polling your drive device> -o /tmp/addon-storage.strace.txt
insert the dvd
wait 10 seconds

stop the debug and send both output.

Revision history for this message
ingo (ingo-steiner) wrote :

Here the 2 debug files:

Again I got the pop-up
"Cannot mount volume.
You are not privileged to mount this volume."

Revision history for this message
ingo (ingo-steiner) wrote :
Revision history for this message
ingo (ingo-steiner) wrote :

Important observation:

after finishing the tests, I left the DVD-R in the drive/recorder.
Checked with '/etc/init.d/hal start'
and realized that hal was not running, so I issued:
'/etc/init.d/hal start'

hal starts - and the DVD-R is mounted by GNOME, Nautilus popps up with the content and the icon appeared on the desktop.

Good or bad news ?

Revision history for this message
ingo (ingo-steiner) wrote :

Correction:

after finishing the tests, I left the DVD-R in the drive/recorder.
Checked with ' ps -Af | grep hal'
and realized that hal was not running, so I issued:
'/etc/init.d/hal start'
....
It MOUNTS!

Revision history for this message
ingo (ingo-steiner) wrote :

Based on that I made further tests:

ejected the DVD
started hal
inserted the DVD - nothing happens, only drive spins up twice
stopped hal
started hal - DVD is mounted

I did repeat 3 times, this procedure works!

Revision history for this message
Yann Rouillard (yann-pleiades) wrote :

Your last hal log was more interesting, it seems the probe-volume takes too much time, see:

[8693]: 21:52:03.713 [E] probe-volume.c:351: Timed out probing /dev/scd0 - broken device driver?

There is a 10s timeout, on probe-volume.

If you are able to automount when starting hal, it's maybe because the timeout is longer for the coldplug detection at startup.

The probe-volume seems to be stucked in the volume_id_probe_all function, this function is also used by vol_id.

Could you do:
    vol_id /dev/scd0

Does it take a lot of time ?

Revision history for this message
ingo (ingo-steiner) wrote :

Further Info:

all the tests till now were done in my favorite recorder LG GSA-H30N
now I inserted the DVD in my 'second' drive sr1 = Samsung SH-S183H and it mounts automatically - withot tricks.
So probably a timing issue with hal in combination with my recorder?

(the LG however is my preferred device, especially regarding DVD-RAM)

Revision history for this message
ingo (ingo-steiner) wrote :

> Could you do:
    vol_id /dev/scd0

inserted the DVD in scd0, waited till it sun-up twice and settled again.

root@pp:/home/ingo# vol_id /dev/scd0
ID_FS_USAGE=filesystem
ID_FS_TYPE=udf
ID_FS_VERSION=
ID_FS_UUID=
ID_FS_UUID_ENC=
ID_FS_LABEL=OS2 in Parallels
ID_FS_LABEL_ENC=OS2\x20in\x20Parallels
ID_FS_LABEL_SAFE=OS2_in_Parallels

it responds after 5 seconds!

Revision history for this message
Yann Rouillard (yann-pleiades) wrote :

To test if the timeout is the problem, try to recompile hal with a greater timeout:

- apt-get source hal
- cd hal-0.5.9.1
- edit files hald/util.h and hald/util.h and change line:
  #define HAL_HELPER_TIMEOUT 10000
in
#define HAL_HELPER_TIMEOUT 60000
- then build the package
dpkg-buildpackage -rfakeroot -us -uc

install the hal package created

You might need to install additional packages to be able to compile hal.

Revision history for this message
ingo (ingo-steiner) wrote :

Puh, I finally succeded in compiling hal, but 2 questions remaining:

1. I only found 1 file 'hald/util.h' where I could edit the line '#define HAL_HELPER_TIMEOUT 10000'

2. after compiling I got a bunch of *.deb packets - which to install???

-rw-r--r-- 1 root root 347152 2007-10-29 16:32 hal_0.5.9.1-6ubuntu5_i386.deb
-rw-r--r-- 1 root root 59586 2007-10-29 16:31 hal-device-manager_0.5.9.1-6ubuntu5_all.deb
-rw-r--r-- 1 root root 593494 2007-10-29 16:31 hal-doc_0.5.9.1-6ubuntu5_all.deb
-rw-r--r-- 1 root root 369974 2007-10-29 16:32 libhal1_0.5.9.1-6ubuntu5_i386.deb
-rw-r--r-- 1 root root 23224 2007-10-29 16:32 libhal-dev_0.5.9.1-6ubuntu5_i386.deb
-rw-r--r-- 1 root root 16578 2007-10-29 16:32 libhal-storage1_0.5.9.1-6ubuntu5_i386.deb
-rw-r--r-- 1 root root 17710 2007-10-29 16:32 libhal-storage-dev_0.5.9.1-6ubuntu5_i386.deb

Please help - I am (not yet :-) so skilled with Ubuntu/Debian as you,
Ingo

Revision history for this message
Yann Rouillard (yann-pleiades) wrote :

copy/paste mistake.
You should have read:
- edit files hald/util.h and hald/hald_runner.h and change line:

so could you change the hald/hald_runner.h and rereun:
dpkg-buildpackage -rfakeroot -us -uc

install the 3 packages hal, libhal1 and libhal-storage1:
dpkg -i hal_0.5.9.1-6ubuntu5_i386.deb libhal1_0.5.9.1-6ubuntu5_i386.deb libhal-storage1_0.5.9.1-6ubuntu5_i386.deb

Revision history for this message
ingo (ingo-steiner) wrote :

Great - CONGRATULATIONS to YOU - it works!!!

DVD now is mounted correctly by hal, so it is just timing.
What I now have to do is just find out the optimum timeout (suppose it is in 1/10 of a second) for my hardware.
Will play a bit with that and let you know.

One more question me came up when editing hald/hald_runner.h:
the comment to that line states, this timeout is for sane. But with my Scanner I do not have any problems. So should I keep those 2 values in hald/hald_runner.h and hald/util.h always the same, or may I set the value in hald/hald_runner.h back to 10000 to keep the scanner-settings as original?

Before I forget: many thanks for having the patience with me as a newbie and for teaching me a lot of Debian/Ubuntu internals!
Ingo

Revision history for this message
ingo (ingo-steiner) wrote :

I have now narrowed down the values for my hardware conditions:

hald/util.h
#define HAL_HELPER_TIMEOUT 15000
is already sufficient to have the DVD automounted by hal in my LG-recorder

hald/hald_runner.h
#define HAL_HELPER_TIMEOUT 10000
Leaving it on that original value (only for sane?) still lets the DVD mount by hal without problems.
Do you expect any objections/possible incompatibilities with this splitting of timeouts?

Best regards,
Ingo

Revision history for this message
Yann Rouillard (yann-pleiades) wrote :

I don't know enough about hal to know if the timeout should be same.
A warning message during the compilation tells me it's not sure the second one is really used.

Anyway I opened a bug upstream so that bug can be fixed directly there.

Revision history for this message
ingo (ingo-steiner) wrote :

Many thanks for your help, I did learn a lot on varios things regarding Ubuntu!

I also checked with '12000' which does not automount, so I will stay with 15000.
Probably it is also worth to mention, that I only observed the effect with that very DVD-R in my sATA LG GSA-H30N recorder. I love that recorder, because the Samsung SH-S183H (where hal mounts the DVD with 10000) is very poor in error correction: it even sometimes is unable to read the DVD-R's it has written. So I use the SH-S183H only as a reader in case where the LG is busy/needed for other purposes.

Ingo

Changed in hal:
status: Unknown → Confirmed
Changed in hal:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.