# KVM & Partitions

## toniD

Hy,

i have a few questions about handling KVM-Images.

I try to create a guest in a LVM-Partition (e.g. /dev/VMs/vm1) formated with XFS.

```

kvm-server:/data/images# lvs

  LV     VG     Attr   LSize   Origin Snap%  Move Log Copy%  Convert

  vm1    VMs    -wi-ao   4.66G

  vm1-sw VMs    -wi-a- 476.00M

```

When i copy the root-fs and try to start, it does not boot, because of a missing bootloader.

```

...

Booting from Hard Disk...

Boot failed: not a bootable disk

```

When i install a bootloader, i have to partition the /dev/VMs/vm1 inside the guest, so the LVM-Functionality of growing up the FS goes away?

Is there a Possibility to startup an normal partition without a bootloader, XEN-Like or something?

Hope someone can help me out..

Thanks in advance,

Toni.

----------

## frostschutz

 *toniD wrote:*   

> H
> 
> When i install a bootloader, i have to partition the /dev/VMs/vm1 inside the guest, so the LVM-Functionality of growing up the FS goes away?

 

Why does the growing functionality away? Doesn't kvm see a larger disk when you grow the lv, so you could grow the partition inside kvm and grow the xfs inside kvm?

----------

## Hu

Why are you partitioning inside the guest?  Though this can be done, there is no need to do so.

----------

## toniD

Yes,

that is my Problem.

My intention was to bootup a OS on a normal LVM-Partition, but when i tried this i ever got the

```

Booting from Hard Disk...

Boot failed: not a bootable disk 

```

failure.

My command (did i forgot some options?):

```
kvm -hda /dev/mapper/VMs-vm2 -m 512 -boot c
```

Greets.

----------

## toniD

Ok, i've got it.

The Trick is to run with qemu-kvm and give as option a kernel-image..

```
qemu-system-x86_64 -k de -name vm2 -kernel /boot/vmlinuz-2.6.26-2-amd64 -initrd /boot/initrd.img-2.6.26-2-amd64 -hda /dev/mapper/VMs-vm2
```

Thanks for your help.

Greets, Toni.

----------

## frostschutz

that's good to know, thanks   :Very Happy: 

----------

