[Grml] Unlocking CD drive

Michael Schierl schierlm at gmx.de
Mon Nov 13 21:06:01 CET 2006


Hi,

sometimes I booted grml, started a job there (like using dd to zero a
partition) and then have to leave (but let it try continuing the
zeroing). So I want to remove the CD (and risk a panic later when a file
from it is accessed). But that is no problem since I do not run anything
new after the CD is removed, so everything needed is already in cache.
For these cases I have a perl script on my USB pendrive:

#!/usr/bin/perl -w
open(H, "</dev/cdrom") or die("Can't open: $!");
ioctl(H, 0x5329 , 0) or die("Can't ioctl: $!");
close(H) or die("Can't close: $!");

That one works well - if I have my pendrive with me. My question: Is
there a way inside grml to do the same thing (without memorizing the
whole script or the ioctl number)? Something in /proc or /sys? Or a
script? (Using the hardware eject "hole" of the CD drive does not count,
since it requires a paper clip ;-) )

TIA,

Michael



More information about the Grml mailing list