Bug#489287: grub-install to GPT disk failed: Cannot read `/boot/grub/core.img' correctly

Quinn Li quinn.liqin at gmail.com
Tue Jul 8 07:01:05 UTC 2008


the result of grub-setup -v '(hd0)'

grub-setup: info: the size of hd0 is 488281250
grub-setup: info: opening the device `/dev/sda'
grub-setup: info: the size of hd0 is 488281250
grub-setup: info: opening the device `/dev/sda'
grub-setup: info: the size of hd0 is 488281250
grub-setup: info: opening the device `/dev/sda1'
grub-setup: info: opening the device `/dev/sda1'
grub-setup: info: the size of hd0 is 488281250
grub-setup: info: opening the device `/dev/sda2'
grub-setup: info: opening the device `/dev/sda2'
grub-setup: info: the size of hd0 is 488281250
grub-setup: info: opening the device `/dev/sda3'
grub-setup: info: opening the device `/dev/sda3'
grub-setup: info: the size of hd0 is 488281250
grub-setup: info: opening the device `/dev/sda4'
grub-setup: info: opening the device `/dev/sda4'
grub-setup: info: the size of hd0 is 488281250
grub-setup: info: opening the device `/dev/sda5'
grub-setup: info: opening the device `/dev/sda5'
grub-setup: info: the size of hd0 is 488281250
grub-setup: info: opening the device `/dev/sda6'
grub-setup: info: opening the device `/dev/sda6'
grub-setup: info: the size of hd0 is 488281250
grub-setup: info: opening the device `/dev/sda7'
grub-setup: info: opening the device `/dev/sda'
grub-setup: info: opening the device `/dev/sda'
grub-setup: info: opening the device `/dev/sda'
grub-setup: info: opening the device `/dev/sda'
grub-setup: info: the size of hd1 is 312500000
grub-setup: info: opening the device `/dev/sdb'
grub-setup: info: the size of hd1 is 312500000
grub-setup: info: opening the device `/dev/sdb'
grub-setup: info: the size of hd0 is 488281250
grub-setup: info: the size of hd0 is 488281250
grub-setup: info: the size of hd0 is 488281250
grub-setup: info: the size of hd0 is 488281250
grub-setup: info: opening the device `/dev/sda2'
grub-setup: info: opening the device `/dev/sda2'
grub-setup: info: opening the device `/dev/sda2'
grub-setup: info: opening the device `/dev/sda2'
grub-setup: info: opening the device `/dev/sda2'
grub-setup: info: opening the device `/dev/sda2'
grub-setup: info: opening the device `/dev/sda2'
grub-setup: info: opening the device `/dev/sda2'
grub-setup: info: the size of hd0 is 488281250
grub-setup: info: opening the device `/dev/sda3'
grub-setup: info: opening the device `/dev/sda3'
grub-setup: info: opening the device `/dev/sda3'
grub-setup: info: opening the device `/dev/sda3'
grub-setup: info: opening the device `/dev/sda3'
grub-setup: info: opening the device `/dev/sda3'
grub-setup: info: opening the device `/dev/sda3'
grub-setup: info: the size of hd0 is 488281250
grub-setup: info: opening the device `/dev/sda4'
grub-setup: info: opening the device `/dev/sda4'
grub-setup: info: opening the device `/dev/sda4'
grub-setup: info: the size of hd0 is 488281250
grub-setup: info: opening the device `/dev/sda5'
grub-setup: info: opening the device `/dev/sda5'
grub-setup: info: opening the device `/dev/sda5'
grub-setup: info: opening the device `/dev/sda5'
grub-setup: info: opening the device `/dev/sda5'
grub-setup: info: opening the device `/dev/sda5'
grub-setup: info: opening the device `/dev/sda5'
grub-setup: info: opening the device `/dev/sda5'
grub-setup: info: the size of hd0 is 488281250
grub-setup: info: opening the device `/dev/sda6'
grub-setup: info: opening the device `/dev/sda6'
grub-setup: info: opening the device `/dev/sda6'
grub-setup: info: opening the device `/dev/sda6'
grub-setup: info: opening the device `/dev/sda6'
grub-setup: info: opening the device `/dev/sda6'
grub-setup: info: opening the device `/dev/sda6'
grub-setup: info: opening the device `/dev/sda6'
grub-setup: info: the size of hd0 is 488281250
grub-setup: info: opening the device `/dev/sda7'
grub-setup: info: the size of hd1 is 312500000
grub-setup: info: the size of hd1 is 312500000
grub-setup: info: changing current directory to /dev/mapper
grub-setup: info: changing current directory to /dev
grub-setup: info: changing current directory to dri
grub-setup: info: changing current directory to mapper
grub-setup: info: changing current directory to snd
grub-setup: info: changing current directory to net
grub-setup: info: changing current directory to loop
grub-setup: info: changing current directory to shm
grub-setup: info: changing current directory to pts
grub-setup: info: /dev/sda2 starts from 19531251
grub-setup: info: opening the device hd0
grub-setup: info: the size of hd0 is 488281250
grub-setup: info: Partition 0 starts from 34
grub-setup: info: Partition 1 starts from 19531251
grub-setup: info: getting the size of /boot/grub/boot.img
grub-setup: info: reading /boot/grub/boot.img
grub-setup: info: getting the size of /boot/grub/boot.img
grub-setup: info: getting the size of /boot/grub/core.img
grub-setup: info: reading /boot/grub/core.img
grub-setup: info: getting the size of /boot/grub/core.img
grub-setup: info: the size of hd0 is 488281250
grub-setup: info: the size of hd0 is 488281250
grub-setup: info: setting the root device to `hd0,2'
grub-setup: info: dos partition is 1, bsd partition is -1
grub-setup: info: will leave the core image on the filesystem
grub-setup: info: attempting to read the core image
`/boot/grub/core.img' from GRUB
grub-setup: info: the size of hd0 is 488281250
grub-setup: info: opening the device `/dev/sda'
grub-setup: info: opening the device `/dev/sda2'
...
grub-setup: info: opening the device `/dev/sda2'
grub-setup: info: succeeded in opening the core image but the data is different
grub-setup: info: attempting to read the core image
`/boot/grub/core.img' from GRUB again
grub-setup: info: the size of hd0 is 488281250
grub-setup: info: opening the device `/dev/sda'
grub-setup: info: opening the device `/dev/sda2'
...
grub-setup: info: opening the device `/dev/sda2'
grub-setup: info: succeeded in opening the core image but the data is different
grub-setup: info: attempting to read the core image
`/boot/grub/core.img' from GRUB again
grub-setup: info: the size of hd0 is 488281250
grub-setup: info: opening the device `/dev/sda'
grub-setup: info: opening the device `/dev/sda2'
...
grub-setup: info: opening the device `/dev/sda2'
grub-setup: info: succeeded in opening the core image but the data is different
grub-setup: info: attempting to read the core image
`/boot/grub/core.img' from GRUB again
grub-setup: info: the size of hd0 is 488281250
grub-setup: info: opening the device `/dev/sda'
grub-setup: info: opening the device `/dev/sda2'
...
grub-setup: info: opening the device `/dev/sda2'
grub-setup: info: succeeded in opening the core image but the data is different
grub-setup: info: attempting to read the core image
`/boot/grub/core.img' from GRUB again
grub-setup: info: the size of hd0 is 488281250
grub-setup: info: opening the device `/dev/sda'
grub-setup: info: opening the device `/dev/sda2'
...
grub-setup: info: opening the device `/dev/sda2'
grub-setup: info: succeeded in opening the core image but the data is different
grub-setup: error: Cannot read `/boot/grub/core.img' correctly


