bug-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #37606] Grub2-install doesn't report a failure to write to boot par


From: Simon
Subject: [bug #37606] Grub2-install doesn't report a failure to write to boot partition
Date: Sun, 21 Oct 2012 09:56:22 +0000
User-agent: Mozilla/5.0 (X11; Linux i686; rv:16.0) Gecko/20100101 Firefox/16.0

URL:
  <http://savannah.gnu.org/bugs/?37606>

                 Summary: Grub2-install doesn't report a failure to write to
boot partition
                 Project: GNU GRUB
            Submitted by: simd
            Submitted on: Sun 21 Oct 2012 09:56:21 GMT
                Category: Installation
                Severity: Major
                Priority: 5 - Normal
              Item Group: Software Error
                  Status: None
                 Privacy: Public
             Assigned to: None
         Originator Name: sd
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 
                 Release: other
         Reproducibility: Every Time
         Planned Release: None

    _______________________________________________________

Details:

I think this bug has come up before in different guises e.g.
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/574883

Was trying to load Grub2 into a partition (not MBR), in Fedora 17 using
grub2-install. (Wanting to use a specific partition for Grub in a multi-os
situation). 

Process ran through, no error reported. Attempted to chain load to the
partition resulted in an error 'no signature'. Dumping the first sector of the
partition showed it to be filled only with "0"s. No boot code.

After some attempts & investigation, running again using debug/verbose option
ended with following (actually by this time I was trying just grub2-bios-setup
itself):

....
/usr/sbin/grub2-bios-setup: info: saving <213632,0,512>.
/usr/sbin/grub2-bios-setup: info: saving <213633,0,512>.
/usr/sbin/grub2-bios-setup: info: saving <216642,0,512>.
/usr/sbin/grub2-bios-setup: info: saving <216643,0,512>.
/usr/sbin/grub2-bios-setup: info: opening the core image
`/mnt/grub-partition/grub2/i386-pc/core.img'.
/usr/sbin/grub2-bios-setup: info: writing 0x400 bytes.

----End----

Appears as if grub has just written 400 bytes, either to the core image or the
partition boot sector. It's not clear which.

Panic sets in at this point. Grub has apparently written 400 bytes somewhere,
but obviously not to my boot sector. Has it potentially corrupted another
sector?

Downloaded & built source and eventually found the following error:
File:           grub-core/kern/disc.c
Procedure:      grub_disk_write 
The following line (or similar) occurs in more than one place:

...
          if ((disk->dev->write) (disk, sector, 1, tmp_buf) != GRUB_ERR_NONE)
            goto finish;
...
 finish:
  return grub_errno;

Here, whilst the procedure correctly stops if the disk write fails, it doesn't
record the fact that an error occurred (into grub_errno). The grub_disk_write
process therefore returns an apparent success, even though there was a
fundamental error. 
The user, like me, is left wondering what happened! 

I think it would be a good idea to surround both the start and end of the
write to the boot partition with comments, so you can see more clearly just
what's being done.

Looking further the code, it appeared I had an error 24, which I think is a
Not-Implemented error. Does that mean that this sort of set-up, using
"blocklists" isn't supported at all anymore? The documentation implies it is,
but you have to be careful and use the --force switch (which I did).




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?37606>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]