[GRLUG] Looking for info/help for G4L...

Tim Schmidt timschmidt at gmail.com
Thu Mar 30 22:44:37 EST 2006


Here it is...  tested to work on my setup at least ;)

It comes in very handy when installing a distribution onto a loopback
device via QEMU (or working with a dd'd drive image).  I use it to
mount my loopback device, then copy the contents of the partition over
to another plain loopback device suitable to consumption by Xen.

--tim

#!/bin/sh
FILE=$1
PART=$2
DEST=$3
UNITS=`fdisk -lu $FILE 2>/dev/null | grep $FILE$PART | tr -s ' ' | cut
-f3 -d' '`
OFFSET=`expr 512 '*' $UNITS`
mount -o loop,offset=$OFFSET $FILE $DEST

On 3/30/06, Godwin <geektoyz at gmail.com> wrote:
> Post away Tim... :-)


More information about the grlug mailing list