On Sat, Jul 5, 2008 at 6:44 PM, Robert Millan <rmh at aybabtu.com> wrote:
> On Sat, Jul 05, 2008 at 08:46:48AM +0800, Quinn Li wrote:
>> >> I have two harddisks on my PC, /dev/sda(hd0) and /dev/sdb(hd1). sda uses GUID partition table, sdb uses MSDOS partition table.
>> >>
>> >> I'm unable to install grub2 to /dev/sda. when I invoke sudo grub-install '(hd0,1)', or to (hd0), or any other partition on /dev/sda, I got:
>> >>
>> >> sudo grub-install '(hd1)'
>
> I assume you mean '(hd0,1)' here (because of the line below).
>
>> >> /usr/sbin/grub-setup --directory=/boot/grub --device-map=/boot/grub/device.map (hd0,1)
>> >> grub-setup: error: Cannot read `/boot/grub/core.img' correctly
>> >>
>> >> But it is OK for me to install grub2 to sdb.
>> >>
>> >> sudo grub-install '(hd1)'
>> >> /usr/sbin/grub-setup --directory=/boot/grub --device-map=/boot/grub/device.map (hd1)
>> >> Installation finished. No error reported.
>> >> This is the contents of the device map /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'.
>
> Please try:
>
>  grub-setup -v '(hd0)'
>
> and send the output.
>
> --
> Robert Millan
>
> <GPLv2> I know my rights; I want my phone call!
> <DRM> What good is a phone call… if you are unable to speak?
> (as seen on /.)
>


More information about the Pkg-grub-devel mailing list