BTS

Issue748

Title Cannot remove CD after shutdown
Priority bug Status resolved
Superseder Nosy List mika, mru, schierlm
Assigned To Topics

Created on 2009-10-25.11:40:01 by schierlm, last changed 2009-10-26.14:49:35 by mru.

Messages
msg2588 (view) Author: mru Date: 2009-10-26.14:49:33
Patch is included in grml-etc 1.1.27. Forgot to add Closes: tag so resolving it
manually.
msg2586 (view) Author: mika Date: 2009-10-26.09:31:11
* Michael Schierl [20091025 22:00]:
> Ulrich Dangel schrieb:

> > Hm, ist es möglich das du folgenden Patch mal ausprobierst?

> Funktioniert besser, sprich auf meinem Laptop geht es mit dem Patch. In
> VirtualBox immer noch nicht. Wenn ich grml2ram mache geht's in beiden
> Fällen (sofort danach).

Ok fine.

> Mir ist auch aufgefallen, dass ich bei laufendem Grml (mit gelockter CD) mit

> eject -m /dev/sr0

> die CD zwar auf meinem echten System, nicht aber bei VirtualBox
> auswerfen kann.

Ah.

> Wenn ich mit perl ein IOCTL CDROM_LOCKDOOR (=0x5329), 0 auf /dev/sr0
> mache, kann ich auch bei VirtualBox die CD auswerfen.

Hm, something like:

  perl -e 'use Fcntl; sysopen my $f, "/dev/sr0", O_RDONLY|O_NONBLOCK or die "open $f", ioctl $f, 0x5329, 0 or die "ioctl $!"'

worked once but interestingly doesn't work reliable for me, though. :-/

> kA ob das ein VirtualBox-Bug ist bzw. ob das Auswerfen eines gelockten
> Laufwerks überhaupt spezifiziert ist :)

Good question :)

> Und auch kA warum das Laufwerk nach dem unmounten überhaupt noch gelockt
> ist...

me2 :-/ Might be related to aufs....

> >       DEVICE="${CDROM##/dev/}"
> > -     DEVICE="${DEVICE%%[0-9]*}"
> > +     [ -d /sys/block/${DEVICE} ] || DEVICE="${DEVICE%%[0-9]*}"

> >       if [ -n "$DEVICE" ] ; then
> >         # is it a removable device?

Ulrich: can you please apply and push this patch?

regards,
-mika-
msg2583 (view) Author: schierlm Date: 2009-10-25.21:00:32
Ulrich Dangel schrieb:

> Hm, ist es möglich das du folgenden Patch mal ausprobierst?

Funktioniert besser, sprich auf meinem Laptop geht es mit dem Patch. In
VirtualBox immer noch nicht. Wenn ich grml2ram mache geht's in beiden
Fällen (sofort danach).

Mir ist auch aufgefallen, dass ich bei laufendem Grml (mit gelockter CD) mit

eject -m /dev/sr0

die CD zwar auf meinem echten System, nicht aber bei VirtualBox
auswerfen kann.

Wenn ich mit perl ein IOCTL CDROM_LOCKDOOR (=0x5329), 0 auf /dev/sr0
mache, kann ich auch bei VirtualBox die CD auswerfen.

kA ob das ein VirtualBox-Bug ist bzw. ob das Auswerfen eines gelockten
Laufwerks überhaupt spezifiziert ist :)

Und auch kA warum das Laufwerk nach dem unmounten überhaupt noch gelockt
ist...

> diff --git a/etc/init.d/grml-reboot b/etc/init.d/grml-reboot
> index 7f14558..81ab23a 100755
> --- a/etc/init.d/grml-reboot
> +++ b/etc/init.d/grml-reboot
> @@ -49,7 +49,7 @@ if ! $INSTALLED ; then
>     DEVICE=""
>     if [ -n "$CDROM" ] ; then
>       DEVICE="${CDROM##/dev/}"
> -     DEVICE="${DEVICE%%[0-9]*}"
> +     [ -d /sys/block/${DEVICE} ] || DEVICE="${DEVICE%%[0-9]*}"
>  
>       if [ -n "$DEVICE" ] ; then
>         # is it a removable device?
>
msg2579 (view) Author: schierlm Date: 2009-10-25.11:39:59
Hi mika,


I tried it on some real hardware now, and it is 100% reproducible:

- Boot grml-medium_2009.10-rc1 from CD
- Enter "reboot" or "poweroff" at the root prompt
- Wait until it asks you to remove the CD
- The CD cannot be removed because the drive is locked
- In case of reboot, the CD can be removed shortly after the reboot, but
  in case of poweroff, there is no way to remove the CD besides from
  switching the machine on again after turning it off


Regards,


Michael
History
Date User Action Args
2009-10-26 14:49:35mrusetstatus: chatting -> resolved
nosy: mika, mru, schierlm
topic: - release-stopper
messages: + msg2588
2009-10-26 09:31:14mikasetnosy: mika, mru, schierlm
messages: + msg2586
2009-10-26 09:23:26mikasetnosy: + mru
2009-10-25 21:00:33schierlmsetstatus: unread -> chatting
messages: + msg2583
2009-10-25 11:42:30mikasetpriority: bug
topic: + release-stopper
2009-10-25 11:40:01schierlmcreate