[Grml] Unlocking CD drive

Michael Prokop mika at grml.org
Tue Dec 12 20:00:59 CET 2006


* Michael Schierl <schierlm-public at gmx.de> [20061210 20:15]:
> Michael Schierl wrote:

> > And losetup cannot "move" a loop-mounted file (while
> > mounted) either. And I don't know any other way how to archieve this.

> When digging through the Linux code, it seems that loopback devices
> support moving loop-mounted files around - it is just that I do not know
> any userspace tool that makes the LOOP_CHANGE_FD ioctl available to its
> users.

> But, doing something like

> -----
> #!/bin/sh
> cp /cdrom/GRML/GRML /tmp
> perl <<'EOF'
> open LOOP, '</dev/loop0' or die $!;
> open DEST, '</tmp/GRML' or die $!;
> ioctl(LOOP, 0x4C06, fileno(DEST)) or die $!
> close LOOP;
> close DEST;
> EOF
> umount /cdrom
> -----

> works fine, as long as you have enough RAM (tested in a virtual machine
> with grml-small 0.3).

> How about putting this (or similar) into a grml-toram script?

Wonderful idea!

I've added a script named grml2ram which is based on your script to
package grml-scripts:

  http://hg.grml.org/grml-scripts/rev/7f265425dec1e56bcf711c449bfbca7f54f7145a

thx && regards,
-mika-
-- 
 http://grml.org/            # Linux for texttool-users and sysadmins
 http://wiki.grml.org/       # share your knowledge
 http://grml.supersized.org/ # the grml development weblog
 #grml @ irc.freenode.org    # meet us on irc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.mur.at/pipermail/grml/attachments/20061212/623d00da/attachment-0002.pgp 


More information about the Grml mailing list