[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-ia64-devel] A way to create Domain VTI image file.
Hi all, I will introduce a way about how to create a customed VTI disk image file here. The main idea is to create a file, which has 2 partitions (1 is for holding EFI startup contents, the other is for Linux file system.) Before creating the image file, you should have an IA64 Linux file system, include the EFI partition. The target Linux filesystem is at /mnt/guestos. Here It is RHEL4u2 IA64 OS. It has a cut filesystem to live in 1G space. How to Get it? You can install a RHEl4u2 firstly, then remove the extra packages from it. Or if don't want to delete any files, you have to create a larger disk image file (>5G). The following example will create an 1G image file. The 1st partition is 10M vfat partition. The 2st partition is ext3 partition. The host OS is RHEL4u2 IA64 on Montecito. 1. Create an empty 1G image file: #dd if=/dev/zero of=/new.img bs=1M count=1 seek=1023 (Create 2G: bs=1M count=1 seek=2047) 2. Make the partitions on it. #fdisk -b 512 -H 16 -S 32 -C 4096 new.img In fdisk program, enter each command sequentially with the screen info: n; p; 1; 1; +10M; n; p; 2; ; ; t; 1; ef; w; (';' is for an <ENTER>) (n is to create a new partition, t is to mark the partition type.) (disk_size =512*heads*sectors*cylinders 1G=512*16*32*4096) Use fdisk -l new.img you can see: Device Boot Start End Blocks Id System new1g.img1 1 39 9968 ef EFI (FAT-12/16/32) new1g.img2 40 4096 1038592 83 Linux 3. Setup loop device #losetup -o 16384 /dev/loop0 new.img #losetup -o 10223616 /dev/loop1 new.img (The 1st offset=sectors*512 16384=32*512) (The 2nd offset=heads*sectors*512*The_end_cylinders_of_partition1 102236=16*32*512*39) 4. Make file system. mkfs.vfat /dev/loop0 mkfs.ext3 /dev/loop1 5. Copy filesystems to partitions. #mkdir /mnt/p1 /mnt/p2 #mount /dev/loop0 /mnt/p1 #mount /dev/loop1 /mnt/p2 #cp -a /boot/efi/efi/ /mnt/p1/ #cp -a /mnt/guestos/* /mnt/p2/ #cat >/mnt/p1/startup.nsh <<EOF fs0: cd efi\redhat elilo linux root=/dev/hda2 EOF (startup.nsh is for auto run elilo.) (It need to double check /mnt/p1/efi/redhat/elilo.conf and /mnt/p2/etc/fstab to replace LABEL by /dev/hda2, remove the swap partitions and other incorrect partition info in VTI, such as /dev/sd*n) 6. Clean up #umount /mnt/p1 #umount /mnt/p2 #rm -rf /mnt/p1 /mnt/p2 #losetup -d /dev/loop0 #losetup -d /dev/loop1 Now your VTI disk image is ready for using. Is it difficult? Maybe my description is a little disorder. Need I provide any easy script to help creating? Best Regards, Yongkang (Kangkang) 永康 _______________________________________________ Xen-ia64-devel mailing list Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-ia64-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |