Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > HOWTO-Related Questions

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 14th January 2009, 14:05
frippz frippz is offline
Junior Member
 
Join Date: Jan 2009
Posts: 3
Thanks: 0
Thanked 2 Times in 1 Post
Default Re: Virtualization With KVM On Ubuntu 8.10 (Problems with LVM)

This question is specific to part 6 of Virtualization With KVM On Ubuntu 8.10, specifically Creating an LVM based VM.

I've followed the guide exactly and yet everytime after I've converted the qcow2 image to a LV using
Code:
qemu-img convert disk0.qcow2 -O raw /dev/volumegroup/logicalvolume
, I get the following error:

Code:
Boot from (hd0,0) ext3 894e741d-97b0-461a-9709-147b24506905
Starting up ...

crc error

 -- System halted
I saw another user in the Ubuntu forums that experienced the exact same problem, but no one had a solution (he had followed the same guide). People who have installed directly onto a LV did not experience this issue, but as far as I know, ubuntu-vm-builder does not yet support this.

Any help with this would be very much appreciated!
Reply With Quote
Sponsored Links
  #2  
Old 15th January 2009, 14:45
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,751 Times in 2,581 Posts
Default

Not sure what it is. Did you create a filesystem on /dev/volumegroup/logicalvolume, or did you just create the LV with lvcreate, nothing more?

Any errors in your logs?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 15th January 2009, 16:40
frippz frippz is offline
Junior Member
 
Join Date: Jan 2009
Posts: 3
Thanks: 0
Thanked 2 Times in 1 Post
Default

I just created the LV with lvcreate, yes. Then I used qemu-img to convert the image file.

Code:
qemu-img convert disk0.qcow2 -O raw /dev/mogwai/milltime
The only thing that shows up in /var/log/libvirt/qemu/milltime.log is:

Code:
/usr/bin/kvm -S -M pc -m 1024 -smp 1 -name milltime -monitor pty -boot c -drive file=/dev/mogwai/milltime,if=ide,index=0,boot=on -net nic,macaddr=52:54:00:09:91:db,vlan=0 -net tap,fd=14,script=,vlan=0,ifname=vnet2 -serial none -parallel none -usb -vnc 0.0.0.0:1 
char device redirected to /dev/pts/5
info cpus
Doesn't say much, from what I can tell. Are there any other logs I can check?

edit: This wasn't mentioned specifically in the guide, but I did boot the machine from the disk0.qcow2 image first, in order to change the password for the account. I then proceeded to shut it down (from within the VM using sudo shutdown -h now) and changed the config file to point to the LV instead of the image file, redefined the VM in virsh and started it up again, which resultet in the crc error and "System halted"

edit2: Oh yeah, here's the xml-file for the VM

Code:
<domain type='kvm'>
  <name>milltime</name>
  <uuid>0a721358-9107-aa88-2ca5-92b983865adb</uuid>
  <memory>1048576</memory>
  <currentMemory>1048576</currentMemory>
  <vcpu>1</vcpu>
  <os>
    <type>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
  </features>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/bin/kvm</emulator>
    <disk type='file' device='disk'>
      <source file='/dev/mogwai/milltime'/>
      <target dev='hda' bus='ide'/>
    </disk>
    <interface type='bridge'>
      <mac address='52:54:00:09:91:db'/>
      <source bridge='br0'/>
    </interface>
    <input type='mouse' bus='ps2'/>
    <graphics type='vnc' port='-1' listen='0.0.0.0'/>
  </devices>
</domain>

Last edited by frippz; 15th January 2009 at 17:01.
Reply With Quote
  #4  
Old 15th January 2009, 22:10
joostvdl joostvdl is offline
Member
 
Join Date: Oct 2005
Posts: 34
Thanks: 0
Thanked 1 Time in 1 Post
Default Same problem here

Hi

I have the same problem here.

Still looking for an answer.

Another problem I found with VM BUilder is that the memory calculation is not correct. It gives no good result.
Reply With Quote
  #5  
Old 15th January 2009, 22:18
frippz frippz is offline
Junior Member
 
Join Date: Jan 2009
Posts: 3
Thanks: 0
Thanked 2 Times in 1 Post
Default

I just finished some testing using qemu-img to convert the qcow2 file to a raw file, just to see if that would work to boot from, which it did actually. So I'm guessing that something goes wrong when the conversion goes straight to the LV. I just wish I knew what exactly...

