grub not writing grub.cfg and device.map

Asked by Lee Boekelheide

I'm running 10.10 on /dev/sdb1 and I've also got rhel4 on /dev/sdb2, suse10.1 on /dev/sdb3, shared /home on /dev/sdb6, plus various Win XP partitions on /dev/sda.

I run
  sudo grub-install --recheck /dev/sda
and when done, there is no change to /boot/grub/grub.cfg nor /boot/grub/device.map. If I delete those files, running the cmd does not re-create them.

If I manually run
  sudo grub-mkconfig
I see a mostly correct grub.cfg, but (for example) one of the menu items is
  menuentry "SUSE Linux 10.1 (on /dev/sdb3)" {
   insmod part_msdos
   insmod reiserfs
   set root='(hd1,msdos3)'
   search --no-floppy --fs-uuid --set d4be4ab2-ad29-4f54-bfcf-997b91076def
   linux /boot/vmlinuz root=/dev/sda1 vga=0x314 acpi=off resume=/dev/sda5 splash=silent showopts
   initrd /boot/initrd
  }
and I can't understand how it got /dev/sdb3 correct in the title but got wrong root=/dev/sda1 in the linux command.

Is grub broken? Is this pilot error? Where is grub putting its stuff if not in /boot/grub/grub.cfg? Where does the boot get the poop to make the menu? How come it's not updating that grub.cfg file?

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu grub2 Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Lee Boekelheide (bogf0-probo) said :
#1

I've figured out at least part of the answer.

It turns out that the /dev/sda1, the mistaken root= in the suse10.1 command, came from the menu.lst in that partition. So grub must be looking at the grub configuration stuff in each of those partitions and using what it finds there.

This is broken (for me, anyway) because those partitions were contstructed by tarring in from a different place, and their grub config stuff has not been updated.

Still no explanation for why I don't get a new grub.cfg or device.map.

Revision history for this message
Goh Lip (gohlip) said :
#2

See if "sudo os-prober" gives you the right /dev/sda3 for the Suze.
You might want to "sudo grub-mkdevicemap" too.
Then and only then do "sudo update-grub"

Also note you should do "sudo grub-mkconfig -o /boot/grub/grub.cfg" instead of just "sudo grub-mkconfig", but "sudo update-grub" should take care of that.

Revision history for this message
delance (olivier-delance) said :
#3

https://help.ubuntu.com/community/Grub2#Reinstalling%20from%20LiveCD
     sudo grub-install --root-directory=/mnt/ /dev/sdX
root-directory is partition which hold "/boot" i.e. sdb1 in your case
/dev/sdX is disk which hold MBR i.e. sda in your case
It's not the first time I heard of grub-instal not reporting errors on wrong root-directory.
If it fixes your problem, could you raise a bug about this lack of error reporting.

Can you help with this problem?

Provide an answer of your own, or ask Lee Boekelheide for more information if necessary.

To post a message you must log in.