[arch-general] eject: unable to eject, last error: Inappropriate ioctl for device
Csomay Mihaly
list at csomay.hu
Thu Apr 9 03:18:19 EDT 2009
Hi,
I have a script which works fine on Ubuntu but fails on Arch:
--------------------------------------------------------
#! /bin/bash -eu
#
# Burn a DVD from the working directory
#
# Usage: burn <volume name>
#
# Creates an .iso file from the working directory in /tmp,
# writes the image to /dev/dvdrw, then checks the integrity
# of the disc.
#
# Prerequisites:
# An empty DVD in /dev/dvdrw
# The size of the working directory fits on a DVD
VOLNAME="$1"
TMPDIR=`mktemp -d` || exit 1
ISOFILE="$TMPDIR/$VOLNAME.iso"
GENLOG="$TMPDIR/genisoimage.log"
GROWLOG="$TMPDIR/growisofs.log"
BURNER="/dev/dvdrw"
echo "Image and logs in $TMPDIR"
echo -n "Creating image... "
genisoimage -udf -allow-limited-size -input-charset iso8859-2 -iso-level 4 -J -joliet-long -log-file "$GENLOG" -r -V "$VOLNAME" -v -o "$ISOFILE" . &> /dev/null
echo "Done."
echo -n "Burning image... "
growisofs -dvd-compat -speed=16 -Z "$BURNER"="$ISOFILE" &> "$GROWLOG"
echo "Done."
echo -n "Reloading media... "
eject "$BURNER"
eject -t "$BURNER"
echo "Done."
echo -n "Verifying image... "
EXTENTS=`egrep -e "^[0-9]+ extents written " "$GENLOG" | egrep -o -e "^[0-9]+"`
MD5ISO=`md5sum "$ISOFILE" | egrep -o -i -e "^[0-9a-f]{32}"`
MD5DVD=`dd if="$BURNER" bs=2048 count="$EXTENTS" 2> /dev/null | md5sum | egrep -o -i -e "^[0-9a-f]{32}"`
if [ "$MD5ISO" == "$MD5DVD" ]; then
echo "OK."
echo -n "Cleaning up... "
rm -r "$TMPDIR"
echo "Done."
else
echo "ERROR!"
fi
echo "ISO MD5: $MD5ISO"
echo "DVD MD5: $MD5DVD"
eject "$BURNER"
--------------------------------------------------------
When it reaches eject "$BURNER", it gives the error in the subject.
If after that I type in "eject /dev/dvdrw" in that terminal, it ejects fine.
After install I couldn't even eject by pressing the button
on the drive, but the patch in here fixed that:
http://bugs.archlinux.org/task/9537
I have xfce4.
Where should I look to fix this? Thanks.
csm
More information about the arch-general
mailing list