Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am using Linux Fedora Core 4 (have to work with a legacy system) and trying to burn DVDs as a non-root user using the growisofs utility. I seem to be getting this error message at the end of the burn process every time: Error trying to open /dev/dvd exclusively ... retrying in 1 second.

The output is here:

 99.18% done, estimate finish Wed Jan 22 11:02:27 2014
 99.44% done, estimate finish Wed Jan 22 11:02:27 2014
 99.71% done, estimate finish Wed Jan 22 11:02:27 2014
 99.97% done, estimate finish Wed Jan 22 11:02:28 2014
Total translation table size: 973
Total rockridge attributes bytes: 663
Total directory bytes: 0
Path table size(bytes): 10
Max brk space used 0
1900572 extents written (3712 MB)
builtin_dd: 1900576*2KB out @ average 8.2x1385KBps
/dev/dvd: flushing cache
/dev/dvd: closing track
/dev/dvd: closing disc
Error trying to open /dev/dvd exclusively ... retrying in 1 second.
/dev/dvd: reloading tray

It seems like it completed the writing process, complains about not being able to open the device exclusively, then reloads the DVD drive's tray and things are fine after that. Furthermore, on examining the DVD, the burnt contents are there.

The burn command is run inside a bash script and I prefer it if the error message is not there as it is used by other people and can cause confusion. An excerpt of the script is here:

#
# Burn to DVD
#
growisofs -dvd-compat -Z /dev/dvd -r -f -J -T /BACKUPS/DVD_backups/*

if [[ $? != 0 ]]; then
  echo "Burn to DVD failed."
  exit 1
fi
echo "============================================="
echo "    DVD Burn Finished."
echo "============================================="
echo
echo

/dev/dvd is a soft link that points to /dev/scd0. An ls output of /dev/scd0 is:

brw-rw----  1 root disk 11, 0 Jan 22 09:47 /dev/scd0

The user I am running the bash script under is a member of the disk group.

Here is the content of the /etc/fstab file:

/dev/scd0               /media/cdrecorder       auto    pamconsole,exec,noauto,user,managed 0 0

I have tried lsof | grep /media/cdrecorder and fuser -a /media/cdrecorder but that does not show up with anything.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

That message is likely the desktop environment attempting to mount the newly detected DVD out from under the burning software. It's been ages since I've had a FC4 system around, so I can't really provide you specifics.

But I would look to disable the desktops ability to mount DVD automatically. There's probably something in Nautilus about this or under the System/Preferences pull-downs.

This article titled: "Disable GNOME Automounting" as well as this bug filed against Fedora, titled: "Bug 188590 - /usr/bin/cdrecord: Device or resource busy. Cannot open '/dev/hda'. Cannot open SCSI driver." might help shed more light on the issue too.

share|improve this answer
    
I tried disabling the GNOME Automounting, but that didn't help. I also tried disabling the autofs service and the error message is still coming up. –  Xolstice Jan 30 at 4:02
    
@Xolstice - sorry but it's such old software that I think you're out of luck. I remember lots of issues with FC1-6 with burning s/w via DVDs reliably, but since moving past those to F10+ I've had zero issues since, so unless you can move up, I'm not sure what else to suggest. –  slm Jan 30 at 4:19
    
@Xolstice - what about just trapping the error msg. in the output and returning your own $? status if it's anything other than that string? –  slm Jan 30 at 4:22
    
Hmmm ... It just seems messy that way and I get the feeling there are more things that will need to be taken into consideration when I actually implement it. If I leave the message there instead of hiding it, it will be noticed and possibly be resolved in the future instead of forgotten. –  Xolstice Jan 30 at 5:56
1  
Your second link about the bug pointed me to the right answer. It seems that the hald daemon uses the hald-addon-stor daemon which opens the device file at regular interval to check for new media on drives with removable storage. My guess is that it kicked in at the end of the burning process since the disc has just been written, and because the growisofs process itself has not released its lock on the device, HAL then complains that it can't open the device file exclusively. Solution was to modify the script to temporarily stop the HAL daemon service when the burning process is running. –  Xolstice Jan 31 at 4:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.