[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] Quick image creation script (encapsulated documentation commands)


  • To: Jeff Blaine <jblaine@xxxxxxxxx>
  • From: Fernando Maior <fernando.souto.maior@xxxxxxxxx>
  • Date: Wed, 20 Apr 2005 18:48:27 -0300
  • Cc: xen-users@xxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 20 Apr 2005 21:48:17 +0000
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=WC9e9GQ7Y46RtioBNi5RXrAwo068d8hTnZ5/oQqvartTaRD930K1F1Y13W4zbOoGzmbj9iMuAYcws2P9se2fEgDjfBD8UzzjMRpkpEUjjdvT/36/BZUeIMmnBNDniWoid8/cgPXduqd/FOx6rRhp3y4H/msvUTw0CP9tXFbS/aM=
  • List-id: Xen user discussion <xen-users.lists.xensource.com>

Great, Jeff!

2005/4/20, Jeff Blaine <jblaine@xxxxxxxxx>:
> 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
> 


-- 
Bye,
Fernando Maior
LPIC/1 31908

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.