Opened 14 years ago

Closed 13 years ago

#412 closed defect (fixed)

grub install fails on opensuse 11.2

Reported by: Chucky Owned by: Bruno Cornec
Priority: normal Milestone: 2.2.9.5
Component: mondo Version: 2.2.9.2
Severity: normal Keywords:
Cc:

Description

Mondorestore fails with "due to bug in grub-install ..." and offers chrooted console to install grub by hand.

This logic is in grub-MR script. Opensuse 11.2 uses another grub-install, which don't accept parameters (quits). Old was moved to grub-install.unsupported, but changing name won't help because of another error. grub-MR tries to "hack grub", and this is where bug comes. It passes grub boot partition (as for grub-install), eg. "device (hd0) /dev/sda2", instead of "device (hd0) /dev/sda".

Attachments (4)

mondorestore.log.tgz (9.5 KB ) - added by Chucky 14 years ago.
mondorestore.log.2.tgz (21.1 KB ) - added by Chucky 14 years ago.
log of fixed version (used existing 2.2.9.2, just replaced grub-MR)
mondorestore.log.3.tgz (20.5 KB ) - added by Chucky 14 years ago.
third attempt
mondorestore.log.4.tgz (20.2 KB ) - added by chucky 14 years ago.
log of test packages

Download all attachments as: .zip

Change History (19)

by Chucky, 14 years ago

Attachment: mondorestore.log.tgz added

comment:1 by Bruno Cornec, 14 years ago

Status: newassigned

Should be fixed in rev [2615]. Will be in 2.2.9.3 final. Could you try the test packages I'm making for you at ftp://ftp.mondorescue.org/test/opensuse/11.2/ (tagged 20100407115749).

comment:2 by Chucky, 14 years ago

The fix didn't do the trick. Instead of device name it shows partition number. I try to summarize:

On OpenSuse 11.2:

  1. grub-install don't accept parameters. It can install bootloader through chroot console, but depends on chrooted system's configuration (and names in device.map are /dev/disk/by-id ...) -> works, but unusable for cloning.
  2. grub-install.unsupported don't work in chroot. It show some error "cannot find BIOS drive blabla..." -> unusable.

So the solution is in hack grub section of grub-MR. I fixed for myself 2.2.9.2 version by this and so far it works... (not tested on cciss yet)

if [ "$(echo $mbrpart | grep -E [a-z]+[0-9]+$)" != "" ]; then
    mbrpart=$(echo $mbrpart | sed 's/[0-9]//g')	
fi

Another thing, /etc/grub.conf now has a lot of # comments which shows some errors when redirecting to grub. And the last, note that in logs is also visible bug #402, /dev/sda is /dev/hdc.

Thanks

by Chucky, 14 years ago

Attachment: mondorestore.log.2.tgz added

log of fixed version (used existing 2.2.9.2, just replaced grub-MR)

comment:3 by Chucky, 14 years ago

Ofcourse, I see that my fix will not work on cciss at all :-)

in reply to:  2 comment:4 by Bruno Cornec, 14 years ago

Replying to Chucky:

  1. grub-install.unsupported don't work in chroot. It show some error "cannot find BIOS drive blabla..." -> unusable.

I'm curious to see these msgs so I redirected them now in the log file.

I continue to think this would be the best solution.

So the solution is in hack grub section of grub-MR. I fixed for myself 2.2.9.2 version by this and so far it works... (not tested on cciss yet)

if [ "$(echo $mbrpart | grep -E [a-z]+[0-9]+$)" != "" ]; then
    mbrpart=$(echo $mbrpart | sed 's/[0-9]//g')	
fi

Which doesn't work for cciss, as you remarked, nor dev/mapper, dev.md, ....

I've changed in the beta the mbrpart which was wrong by mbrdev. So I don't know with which code you're working here :-(

Another thing, /etc/grub.conf now has a lot of # comments which shows some errors when redirecting to grub.

You shouldn't go up to that point, but your remark is still valid so will fix that as well.

And the last, note that in logs is also visible bug #402, /dev/sda is /dev/hdc.

I'll followup on that one.

Re-building packages for you in order to test again. If you want to patch, please patch that version, not 2.2.9.2.

by Chucky, 14 years ago

Attachment: mondorestore.log.3.tgz added

third attempt

comment:5 by Chucky, 14 years ago

This time it worked, but I am unsure It was allright. It seems that grub-install returned 0, while he shouldn't restore boot loader due to additional parameter warnings. But system booted up, might be caused by previous successful instalation of grub.

I have some other notes, while I had to reedit mountlist (sda->hdc), grub-MR receives as parameter partition from original mountlist (/dev/sda2).

comment:6 by Bruno Cornec, 14 years ago

Milestone: 2.2.9.32.2.9.4

comment:7 by Bruno Cornec, 14 years ago

Milestone: 2.2.9.42.2.9.5

comment:8 by Bruno Cornec, 14 years ago

Definitely a better fix is in rev [2669].

Could you try the test packages I'm making for you at ftp://ftp.mondorescue.org/test/opensuse/11.2/ (tagged 20100702113644).

comment:9 by chucky, 14 years ago

Tested test packages and, after reboot, system can't boot with "FATAL: No bootable medium found! System halted.". I restored with nuke, then with interactive, then I tried "mondorestore -Z mbr" with the same effect. grub-install.unsupported seems to be really unsupported since it shows some error "/dev/sda2 does not have any corresponding BIOS drive" and still returning 0. I restored mbr with grub directly. I liked that grub-MR which 'hacked' grub, that worked for sure (when repaired ). Thanks for support anyway.

by chucky, 14 years ago

Attachment: mondorestore.log.4.tgz added

log of test packages

comment:10 by chucky, 14 years ago

Have to clarify that again, grub-install.unsupported return 1, but grub-MR always get 0 because of " ... | tee -a $LOGFILE".

comment:11 by Bruno Cornec, 14 years ago

Of course, this was a mistake on my side o use tee there (trying to cpature both on screen and in log to help debug). So I'm reverting that to just putting output in logs, so that the return value analysed is correct in [2671]

New version of mondo/mindi available tomorrow. 2.2.9.6-0.20100729235710

For the "/dev/sda2 does not have any corresponding BIOS drive" maybe there is a wrong /boot/devices.map around which avoids it to work ?

comment:12 by chucky, 14 years ago

Yes, device.map has (hd0) set to /dev/disk/by-id ... name which was incorrect, so I corrected to current hdd's id and I get the same message. It seems that grub don't support those id's. Then tried grub-install.unsupported --recheck /dev/sda2 and that shows

Probing devices to guess BIOS drives. This may take a long time.
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'.

(fd0)	/dev/fd0
(hd0)	/dev/sda

Of course, to be really successful, parameter of grub-install had to be /dev/sda or message with "FATAL: No bootable medium" will show again (boot loader on /dev/sda2, not MBR).

comment:13 by Bruno Cornec, 13 years ago

So does the latest beta of mondo 2.2.9.5 of this week support correctly enough your version of Open SuSE now ?

What should be done in addition if it's still not the case ?

comment:14 by Bruno Cornec, 13 years ago

Milestone: 2.2.9.52.2.9.6

comment:15 by Bruno Cornec, 13 years ago

Milestone: 2.2.9.62.2.9.5
Resolution: fixed
Status: assignedclosed

Considering fixed. Please reopen if it's still not the case.

Note: See TracTickets for help on using tickets.