Niccolò Belli
2010-Jun-26 15:34 UTC
[Xen-users] xen 4.0-testing: cannot install grub in debian domU (both hvm and pv)
# dd if=/dev/zero of=/srv/xen/webserver.img oflag=direct bs=1M seek=4095 count=1 # dd if=/dev/zero of=/srv/xen/webserver.img oflag=direct bs=1M count=4096 root@debian:~# grub-install /dev/xvda Searching for GRUB installation directory ... found: /boot/grub The file /boot/grub/stage1 not read correctly. Darkbasic _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Bruce Edge
2010-Jun-26 15:51 UTC
Re: [Xen-users] xen 4.0-testing: cannot install grub in debian domU (both hvm and pv)
Isn''t /dev/xvda just the notation for mapping drives in the .cfg file? I would assume you would need to mount the root .img via loopback, chroot into it, and install form there, or use the grub-install --rootdir option outside of it. -Bruce 2010/6/26 Niccolò Belli <darkbasic4@gmail.com>> # dd if=/dev/zero of=/srv/xen/webserver.img oflag=direct bs=1M seek=4095 > count=1 > # dd if=/dev/zero of=/srv/xen/webserver.img oflag=direct bs=1M count=4096 > > root@debian:~# grub-install /dev/xvda > Searching for GRUB installation directory ... found: /boot/grub > The file /boot/grub/stage1 not read correctly. > > Darkbasic > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Niccolò Belli
2010-Jun-26 19:15 UTC
Re: [Xen-users] xen 4.0-testing: cannot install grub in debian domU (both hvm and pv)
Il 26 giugno 2010 17.51, Bruce Edge <bruce.edge@gmail.com> ha scritto:> Isn''t /dev/xvda just the notation for mapping drives in the .cfg file?It''s how the domU sees the disk using pv, while using hvm it''s sda. Darkbasic _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Niccolò Belli
2010-Jun-27 15:05 UTC
Re: [Xen-users] xen 4.0-testing: cannot install grub in debian domU (both hvm and pv)
Il 26 giugno 2010 17.51, Bruce Edge <bruce.edge@gmail.com> ha scritto:> I would assume you would need to mount the root .img via loopback, chroot > into it, and install form thereI have to specify the offset when I loopback mount the image, so I will not be able to install it in the mbr but just in the first partition. Also I want the domU able to install the bootloader because I want it to automatically update the grub config (menu.lst) to boot the latest kernel installed. Darkbasic _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Fajar A. Nugraha
2010-Jun-27 16:03 UTC
Re: [Xen-users] xen 4.0-testing: cannot install grub in debian domU (both hvm and pv)
2010/6/27 Niccolò Belli <darkbasic4@gmail.com>:> Il 26 giugno 2010 17.51, Bruce Edge <bruce.edge@gmail.com> ha scritto: >> I would assume you would need to mount the root .img via loopback, chroot >> into it, and install form there > > I have to specify the offset when I loopback mount the image, so I > will not be able to install it in the mbr but just in the first > partition. > Also I want the domU able to install the bootloader because I want it > to automatically update the grub config (menu.lst) to boot the latest > kernel installed.I don''t follow your logic from the commands you run earlier (did you run fdisk? install debian domU first? chroot?). However it doesn''t really matter for PV domU. PV domU does not need grub to be installed to MBR/partition for pygrub to work. It simply needs /boot/grub/menu.lst (for grub) with the correct entries. As for "automatically update the grub config (menu.lst) to boot the latest kernel installed", you really only need these lines on kernel-img.conf (on Ubuntu anyway. might be the same on debian) which should exist already on a normal installation: do_initrd = yes postinst_hook = update-grub postrm_hook = update-grub Now, for HVM, it''s slightly different. You REALLY need it installed to /dev/sda. If you install Debian as HVM using the install CD, it already does that automatically. If you want to install it manually after that, you can: - boot with a live CD (I like sysrescuecd) - mount all the necessar partitions ( "/", /boot, and possible others) - bind-mount /dev, /dev/pts/, /sys, and /proc to the mounted root - chroot - possibly edit /etc/mtab - grub-install /dev/sda -- Fajar _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Niccolò Belli
2010-Jun-27 20:22 UTC
Re: [Xen-users] xen 4.0-testing: cannot install grub in debian domU (both hvm and pv)
Il 27 giugno 2010 18.03, Fajar A. Nugraha <fajar@fajar.net> ha scritto:> I don''t follow your logic from the commands you run earlier (did you > run fdisk? install debian domU first? chroot?).I''m sorry, I did not explained it. I already installed debian with hvm and the debian installer (no debootstrap). During the installation it failed to install grub: grub-install /dev/sda Searching for GRUB installation directory ... found: /boot/grub The file /boot/grub/stage1 not read correctly. So I mounted the image, I added "1:2345:respawn:/sbin/getty 38400 hvc0" to /etc/inittab and I booted using pv, pv-grub and xm console. I tried to install grub using pv but I obtained the same error.> However it doesn''t > really matter for PV domU. PV domU does not need grub to be installed > to MBR/partition for pygrub to work. It simply needs > /boot/grub/menu.lst (for grub) with the correct entries.Yes, but I want the domU to automatically update menu.lst> As for "automatically update the grub config (menu.lst) to boot the > latest kernel installed", you really only need these lines on > kernel-img.conf (on Ubuntu anyway. might be the same on debian) which > should exist already on a normal installation: > > do_initrd = yes > postinst_hook = update-grub > postrm_hook = update-grubIt doesn''t work if the grub package is not installed.> Now, for HVM, it''s slightly different. You REALLY need it installed to > /dev/sda. If you install Debian as HVM using the install CD, it > already does that automatically.It should, but it doesn''t succeed.> If you want to install it manually > after that, you can: > - boot with a live CD (I like sysrescuecd) > - mount all the necessar partitions ( "/", /boot, and possible others) > - bind-mount /dev, /dev/pts/, /sys, and /proc to the mounted root > - chroot > - possibly edit /etc/mtab > - grub-install /dev/sdaIf debian cannot install the grub package the bootloader is useless because I do not really need it, I just want the domU to update menu.lst on its own. Darkbasic _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Bruce Edge
2010-Jun-27 21:11 UTC
Re: [Xen-users] xen 4.0-testing: cannot install grub in debian domU (both hvm and pv)
2010/6/27 Niccolò Belli <darkbasic4@gmail.com>> Il 27 giugno 2010 18.03, Fajar A. Nugraha <fajar@fajar.net> ha scritto: > > I don''t follow your logic from the commands you run earlier (did you > > run fdisk? install debian domU first? chroot?). > > I''m sorry, I did not explained it. > I already installed debian with hvm and the debian installer (no > debootstrap). > During the installation it failed to install grub: > grub-install /dev/sda > Searching for GRUB installation directory ... found: /boot/grub > The file /boot/grub/stage1 not read correctly. > > So I mounted the image, I added "1:2345:respawn:/sbin/getty 38400 > hvc0" to /etc/inittab and I booted using pv, pv-grub and xm console. I > tried to install grub using pv but I obtained the same error. > > > > However it doesn''t > > really matter for PV domU. PV domU does not need grub to be installed > > to MBR/partition for pygrub to work. It simply needs > > /boot/grub/menu.lst (for grub) with the correct entries. > > Yes, but I want the domU to automatically update menu.lst > >Ahh, that makes sense. How about this: The latest kernel is always going to leave a symlink pair in root: lrwxrwxrwx 1 root root 28 2010-06-27 09:29 vmlinuz -> boot/vmlinuz-2.6.34-5-server lrwxrwxrwx 1 root root 31 2010-06-27 09:29 initrd.img -> boot/initrd.img-2.6.34-5-server Have one manually constructed menu.lst that uses /vmlinuz and /initrd.img instead of the actual files in /boot/... That lets the kernel version float under it and not have to keep updating the menu.lst. -Bruce> > As for "automatically update the grub config (menu.lst) to boot the > > latest kernel installed", you really only need these lines on > > kernel-img.conf (on Ubuntu anyway. might be the same on debian) which > > should exist already on a normal installation: > > > > do_initrd = yes > > postinst_hook = update-grub > > postrm_hook = update-grub > > It doesn''t work if the grub package is not installed. > > > > Now, for HVM, it''s slightly different. You REALLY need it installed to > > /dev/sda. If you install Debian as HVM using the install CD, it > > already does that automatically. > > It should, but it doesn''t succeed. > > > > If you want to install it manually > > after that, you can: > > - boot with a live CD (I like sysrescuecd) > > - mount all the necessar partitions ( "/", /boot, and possible others) > > - bind-mount /dev, /dev/pts/, /sys, and /proc to the mounted root > > - chroot > > - possibly edit /etc/mtab > > - grub-install /dev/sda > > If debian cannot install the grub package the bootloader is useless > because I do not really need it, I just want the domU to update > menu.lst on its own. > > Darkbasic > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Niccolò Belli
2010-Jun-27 21:15 UTC
Re: [Xen-users] xen 4.0-testing: cannot install grub in debian domU (both hvm and pv)
Il 27 giugno 2010 23.11, Bruce Edge <bruce.edge@gmail.com> ha scritto:> How about this: > The latest kernel is always going to leave a symlink pair in root: > lrwxrwxrwx 1 root root 28 2010-06-27 09:29 vmlinuz -> > boot/vmlinuz-2.6.34-5-server > lrwxrwxrwx 1 root root 31 2010-06-27 09:29 initrd.img -> > boot/initrd.img-2.6.34-5-server > Have one manually constructed menu.lst that uses /vmlinuz and /initrd.img > instead of the actual files in /boot/... > That lets the kernel version float under it and not have to keep updating > the menu.lst.It seems a good idea but I think I should report the bug anyway. I just don''t know if it''s a xen bug... Cheers, Darkbasic _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Fajar A. Nugraha
2010-Jun-28 00:40 UTC
Re: [Xen-users] xen 4.0-testing: cannot install grub in debian domU (both hvm and pv)
2010/6/28 Niccolò Belli <darkbasic4@gmail.com>:> Il 27 giugno 2010 18.03, Fajar A. Nugraha <fajar@fajar.net> ha scritto: >> I don''t follow your logic from the commands you run earlier (did you >> run fdisk? install debian domU first? chroot?). > > I''m sorry, I did not explained it. > I already installed debian with hvm and the debian installer (no debootstrap). > During the installation it failed to install grub: > grub-install /dev/sda > Searching for GRUB installation directory ... found: /boot/grub > The file /boot/grub/stage1 not read correctly.Did you run grub-install manually? You shouldn''t have to. Also, just to clarify, this is grub, right, not grub-pc (i.e. grub2)?> > So I mounted the image, I added "1:2345:respawn:/sbin/getty 38400 > hvc0" to /etc/inittab and I booted using pv, pv-grub and xm console. I > tried to install grub using pv but I obtained the same error.You can''t install grub to MBR when in pv (at least not the last time I tried). The reason is that grub-install needs some BIOS stuff, and pv does not have a BIOS.> > >> However it doesn''t >> really matter for PV domU. PV domU does not need grub to be installed >> to MBR/partition for pygrub to work. It simply needs >> /boot/grub/menu.lst (for grub) with the correct entries. > > Yes, but I want the domU to automatically update menu.lst > > >> As for "automatically update the grub config (menu.lst) to boot the >> latest kernel installed", you really only need these lines on >> kernel-img.conf (on Ubuntu anyway. might be the same on debian) which >> should exist already on a normal installation: >> >> do_initrd = yes >> postinst_hook = update-grub >> postrm_hook = update-grub > > It doesn''t work if the grub package is not installed.Yes, grub package needs to be installed to have update-grub working. But when in PV it does not need to update MBR/partition.> > >> Now, for HVM, it''s slightly different. You REALLY need it installed to >> /dev/sda. If you install Debian as HVM using the install CD, it >> already does that automatically. > > It should, but it doesn''t succeed.If you have some time, could you test whether Ubuntu Lucid behaves the same way on your system, can''t install grub to MBR when in HVM mode? That would at least help determine whether this is a Xen bug or Debian bug. -- Fajar _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Niccolò Belli
2010-Jun-28 10:26 UTC
Re: [Xen-users] xen 4.0-testing: cannot install grub in debian domU (both hvm and pv)
Il 28 giugno 2010 02.40, Fajar A. Nugraha <fajar@fajar.net> ha scritto:> Did you run grub-install manually? You shouldn''t have to.It''s the same, but I just switched to another virtual console during the installation to see the output in the log...> Also, just to clarify, this is grub, right, not grub-pc (i.e. grub2)?I tried both, none works.> If you have some time, could you test whether Ubuntu Lucid behaves the > same way on your system, can''t install grub to MBR when in HVM mode? > That would at least help determine whether this is a Xen bug or Debian > bug.I will try. I already tried with windows 7 and it installed its bootloader flawlessly. Darkbasic _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users