Opened 10 years ago

Closed 9 years ago

#412 closed defect (fixed)

grub install fails on opensuse 11.2

Reported by: Chucky Owned by: bruno
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 10 years ago.
mondorestore.log.2.tgz (21.1 KB) - added by Chucky 10 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 10 years ago.
third attempt
mondorestore.log.4.tgz (20.2 KB) - added by chucky 9 years ago.
log of test packages

Download all attachments as: .zip

Change History (19)

Changed 10 years ago by Chucky

comment:1 Changed 10 years ago by bruno

  • Status changed from new to assigned

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 follow-up: Changed 10 years ago by Chucky

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

Changed 10 years ago by Chucky

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

comment:3 Changed 10 years ago by Chucky

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

comment:4 in reply to: ↑ 2 Changed 10 years ago by bruno

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.

Changed 10 years ago by Chucky

third attempt

comment:5 Changed 10 years ago by Chucky

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 Changed 10 years ago by bruno

  • Milestone changed from 2.2.9.3 to 2.2.9.4

comment:7 Changed 9 years ago by bruno

  • Milestone changed from 2.2.9.4 to 2.2.9.5

comment:8 Changed 9 years ago by bruno

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 Changed 9 years ago by chucky

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.

Changed 9 years ago by chucky

log of test packages

comment:10 Changed 9 years ago by chucky

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

comment:11 Changed 9 years ago by bruno

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 Changed 9 years ago by chucky

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 Changed 9 years ago by bruno

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 Changed 9 years ago by bruno

  • Milestone changed from 2.2.9.5 to 2.2.9.6

comment:15 Changed 9 years ago by bruno

  • Milestone changed from 2.2.9.6 to 2.2.9.5
  • Resolution set to fixed
  • Status changed from assigned to closed

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

Note: See TracTickets for help on using tickets.