<---- template headericclude ----->
Dual-booting with vista and Lenovo recovery partition [T400, Vist x64, F10]
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2005
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Solved] Dual-booting with vista and Lenovo recovery partition [T400, Vist x64, F10]

    Hi,

    I have a Lenovo thinkpad T400 with Vista x64 that I want to dual-boot with fedora 10.

    The T400's original config has 3 primary partions:

    1) Vista boot partition (some weird partition that it only uses to boot... this is my first time using Vista so I don't know the details, but I think it has to be there and it has to be a separate partition from the "data" partition)

    2) Vista data partition

    3) Lenovo Rescue and Recovery partition (a separate bootable partition that is used for recovery, backups, ...)

    My first attempt was to shrink the recovery partition and add a new extended partition that has the two standard fedora logical volumes and an extra NTFS to be shared between the OS's (I usually use FAT32 for this one, but NTFS support seems to be pretty solid now).

    Everything was fine, but I couldn't boot into the rescue partition. According to this site:

    http://www.thinkwiki.org/wiki/Rescue_and_Recovery
    (under "Newer versions of Rescue and Recovery" section)

    You *have* to have a linux boot partition be your primary partition. Other people have told me the same thing and that site has an explanation, but I don't get it =)

    So, it seems that I need 5 primaries (3 original vista/lenovo primaries, 1 linux primaray to put the boot stuff into, and 1 extended for everything else) to make this work (which is not possible).

    Can anyone think of something else I could do (other than getting rid of Vista and the Lenovo stuff and giving them both the finger?)

    I'm thinking maybe I could make an extended partition and move one or more of the Vista/Lenovo partitions in there, but I'm not sure if they could boot.

    I could move the non-bootable Vista/Lenovo partition into an extended partition, but I'm worried that vista would detect the change and go nuts...

    Any thoughts?

    PS... why can't laptop manufacturers make life for linux users easy? EVER?
    Last edited by HawkBoy; 30th January 2009 at 05:47 AM. Reason: Adding "[Solved]" tag to title

  2. #2
    Join Date
    Jun 2006
    Posts
    7,544
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by HawkBoy

    You *have* to have a linux boot partition be your primary partition. Other people have told me the same thing and that site has an explanation, but I don't get it =)
    You're right. They are wrong.

    Hello HawkBoy,

    Fedora (or any Linux, really) doesn't need any primary partitions at all. Or should I not believe my lying eyes? I have Fedora 8 and Fedora 9 installed in this machine entirely in logical partitions. Here is a screen shot of the same logical partitions from an older thread here back when they held Fedora Core 6 and Fedora 7...
    Quote Originally Posted by HawkBoy

    Can anyone think of something else I could do (other than getting rid of Vista and the Lenovo stuff and giving them both the finger?)
    Yeah, just shrink something to create the space that you need, and then create an extended partition in that space. Inside the extended partition, you (or Anaconda) can then create the partitions for Fedora. I recommend that you shrink the Vista partition and leave the utility and recover partitions alone (if you still want them at all). I also recommend shrinking Vista with its own built-in partition manager.

    P.S.: Even that business about the Fedora boot partition needing to be in a cylinder below the 1024th cylinder doesn't apply nowadays. But you occasionally hear someone still say that. GRUB supports LBA which has been around a long time now. Any machine older than that wouldn't have a chance at running a modern version of Fedora anyway IMO.

  3. #3
    Join Date
    Jun 2006
    Posts
    7,544
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by HawkBoy

    ...that site has an explanation, but I don't get it
    I read that article that you linked. The reason it insists on the Linux boot partition being primary is because their booting scheme has GRUB installed in the boot sector of the Linux boot partition. Next, that boot partition is made the active partition. GRUB stage1 located in its boot sector is then launched by the MS boot code that is still in the master boot record. MS boot code in the master boot record always boots the active partition. The MBR now boots the Fedora boot sector instead of the Windows boot sector. It's the MS way of booting. Always has been, and still is. And only primary partitions can be made active. See why they needed that primary partition now? It's a well-known but little-used dual booting method, and it's not a bad way to do business really. Especially if the laptop has a "special" master boot record for the system recovery feature and you want to preserve that. I don't know about your Thinkpad, but some Dells, for example, have that and pressing Ctrl+F11 at the splash screen starts it. Installing GRUB in the master boot record of such a situation ruins that feature. But even then there are still more options...

    I install GRUB in the first sector of my Fedora partitions, too (preserving the MS boot code in the MBR). But I instead boot the Fedora boot sector with the XP boot loader (aka NTLoader). It's just what I like. And it's why I don't require a primary boot partition. You can do that, too, with the Vista boot loader. Now that is a popular method. People often use the free utility EasyBCD to configure the Vista boot loader to boot Linux in such a situation. Then you can forget about your link's primary boot partition thing. But even when GRUB is installed in the master boot record (the classic thing to do), no primary Linux partitions are required. So that article's point is a rare (IMO) exception, and certainly not a universal truth vis-a-vis Linux and logical partitions. Actually, I wish that method was more popular.

    P.S.: Here is a thread with a summary of every dual booting method that I could think of, one of which is your link's "active primary partition" method...
    Last edited by stoat; 8th January 2009 at 03:38 AM.

  4. #4
    Join Date
    Sep 2005
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    First off, THANKS! That's the most clear explanation of this stuff I've seen so far. I bow down to your boot mastery =)

    I have a few questions for you, I'll try to make them brief (to read *and* to answer)

    1) In case I botch up somewhere, would backing up the first 512 bytes of sda (dd if=/dev/sda of=some_file bs=512 count=1) be enough to preserve the boot sector no matter what?

    2) Would this work if I only backed up the first 446 bytes, changed the partition table (for whatever reason), and then restored (in case I screwed up)? i.e. would the old mbr be able to boot with the new partition table, assuming the boot partition wasn't moved?

    3) Would either of the windows boot methods (the active partition or the NTLoader) allow me to do the following sequence: a) hibernate from windows b) boot into linux c) reboot d) come out of hibernation in windows?

    4) I understand that the "magic" button stuff would be lost if the MBR is messed up, but is there any reason that the proper GRUB menu entries wouldn't be able to reproduce the same functions (i.e. let me boot into the recovery partition) less magically? I think GRUB should be able to do everything, but I couldn't figure out how to do this when I installed GRUB into the MBR before.

    5) Is there a way to read the MBR and interpret what it does (so I can reverse engineer what the magic loader is doing). I figure it's a maximum of 512 bytes, so 512 assembly instructions?

    I hope that's not too many questions. Feel free to just say "no" without explanation if it helps =)
    Last edited by HawkBoy; 8th January 2009 at 11:45 PM.

  5. #5
    Join Date
    Jun 2006
    Posts
    7,544
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by HawkBoy

    1) In case I botch up somewhere, would backing up the first 512 bytes of sda (dd if=/dev/sda of=some_file bs=512 count=1) be enough to preserve the boot sector no matter what?
    I consider that a true statement. I have done that and restored from it myself. But also remember that in a disaster requiring that kind of repair, the computer very likely will not boot. So store the backup on a alternative medium off of the hard drive and have a way to boot the computer for the repair (e.g., a LiveCD). I also use the free utility MbrWizard to backup up master boot records. It's a tiny DOS app that will fit on a bootable floppy, pen drive, or CD.

    Quote Originally Posted by HawkBoy

    2) Would this work if I only backed up the first 446 bytes, changed the partition table (for whatever reason), and then restored (in case I screwed up)? i.e. would the old mbr be able to boot with the new partition table, assuming the boot partition wasn't moved?
    That also sounds like a true statement, and I have read about other people doing it. But I have not done that myself. The partition table begins with the 447th byte of the master boot record and is 64 bytes long. Now, 446+64=510. The final two bytes of the 512-byte master boot record is the so-called signature ID. You can learn a lot about master boot records here...It was originally the work of Starman, but the page now appears to be maintained at cgsecurity.org (the TestDisk people).

    Quote Originally Posted by HawkBoy

    3) Would either of the windows boot methods (the active partition or the NTLoader) allow me to do the following sequence: a) hibernate from windows b) boot into linux c) reboot d) come out of hibernation in windows?
    Well, of one thing I am certain (because I just tried It). If you multi-boot with NTLoader and hibernate Windows, when the computer is next powered up you are not presented with the NTLoader boot menu, and Windows is instead immediately recovered from hibernation. So in that multi-booting scenario, it would not be possible to reboot into Linux while Windows is hibernated (but a boot floppy or boot CD might boot Linux while Windows is hibernated). I'm having a difficult time predicting how things would play out in the "active partition" scenario. Hibernating Windows would power down the computer, but when it is powered up again, GRUB would start first. In my imagination, you could choose normally from the GRUB menu at that point. Choosing Linux would boot Linux, and choosing Windows would recover Windows from hibernation (in my imagination). Maybe somebody else has done that and knows the answer.

    Quote Originally Posted by HawkBoy

    4) I understand that the "magic" button stuff would be lost if the MBR is messed up, but is there any reason that the proper GRUB menu entries wouldn't be able to reproduce the same functions (i.e. let me boot into the recovery partition) less magically? I think GRUB should be able to do everything, but I couldn't figure out how to do this when I installed GRUB into the MBR before.
    I don't know anything about GRUB launching Thinkpad special functions. But installing GRUB in the master boot record would (I think) allow you to boot into Linux after Windows has been hibernated (see the previous paragraph again).

    Quote Originally Posted by HawkBoy

    5) Is there a way to read the MBR and interpret what it does (so I can reverse engineer what the magic loader is doing). I figure it's a maximum of 512 bytes, so 512 assembly instructions?
    Yes. Use a hex editor for that. I like ghex in Linux. It is in the Fedora repository and can be installed with yum. But there are many others. There is even a Windows version hex editor called DiskProbe "hidden" on the XP installation CD. I learned most of what I know about boot records from Starman as mentioned earlier.
    Last edited by stoat; 10th January 2009 at 03:27 AM.

  6. #6
    Join Date
    Sep 2005
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    I got everything to work, so I thought I'd post what the solution/problem was.
    My final setup keeps all the "magic" thinkvantage stuff working and boots linux without a problem.

    The basic steps that worked were:
    1) resize the second partition (sw_preload), which is the main ntfs data partition on the lenovo.
    2) install linux WITHOUT overwriting the MBR (add GRUB to the primary linux partition only)
    3) Use EasyBCD to add the primary linux partition as a boot option.

    Details and problems to avoid:
    In step 1) GParted worked great for this. I booted up with the liveCD, yum install gparted, and then used the great gparted GUI. Make sw-preload smaller and leave the extra space free for the linux patition.
    This is where my initial attempts failed. You have to make sure you UNSELECT the "align partitions to cylinders" option. The default lenovo partitions are not aligned. If you leave this option selected, it will move the start of the partitions and the windows boot loader will break (then the thinkvantage system tries to fix things and completely destroys the install).
    Also, automounting was making things difficult (it was mounting between GParted's operations). I'm not sure if this is absolutely necessary, but I disabled gnome's automount (for root and liveCD's default user) using gconf-editor; install/run gconf-editor, go to apps > nautilus > preferences > media_automount.

    In step 2) Everything is simple enough. I manually modified the linux partition setup to include an extra ntfs partition.

    In step 3) EasyBCD screwed up once and on Vista, you can't fix the boot setup by just editing a text file. You need a vista boot dvd, and since lenovo doesn't provide one, I had to recover from an image...
    Also, make sure that if you set fedora to be the default, you add a delay for the selector, otherwise, you can only get back into windows by holding down an arrow key during boot and crossing the fingers on your other hand =)


    Other details:
    The dd method mentioned a few posts back is great for backing up the partition table and MBR.
    I recommend partimage for backing up your original lenovo partitions. In case you mess things up, this lets you recover using those images instead of the incredibly slow lenovo recovery cd/dvds.

    A copy of my fdisk -l:

    Device Boot Start End Blocks Id System
    /dev/sda1 * 1 192 1534976 7 HPFS/NTFS
    Partition 1 does not end on cylinder boundary.
    /dev/sda2 192 5413 41943040+ 7 HPFS/NTFS
    Partition 2 does not end on cylinder boundary.
    /dev/sda3 5413 18183 102569983+ 5 Extended
    Partition 3 does not end on cylinder boundary.
    /dev/sda4 18183 19458 10240000 7 HPFS/NTFS
    Partition 4 does not end on cylinder boundary.
    /dev/sda5 5414 5439 196560 83 Linux
    /dev/sda6 5439 9355 31457128+ 8e Linux LVM
    /dev/sda7 9355 18183 70908928 7 HPFS/NTFS

    None of this stuff is that hard, but I would have found a post like this helpful when I started, so...

    Also, thanks stoat for all the help =)

Similar Threads

  1. Dual-Booting Fedora 11 and Vista (Vista installed first)
    By Myrcroft in forum Installation, Upgrades and Live Media
    Replies: 6
    Last Post: 13th September 2009, 01:25 AM
  2. Dual booting Vista + Fedora 11 help - I'm worried about Vista.
    By EJ123 in forum Installation, Upgrades and Live Media
    Replies: 10
    Last Post: 16th August 2009, 08:26 PM
  3. Replies: 4
    Last Post: 23rd April 2009, 03:25 AM
  4. Replies: 0
    Last Post: 15th December 2008, 08:21 PM
  5. Dual Boot Vista/Fedora9 - Vista not booting
    By agb81 in forum Installation, Upgrades and Live Media
    Replies: 6
    Last Post: 6th August 2008, 05:07 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
[[template footer(Guest)]]