edit: Just for fun, I tried to use dd to copy the raw file to the LV. Lo and behold, the damn thing could now boot off the LV. A little hassle with this workaround, sure, but it seems to work.

I'm not quite ready to call this one solved yet, but it's a very good start!

Last edited by frippz; 15th January 2009 at 22:20.
Reply With Quote
The Following 2 Users Say Thank You to frippz For This Useful Post:
falko (16th January 2009), Nakarti (16th January 2012)
  #6  
Old 16th January 2009, 14:00
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,751 Times in 2,581 Posts
Default

Quote:
Originally Posted by frippz View Post
I just created the LV with lvcreate, yes. Then I used qemu-img to convert the image file.
Ok, that's the correct way.

I wonder why it worked for, and why so many users have this problem now - maybe Ubuntu updated the packages since I wrote the tutorial? I think I have to check again when I find some time...
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #7  
Old 23rd January 2009, 20:41
joostvdl joostvdl is offline
Member
 
Join Date: Oct 2005
Posts: 34
Thanks: 0
Thanked 1 Time in 1 Post
Default Current solution

This is how I convert an qemu disk image to an LVM volume. It is to be noted that in the Logical Volume the same partitions are created as in the image file. So directly mounting of an LVM is not possible. To do that use kpartx to create multiple loopback devices which are mountable.

Quote:
# qemu-img convert disk0.qcow2 -O raw disk0.raw
# lvcreate -n server-01_disk0 -L 10G VG01
{10G is total disksize of RAW file as defined in vmbuilder.partation}
{VG01 is name of LVM volume group}

Quote:
# dd if=disk0.raw of=/dev/VG01/server-01_disk0 bs=1M
Change server-01.xml in /etc/libvirt/qemu:
Code:
    <disk type='block' device='disk'>
      <source dev='/dev/VG01/server-01_disk0'/>
      <target dev='hda' bus='ide'/>
    </disk>
Quote:
# virsh define server-01.xml

Last edited by joostvdl; 23rd January 2009 at 20:44.
Reply With Quote
The Following User Says Thank You to joostvdl For This Useful Post:
falko (24th January 2009)
  #8  
Old 26th April 2009, 17:50
Slasher Slasher is offline
Junior Member
 
Join Date: Apr 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The problem seems to be that qemu-img convert doesn't overwrite the entire volume and if the volume contains non-zeroed data that will confuse the file system. So you need to do dd bs=1M if=/dev/zero of=LVM_volume before calling qemu-img to write the output directly to the LV.
Reply With Quote
  #9  
Old 16th January 2012, 17:39
Nakarti Nakarti is offline
Junior Member
 
Join Date: Jan 2012
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Default Yay, how to put Windows XP on KVM LVM

May we all thank Frippz for the procedure to get Windows XP working as LVM in a KVM guest!
I think the reason direct copy doesn't work is that it retains the MBR in a different location for qcow, but LVM only functions as a raw disk... (That is probably why my LVM install isn't working: I didn't specify raw.)

(Removed the quote because it was mangled)
So: Install Windows to a qcow file, qemu-img convert it to raw, dd that to LVM, and boot LVM.

Last edited by Nakarti; 16th January 2012 at 17:47.
Reply With Quote
  #10  
Old 17th January 2012, 01:09
Nakarti Nakarti is offline
Junior Member
 
Join Date: Jan 2012
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Now I get a green screen instead of boot! What the fish!

(ps. Seriously? Not working 3 years later? Does *anybody* do this?)

Last edited by Nakarti; 17th January 2012 at 17:41.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Xen on Ubuntu 8.10 64bit problems Chromium HOWTO-Related Questions 5 2nd December 2009 18:52
Unable to repair/re-install ubunt svr ubuntu 8.04/8.10 on RAID 5 LVM lucy_t Installation/Configuration 5 19th December 2008 21:59
Ubuntu 8.10 AMD64 problems kennydawg Installation/Configuration 8 19th December 2008 11:12
Ubuntu 8.10 on DELL PowerEdge SC440 cannot boot karotu Installation/Configuration 2 8th December 2008 23:00
ubuntu 8.10 encrypted lvm blocker Installation/Configuration 0 7th November 2008 10:38


All times are GMT +2. The time now is 12:10.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.