WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

[Xen-users] Quick image creation script (encapsulated documentation comm

To: xen-users@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-users] Quick image creation script (encapsulated documentation commands)
From: Jeff Blaine <jblaine@xxxxxxxxx>
Date: Wed, 20 Apr 2005 16:38:55 -0400
Delivery-date: Wed, 20 Apr 2005 20:38:44 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)
I dount anyone will find this useful as they've already
likely dealt with this by now, but just in case...

I am using it for Xen evaluation work.  It's nothing
other than the commands from the docs, encapsulated in
a script with an argument.

#!/bin/sh
#
# Where do you store your VM disk image files?
VMROOT=/vm-images
#
VMPREFIX="vm-"
#
VMSUFFIX="-disk"
#
# Size of disk images in KB
SIZE=4096
#
#-----------------------------------------------------------------------

VMID=$1

Usage () {
        echo "Usage: $0 <unique-identifer>"
        exit 1
}

if [ "$VMID"x = "x" ]; then
        Usage
fi

IMAGENAME="${VMROOT}/${VMPREFIX}${VMID}${VMSUFFIX}"
if [ -f $IMAGENAME ]; then
        echo "ERROR: $IMAGENAME already exists."
        exit 1
fi

echo "Creating $IMAGENAME ..."
echo "++ dd if=/dev/zero of=$IMAGENAME bs=1k seek=${SIZE}k count=1"
dd if=/dev/zero of=$IMAGENAME bs=1k seek=${SIZE}k count=1

echo "echo y | mkfs -t ext3 $IMAGENAME"
echo y | mkfs -t ext3 $IMAGENAME

echo "++ mount -o loop $IMAGENAME /mnt"
mount -o loop $IMAGENAME /mnt

echo "++ cp -ax /{root,dev,var,etc,usr,bin,sbin,lib} /mnt"
cp -ax /{root,dev,var,etc,usr,bin,sbin,lib} /mnt

echo "++ mkdir /mnt/{proc,sys,home,tmp}"
mkdir /mnt/{proc,sys,home,tmp}

echo "++ umount /mnt"
umount /mnt


_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users

<Prev in Thread] Current Thread [Next in Thread>