Page 1 of 1
Grub and Recovery Partition
Posted: Sun May 27, 2007 11:43 am
by Harryc
If you install Grub on the MBR on a Thinkpad T60, will it have any effect of the recovery partition? I want to keep the recovery partition. Can recovery still be invoked by using the thinkvantage key on boot?
Posted: Sun May 27, 2007 12:16 pm
by K0LO
If you install GRUB to the MBR then you will lose the ability to use the Thinkvantage key on boot. The IBM MBR contains the code to make that work. You will not, however, lose the recovery partition and you can use GRUB to boot into it if necessary.
A simpler solution is to leave the IBM MBR as-is and install GRUB to the partition where your Linux distro is installed. Then set the Linux partition as active.
When you boot your PC, the Thinkvantage key will still work if pressed. The PC will boot directly into GRUB if not.
Posted: Sun May 27, 2007 1:34 pm
by al7kz
If you do overwrite the MBR with GRUB, you can restore it along with functionality of the F11/Access IBM keys for restore, if you have access to another computer with a floppy drive and a CD writer, ie, a desktop.
Posted: Sun May 27, 2007 1:39 pm
by Harryc
Thanks for the replies, I think I'll use k0lo's method on the first go-around with OpenSuSE.
Posted: Mon May 28, 2007 10:11 am
by Jedacite
Also, when I installed Ubuntu it placed the Recovery Partition as an item,
Linux...
Windows...
ThinkVantage...
So I could easily boot it from Grub. I can still use the ThinkVantage button to adjust the bios or manually choose a boot device. But it has to be done right away on boot (like pressing F1 or F2 or del on another machine.)
I'm sure the other Linux Distros do it too, and if not I can send you the few lines that are required to do it (its feasy to set up.)
Posted: Mon May 28, 2007 10:46 am
by Harryc
k0lo wrote:A simpler solution is to leave the IBM MBR as-is and install GRUB to the partition where your Linux distro is installed. Then set the Linux partition as active.
I tried this with OpenSuSE 10.2, and I got a blank screen after the install was complete/reboot and before Grub came up. The only message on the screen was 'booting installed system' with a flashing cursor. At that point the only way I could get into SuSE was to boot the install DVD, run the installer again, and select 'boot installed system'. I made sure (in YaST, system, bootloader) that Grub was installed on the / partition and that it was active/bootable. Any more ideas? I had to use the Thinkvantage recovery mode to reinstall XP. So now I am back to square one. This is a new machine so it wasn't a huge deal, but I don't want to do it again

