0

I already have the following logical volumes:

  • host:/dev/mapper/vg0-fc17-boot (guestOS:/dev/hdb) formatted as ext4 (no partition table)
  • host:/dev/mapper/vg0-fc17-root (guestOS:/dev/hdc) formatted as ext4 (no partition table)

Do I have to create the following grub partition to boot a guest VM under VirtualBox?

  • host:/dev/mapper/vg-fc17-mbr (guestOS:/dev/hda) with a partition table and install grub MBR here?

Or is there a better way? (Maybe grub on vg0-fc17-boot?)

NevilleDNZ
  • 103
  • 7

1 Answers1

1

Presumably you've allocated a disk type device from VirtualBox, which you've set as your PV, created a VG (vg0-fc17) and then created LVs. Therefore, you should point grub install at that device, usually /dev/sda

Alastair McCormack
  • 2,184
  • 13
  • 22
  • @NevilleDNZ Logical volumes don't have partition tables nor have MBRs installed in them. You install Grub to the Physical Volume that they are created on. Type `pvs` to see the name of this disk. – Alastair McCormack Oct 11 '12 at 11:42
  • Your PV does not have ext4 FSs on it (not directly). It has a VG. The VG has two LVs. Each LV has an ext4 FS on it. AFAIK, you can install the Grub MBR on a disk which is entirely used as a PV with no partition table. What happens when you try it? – Alastair McCormack Oct 11 '12 at 12:30
  • Reword: Can a "ext4 FS" and "grub MBR" coexist on a "LV" (not PV) without a "partition table"? – NevilleDNZ Oct 11 '12 at 12:54
  • @NevilleDNZ There's no point creating an LV and adding an MBR to it. VirtualBox (or a PC BIOS) won't know where on the disk it is or how to read the data. If you're worried about overwriting your data, create a new disk for VirtualBox, set it as the boot disk, possibly with /boot on it and install grub to it. – Alastair McCormack Oct 11 '12 at 13:25
  • let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/6092/discussion-between-nevillednz-and-fuzzyfelt) – NevilleDNZ Oct 11 '12 at 14:42