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

[Xen-users] micro HOWTO build an HVM able image in one file



#
# create image file
#

        dd if=/dev/zero of=hd.img bs=8225280 count=64
        losetup /dev/loop0 hd.img

        fdisk /dev/loop0

             Device Boot      Start         End      Blocks   Id  System
        /dev/loop0p1   *          63     1028159      514048+  83  Linux

        # start sector = 63
        # end sector = 1028159
        # delta sectors = 1028159 - 63 + 1 = 1028097

#
# create filesystem inside image file
#

        dd if=/dev/zero of=fs.img bs=512 count=1028097

        mkfs.ext3 -F fs.img

        dd if=fs.img of=hd.img conv=notrunc bs=512 seek=63
        
        rm fs.img

#
# install data
#

        mount -o loop,offset=$((63*512)) hd.img /mnt

        debootstrap ...
        
        mkdir /mnt/boot/grub

        cp /usr/lib/grub/i386-pc/* /mnt/boot/grub/

#
# install bootloader (nach jonathan.mielikki.com)
#

        # be careful to use only unused hdX
        echo "(hd5) hd.img" > device.map

        grub --device-map=device.map

        grub> root (hd5,0)

        grub> setup (hd5)

        grub> quit

        Edit/configure /mnt/boot/grub/menu.lst...

#
# Finish
#

        umount /mnt
        losetup -d /dev/loop0


_______________________________________________
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®.