[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-users] Mounting Xen LVM Guests
Fajar A. Nugraha wrote: Okay. From your post, I gather that /dev/xen-system/test01.max is LV on dom0 used for domU's disk. I don't see you using kpartx. If fdisk -l says # Device Boot Start End Blocks Id System #test01.max1 * 63 208844 104391 83 Linux #test01.max2 208845 20964824 10377990 8e Linux LVM Then running "kpartx -av /dev/xen-system/test01.max" should create /dev/mapper/test01.max1 and /dev/mapper/test01.max2 (or something similar). /dev/mapper/test01.max1 -> domU's /boot /dev/mapper/test01.max2 -> domU's PV You can mount /dev/mapper/test01.max1 to get domU's /boot, but to get domU's "/" you need to do more. After you get /dev/mapper/test01.max2, try running pvscan and vgscan again and pray that you get a new VG. That would be domU's VG. IMHO, the steps above are painful. So I'd suggest that you reinstall using only one partition (/) WITHOUT LVM, WITHOUT SWAP. If you don't have enough memory and absolutely need swap, use another LV on dom0 for that (in other words, domU will have two disks : one for /, one for swap). This way, you don't need vgscan (and don't have to worry about conflicting VG names) anymore. You simply need fdisk and kpartx (for both the working domU and the new domU). There is another method which uses dom0's LV directly as domU's fs. Assuming you have succesfully mount a working domU, you can do something like this : - create two new LV's on dom0 : /dev/xen-system/test03root and /dev/xen-system/test03swap - mkfs.ext3 /dev/xen-system/test03root - mkswap /dev/xen-system/test03swap - mount /dev/xen-system/test03root somewhere - copy all files from the working domU (including /boot) with either rsync -av, cp -av, or tar (I like tar better) - adjust new domU's config file to look like this memory = "2000" disk = [ 'phy:/dev/xen-system/test03root,xvda1,w', 'phy:/dev/xen-system/test03swap,xvda2,w', ] Note the difference : it's xvda1 and xvda2, NOT xvda and xvdb. you can use either hda1/2, sda1/2, or xvda1/2. xvda is probably best on Centos. - edit new domU's fstab to use xvda1 as "/" and xvda2 as swap - unmount new domU's fs - startup new domU - create an archive (tar.gz or something) of the original domU. That way, subsequent domU's only need to extract from that archive. This way you don't need fdisk, kpartx, or pv/vgscan to create another domU. Fajar, Fabian, Mark,Thanks for your advice on this I am going to spend the day trying to tackle this inbetween what ever fires break out and will let you know how it goes later. E./ _______________________________________________ Xen-users mailing list Xen-users@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-users
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |