Bug#487755: grub2 does not install on boot sector of the current (or a mounted) partition

Holger Fischer hoo.mb at web.de
Sat Jul 5 08:21:40 UTC 2008


Hallo Robert,
thanks for your reply, sorry for answering so late, but there's
a lot to do at the moment.

The good news:

I did not screw up my filesystem (I must say, I never expected
problems, cause changing the 1st 512 Bytes - the boot sector of
a partition - does normally not cause any problems)

grub2 2 still works in sda6 - that means there should be no
problem installing grub2 in the boot sector of a partition
rather than in a mbr. (I got this by doing this "dangerous"
dd thing described above)

With grub(1) or grub_legacy installing grub to the boot sector
of a partition was never a problem.

Now back to the problems:

An apt-cache show grub2 gives me for
Version:  1.96+20080626-1

With this version I could not install grub2 to a partition boot
sector anymore.

So I downgraded (thanks to my /var/cache/apt) to 20080617 which
I reported to work.

Then the behaviour is as I described already:

$ sudo mount /dev/sda7 /1
$ sudo grub-install --root-directory=/1 /dev/sda7
Installation finished. No error reported.
This is the contents of the device map /1/boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.

(hd0)   /dev/sda
$

Then I can do a

$ sudo kvm /dev/sda.

I get a gag screen (see gag.png).

Pressing 2 for sda7 and pressing <down> <up> for stopping grub
timeout

I get the grub2 screen (see sda7.png)

Then I close kvm. (hard disk not touched, nothing destroyed,
nothing screwed up)

When rebooting and trying item 2 in gag menu I get a black
screen with "GRUB" in top left corner.

ctrl-alt-del + booting working item 1 (my sda6 with grub2)
in gag menu and starting after logging in

$ sudo kvm /dev/sda

choosing item 2 in gag screen, gives me the same screen like
real booting item2
(see sda7_after_reboot_same_as_real_boot.png)

One can say:
Oh yeah, starting kvm after grub-install screwed it up,
but I can do:

$ sudo mount /dev/sda7 /1
$ sudo grub-install --root-directory=/1 /dev/sda7
Installation finished. No error reported.
This is the contents of the device map /1/boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.

(hd0)   /dev/sda
$

and reboot immediately. Nothing changes.

That's why I wrote I think this is a kind of a caching problem.
In the running system all works fine, but changes are never
written back (as I wrote I checked this by comparing the boot
sectors of the partitions)

Now with Version from date 20080621 on I could not install
grub2 to the boot sector of a partition.
I get this error message which leads you to the assumption that
my filesystem is screwed up.

I think:
- Maybe this is a step forward, cause grub2 now checks, that
  it's not installed correctly (cause itnow  makes an ioctl() call)
  Now and we and grub2 install routine can check out 
  that there's never something written back to the 1st 512
  Bytes of sda7.
- The only thing the grub2 developer or possibly you must do
  is checking why this is not written back correctly.

Best regards

Holger Fischer

_______________________________________________________________________
EINE FÜR ALLE: die kostenlose WEB.DE-Plattform für Freunde und Deine
Homepage mit eigenem Namen. Jetzt starten! http://unddu.de/?kid=kid@mf2

-------------- next part --------------
A non-text attachment was scrubbed...
Name: sda7_after_reboot_same_as_real_boot.png
Type: image/png
Size: 15992 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pkg-grub-devel/attachments/20080705/b9d13fa3/attachment-0003.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gag.png
Type: image/png
Size: 21308 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pkg-grub-devel/attachments/20080705/b9d13fa3/attachment-0004.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sda7.png
Type: image/png
Size: 19644 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pkg-grub-devel/attachments/20080705/b9d13fa3/attachment-0005.png 


More information about the Pkg-grub-devel mailing list