VM Hangs on Booting from HD

ejc317

Member
Oct 18, 2012
263
0
16
We created a new VM and then mounted the LV

We then partitioned the LV and created a filesystem. rsync'ed the files into the partition and tried to boot from it and it just hangs on booting from HD. When I tried to do grub-install I get the below ... a bit stumped

grub-install /dev/PL-C-SAN/vm-100-disk-1
/usr/sbin/grub-setup: warn: Attempting to install GRUB to a partition instead of the MBR. This is a BAD idea..
/usr/sbin/grub-setup: error: embedding is not possible, but this is required for cross-disk install.
 
We created a new VM and then mounted the LV

We then partitioned the LV and created a filesystem. rsync'ed the files into the partition and tried to boot from it and it just hangs on booting from HD. When I tried to do grub-install I get the below ... a bit stumped

grub-install /dev/PL-C-SAN/vm-100-disk-1
/usr/sbin/grub-setup: warn: Attempting to install GRUB to a partition instead of the MBR. This is a BAD idea..
/usr/sbin/grub-setup: error: embedding is not possible, but this is required for cross-disk install.
Hi,
grub-install should be run inside the client. You can try to chroot inside the VM, but you must use bindmounts of /sys /dev and so on...

But if you copy all content from outside, why you don't copy also the bootblock?

BTW. this has nothing to do with proxmox - you have the same issue by creating an VM on another system.

Udo
 
Hi,
grub-install should be run inside the client. You can try to chroot inside the VM, but you must use bindmounts of /sys /dev and so on...

But if you copy all content from outside, why you don't copy also the bootblock?

BTW. this has nothing to do with proxmox - you have the same issue by creating an VM on another system.

Udo

Understand this is not proxmox - we tried to DD bootblock - dd first 446 and then write 512 ... same problem
 
Understand this is not proxmox - we tried to DD bootblock - dd first 446 and then write 512 ... same problem
Hi,
hmm - does the bootblock fit to both layouts?
If you look with file you can see the layout - it's the same?
Code:
file vm-250-disk-1.raw 
vm-250-disk-1.raw: x86 boot sector; partition 1: ID=0x83, active, starthead 32, startsector 2048, 497664 sectors; partition 2: ID=0x5, starthead 59, startsector 501758, 12079106 sectors, code offset 0x63
I'm a friend of an extra boot-partition - so you can copy (dd) the MBR with sda1 (/boot) and change after that the second partition (root, or lvm) and are able to boot.

Have you tried to boot inside the VM an live-cd (like grml) and use than grub-install?

Udo
 
So after copying the bootblock (first 446kb) - the system boots but gets a kernel panic ...

We can get it to work right if we run a recovery disk but again - the goal is to automate b/c DD is too slow. We want to rsync files, etc ....
 
So after copying the bootblock (first 446kb) - the system boots but gets a kernel panic ...

We can get it to work right if we run a recovery disk but again - the goal is to automate b/c DD is too slow. We want to rsync files, etc ....
Hi,
that sounds to me, that you should take a look at puppet, or ReaR ("Relax and Recover") or sucht tools to automate install clients.

Udo
 
  • Like
Reactions: ebiss