I used a GParted Live CD to resize the XP partition, if that matters. I just left unallocated space for SuSE.
Posted: Mon May 28, 2007 12:49 pm
by K0LO
The partition where GRUB is installed to (/ or /boot) needs to be a primary partition so that the MBR can pass control to the currently active (primary) partition. Did you make it primary or logical?
If possible, please run the following in OpenSuse and post the output:
Posted: Mon May 28, 2007 1:31 pm
by Harryc
k0lo wrote:The partition where GRUB is installed to (/ or /boot) needs to be a primary partition so that the MBR can pass control to the currently active (primary) partition. Did you make it primary or logical?
If possible, please run the following in OpenSuse and post the output:
It was an extended partition. OK, I will try it again making / a primary partition.
Posted: Mon May 28, 2007 1:58 pm
by K0LO
I'm sorry for the confusion, Harry. I should have included that extra bit of information in my original response.
You can make logical partitions bootable (I have one that is) but it requires a little extra effort that's beyond the scope of this discussion. It will be automatic if done on a primary partition. I hope that you have room left for one in your partition table. Recall that the partition table has room for up to four entries and that the logical partition container takes up one entry. So you can have, for example, three primaries and an unlimited number of logicals. You probably have used up two of the primaries already for Windows and for the Recovery partition, so hopefully you have one left.
Just as an aside, you didn't need to reinstall Windows. It would have remained in place but may not have been accessible until you either a) made the Windows partition active, or b) got GRUB to work and boot Windows from the GRUB menu.
If all else fails you could just do as Jedacite recommends and install GRUB to the MBR and then let it handle booting into the Recovery partition.
Posted: Mon May 28, 2007 6:57 pm
by Harryc
k0lo, that was it. I made / a primary partition. During the installation routine, creating an extended partition is the default selection in the YaST partitioner, so you have to custom partition the whole setup for openSuSE ... create / as primary, and create /home and /swap in an extended partition container. Grub gets installed to the / partition.
Thanks.
Posted: Sat Jun 23, 2007 9:07 am
by zoltanthegypsy
al7kz wrote:If you do overwrite the MBR with GRUB, you can restore it along with functionality of the F11/Access IBM keys for restore, if you have access to another computer with a floppy drive and a CD writer, ie, a desktop.
I have XP, two flavors of linux, and solaris multi-booting on my new T61. I can boot the recovery partition from grub - either from a solaris active primary partition or by writing grub to the MBR w/the stage 1 file in a fat32 logical partition. Unfortunately, the ThinkVantage button won't boot it. I have tried the Lenovo tool: rnr31_rrd.exe and it gets me back the F11 option, but F11 just gets me "NTLDR is missing".
What procedure are you using to get back full F11 capability?
Thanks,
Bill
Posted: Sat Jun 23, 2007 11:38 am
by al7kz
Hi Bill,
Bainbridge Island...the ol' Winslow ferry...firework stands...strawberries...
The only TP I have that uses a recovery partition is a T42, so I hauled it out to check if F11/Access IBM still worked, and they didn't. Then I remembered I had resized the C: drive with gparted to free up space to install linux, so that must have messed up the MBR. (A little learning is a dangerous thing).
My procedure was just to be able to repair the MBR & restore F11 without using a floppy, since I don't have a one. Sounds like you have a USB floppy for your T61, so you could use rnr31_rrd directly. Don't know why it didn't work.
What I did was download rnr31_rrd.exe and install it to a floppy on a desktop. Then I used Nero 6 OEM to create a bootable CD and copied the floppy contents to it. I can't remember if I used the boot sector of the floppy for the CD, but you can use that or NERO's built-in one. Then boot with the CD.
[DR-DOS] A:\>D:
[DR-DOS] D:\>DOE
Select Option 1 & press enter
Press ENTER to continue
Select Option A & press ENTER
Press ENTER to restart system
I just used that to fix my broken MBR & F11/Access IBM now boot to recovery again. I'm not familiar with the T61 - your mileage may vary. Hope this helps...
Joe
Posted: Sat Jun 23, 2007 1:28 pm
by zoltanthegypsy
al7kz wrote:Hi Bill,
Bainbridge Island...the ol' Winslow ferry...firework stands...strawberries...
What I did was download rnr31_rrd.exe and install it to a floppy on a desktop. Then I used Nero 6 OEM to create a bootable CD and copied the floppy contents to it. I can't remember if I used the boot sector of the floppy for the CD, but you can use that or NERO's built-in one. Then boot with the CD.
[DR-DOS] A:\>D:
[DR-DOS] D:\>DOE
Select Option 1 & press enter
Press ENTER to continue
Select Option A & press ENTER
Press ENTER to restart system
I just used that to fix my broken MBR & F11/Access IBM now boot to recovery again. I'm not familiar with the T61 - your mileage may vary. Hope this helps...
Joe
Ferry, fireworks, strawberries ... check
Above repair procedure ... nope
Seriously, thanks for this, but I have already tried both repair and rewrite with the same results. I now have F11, but it gets me "NTLDR is missing". I have just verified that this is coming from sda1's boot sector. (The boot sector of the XP partition). I verified this by modifying that boot sector's code from "NTLDR is missing" to "NTLDR is fscking" and sure enough, that's what I get w/F11.
No idea why it's going there, unless that's part of the normal recovery boot. I do note that the page where rnr31_rrd.exe is located seems to talk about repairing a corrupt boot sector, not MBR. No idea if that is intentional or a "thinko".
I'm willing to keep hacking, all suggestions welcome!
Thanks again,
Bill
Posted: Sat Jun 23, 2007 2:01 pm
by K0LO
Bill:
It appears from your test that the IBM bootloader is trying to boot from sda1 when you press the "Access IBM" button. I don't have a recovery partition on my Thinkpad any more, but I took a look at an Acronis TrueImage backup that I had made of the machine before removing the partition.
It looks like it was set up so that Windows was on the first primary partition (sda1) and the recovery environment was on the fourth primary partition (sda4). From that I would assume that the bootloader is supposed to chainload to sda4 when you press Access IBM.
If I remember this correctly (and I could be wrong), pressing Access IBM is supposed to make the 4th partition active and unhidden, and then transfer control to its bootsector and boot into Windows PE in the recovery environment (MiniNT), at least on my ThinkPad model. If your T61 is newer maybe IBM changed the way this works?
Posted: Sat Jun 23, 2007 3:25 pm
by zoltanthegypsy
k0lo wrote:Bill:
It appears from your test that the IBM bootloader is trying to boot from sda1 when you press the "Access IBM" button.
It looks like it was set up so that Windows was on the first primary partition (sda1) and the recovery environment was on the fourth primary partition (sda4).
If I remember this correctly (and I could be wrong), pressing Access IBM is supposed to make the 4th partition active and unhidden, and then transfer control to its bootsector and boot into Windows PE in the recovery environment (MiniNT),
Hmmm, the fdisk print that I pulled (w/Knoppix) on the factory drive config looked like this:
Device Boot Start End Blocks Id System
/dev/sda1 * 1 19910 150519568+ 7 HPFS/NTFS
/dev/sda2 19911 20673 5768280 12 Compaq diagnostics
But in BOOT.INI in the recovery partition I see this:
[boot loader]
timeout=0
default=C:\
[operating systems]
multi(0)disk(0)rdisk(0)partition(4)\WINDOWS="Microsoft Windows XP Professional" /fastdetect
C:\ = "PC-DOS"
Sort of confirms (or hints at) your 4th partition info. If so, no idea why fdisk called it the 2nd partition. In "x" mode, fdisk clearly shows the service partition as the 2nd. Well, at least it also shows empty 3rd and 4th partitions.
IIRC I could still get to recovery via ThinkVantage after resizing and moving the NTFS _and_ moving the recovery partition. It was _probably_ after the Solaris and Linux installs that things got sideways.
This isn't world peace, but in the interest of science I may wipe the whole thing and start over - but I'm not sure how to insert my unix partitions if fdisk insists on calling the 4th the 2nd - if indeed that is what's up. I will dump the hex of the MBR after the reinstall if I go that way.
BTW, IIRC, I selected the appropriate boot sector repair option, but I will try again - w/a CD this time
Thanks (both) for the suggestions - keep 'em coming.
Bill
Posted: Sat Jun 23, 2007 3:54 pm
by K0LO
Bill:
I don't have any data to support how the disk was laid out originally; it might have been exactly the same as yours. I only inferred that the recovery partition was on sda4 by looking at the contents of boot.ini in my backup copy of the recovery partition and finding exactly what you see (multi(0)disk(0)rdisk(0)partition(4)...)
There was a detailed description of the IBM recovery partition on IBM's web site that explained all of this, but I've been unsuccessful in finding it.
I wouldn't wipe the disk yet -- you might just end up right back where you are at now. Keep looking for info on how this works!
Posted: Sun Jun 24, 2007 2:46 pm
by zoltanthegypsy
k0lo wrote:
There was a detailed description of the IBM recovery partition on IBM's web site that explained all of this, but I've been unsuccessful in finding it.
Maybe
http://www.redbooks.ibm.com/abstracts/SG247107.html but it looks like it is for version 3. I _think_ my T61 uses version 4, and the bmgr32 info is a little off. This also seems to imply that the magic is in the MBR _and_ a few otherwise unused disk sectors ???
Even so, I'm still totally baffled re why the Lenovo repair floppy gives me back the F11 option, but _that_ just barfs w/"NTLDR missing".
I will keep grinding...
Bill
Posted: Sun Jun 24, 2007 5:37 pm
by K0LO
zoltanthegypsy wrote:This also seems to imply that the magic is in the MBR _and_ a few otherwise unused disk sectors ???
Bill:
Yes, a "normal" Microsoft MBR is a few hundred bytes long and fits in the first 512 byte sector of the disk (Absolute Sector 0) along with the partition table. The "magic" MBR that IBM installs occupies the first 4 sectors on the disk, Absolute Sectors 0 - 3, and contains the extra code needed to make the Access IBM button work.
If you install GRUB to the MBR then it occupies (I think) the first 16 sectors, so it would have written over the IBM MBR. One thing that you could try is to look at the contents of sectors 0 - 15 with a hex editor to see what's there.
If the IBM repair floppy was not written correctly, it might not be completely replacing the second, third and fourth sectors. Sometimes it helps to first zero those sectors to be absolutely sure that there are no code remnants left from your prior GRUB installation. If you're really adventurous, pop in your Windows CD and boot to the recovery console and do a "fixmbr" command to replace the MBR with the short, 1-sector version from Microsoft that will boot directly to the active partition. Then use DD on Linux to zero out absolute sectors 1 - 15. Be very careful not to write to sector 0! Then try the IBM repair floppy again and look with the hex editor to see what it did.
The document that you reference is not the one that I remember, but it contains a lot of interesting information. The tool bmgr32 looks to be pretty powerful.
Posted: Thu Jun 28, 2007 6:58 pm
by Choad Namath
zoltanthegypsy wrote:k0lo wrote:
Even so, I'm still totally baffled re why the Lenovo repair floppy gives me back the F11 option, but _that_ just barfs w/"NTLDR missing".
I will keep grinding...
Bill
I bought an X60 on eBay that someone had installed a GRUB loader on as well, and my F11 option was missing too. I finally got a floppy drive to run the floppy repair diskette today, and now I have the F11 option but I'm getting the "NTLDR is missing" message too. Have you gotten anywhere with this? It's really frustrating...
Posted: Fri Jun 29, 2007 6:52 pm
by Troels
It has been discussed to death i see... but still.
As in my other thread (
http://forum.thinkpads.com/viewtopic.php?t=45124 ) i was forced to make the ext3 partition logical instead of primary, because else openSuSE insisted on using the rest of my winxp partition and deleting the ext3 partition i already created using partitionmagic.
So now it is logical, so is the swap. I use one for / and one for /home.
Now when booting into windows, partition magic does not recognize the format of these drives correctly and cannot make any of them primary, nor set any of them active.
I installed grub to the boot partition, that is, the Suse install partition, but when starting the laptop it just boots to winxp immediatly without any boot loader.
What can i do?
This is on a t60p, if that matters.
Posted: Fri Jun 29, 2007 7:22 pm
by K0LO
Troels:
Despite what the Suse installer might have recommended, if you are going to install grub to your / partition then that partition must be primary and must be set as active if you want to boot this way. This is because the ThinkPad MBR can only pass control to the currently active primary partition. Right now you must have the Windows partition set as active, so the PC boots Windows. If you want it to boot grub then the partition that grub is installed to must be active.
If you can't get Partition Magic to make further changes you could download and use GParted instead.
See post #10 in this thread by HarryC to see how he got the Suse installer to do what he wanted.
Your other option is to give up the use of the Access IBM button and just install grub to the MBR. This would allow you to leave all partitions as-is (Suse / still in a logical partition) and just use grub to control booting into everything, including the recovery partition.
Posted: Wed Jul 25, 2007 3:36 pm
by egalvan
Harryc wrote:. OpenSUSE
I made / a primary partition. ... create / as primary, and create /home and /swap in an extended partition container. Grub gets installed to the / partition.
Thanks.
Harry, could you post the names, mount points & sizes of your partitions?
I'm trying to gt a handle on drive space needed/used by different distros.
Thanks!
Posted: Wed Jul 25, 2007 4:14 pm
by Harryc
egalvan wrote:... could you post the names, mount points & sizes of your partitions?
This was on a T60 with a 100GB hard drive and 2GB RAM, which I have since sold, but here was the basic breakdown;
50GB Windows
22GB /
15GB /home
2GB /swap
1.5GB R&R Partition
You could easily install OpenSuSE on a 10GB drive. It all depends on how much you install and download.