From: Colin McCabe Date: Mon, 28 Dec 2009 23:18:10 +0000 (-0800) Subject: Add mount.qemu script to mount raw qemu images X-Git-Url: http://club.cc.cmu.edu/~cmccabe/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3bbe6bc6c317c37b4acf1e453b37bd0f0921dd8a;p=cmccabe-bin Add mount.qemu script to mount raw qemu images --- diff --git a/mount.qemu b/mount.qemu new file mode 100755 index 0000000..d3f3d0f --- /dev/null +++ b/mount.qemu @@ -0,0 +1,26 @@ +#!/bin/bash + +# check arguments +if [ $# -ne 2 ]; then + echo "usage: ${0} [image-file] [mount-point]" + exit 1 +fi + +image_file=${1} +if [ -f ${image_file} ]; then + : +else + echo "can't find regular file ${image_file}" + exit 1 +fi + +mount_point=${2} +if [ -d ${mount_point} ]; then + : +else + echo "can't find directory ${mount_point}" + exit 1 +fi + +# mount raw qemu device +mount -o loop,offset=32256 ${image_file} ${mount_point}