
* Michael Schierl schierlm-public@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-