3 # Mount a local .img qemi file on the local host via the new qemu-nbd
4 # The syntax specify the file, the mount point, and the partition
7 # sudo ./mini2440/qemu-local-img-mount.sh mini2440/emdebian_1GB.img /mnt/arm p2
9 # Mounting mini2440/emdebian_1GB.img - /dev/mapper/nbd1p2 to /mnt/arm
10 # /dev/mapper/nbd1p2 903024 225196 631848 27% /mnt/arm
13 # ./qemu-nbd -d /dev/nbd1
16 if [ ! -f $1 -o ! -d $2 ]; then
17 echo "$0 <image filename> <mount point> [pX]"
25 .
/qemu-nbd
-c /dev
/$nbd $1
28 if [ -b "/dev/mapper/${nbd}$3" ]; then
29 part
="/dev/mapper/${nbd}$3"
31 part
="/dev/mapper/${nbd}p1"
34 echo Mounting
$1 - $part to
$2
36 #ls -l /dev/mapper/${nbd}*