From: Peter Ruskin <peter.ruskin@dsl.pipex.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Dual booting Dell with Windows 7
Date: Mon, 1 Mar 2010 15:04:36 +0000 [thread overview]
Message-ID: <201003011504.36971.peter.ruskin@dsl.pipex.com> (raw)
In-Reply-To: <358eca8f1002281551x4030c222rdaee05756bb00abd@mail.gmail.com>
On Sunday 28 February 2010 23:51:21 Mick wrote:
> I have now succeeded at achieving what I wanted: to use the
> Windows 7 boot manager (bootmgr.exe) which is the successor to
> NTLDR to chainload GRUB from it and so leave the Windows
> installation intact (at least until the warranty expires) ;-)
>
> I very briefly detail here the steps that I followed - if you
> need more please contact me and I will help if I can, or if I get
> some time I will sign up to edit a Wiki page.
>
> First the necessary WARNING: You can render your MSWindows OS
> unbootable and without an installation CD things can get hairy.
> So research the necessary steps to recover a borked MSWindows
> boot system using the facilities offered by the OEM *before* you
> start and use partimage to make a back up, just in case.
>
> There's two or three gotchas that make this more difficult than
> chainloading GRUB from NTLDR.exe under Win2k and WinXP:
>
> 1. Disk and partition signatures in the MBR are used by Vista
> and Windows 7 to find the active boot partition of MSWindows. If
> you move that partition then its disk offset changes and you
> start getting errors like "winload.exe..... is missing or
> corrupt", when what has actually happened is that the drive ID
> (partition signature) has changed and BCD doesn't know about it.
>
> 2. OEMs use additional partitions to save installation images
> for recovery purposes and they often mark these as active boot
> partitions. The boomgr and BCD is consequently installed there as
> part of the installation script - but it doesn't clearly tell you
> this in the BCD file (that's the new boot.ini) unless you can
> decipher partition ID signatures. Remove that recovery partition
> to save space and your MSWindows won't boot again.
>
> 3. Windows 7 uses BitLocker on the IPL in the MBR and this may
> introduce additional complications - you mess with the MBR and
> then kiss goodbye to booting your MSWindows bloatware again.
>
> My solution worked by editing the BCD file using the native
> editor provided by MSWindows, the bcdedit command. The
> winload.exe (which partly replaces NTLDR) is thereafter used
> normally to launch an image of the GRUB partition boot record and
> that of course knows where to jump to launch your Gentoo.
> There's no need for 3rd party boot managers - there are two or
> three available like Neogrub which should do the same job by
> offering you a GUI, but if you are capable enough to install
> Gentoo then you can easily find your way around the BCD file with
> bcdedit.exe.
>
> The main steps to achieve this solution are:
>
> 1. Install GRUB in your Linux /boot partition and capture an
> image of the partition boot record (it must be unmouted at the
> time):
>
> dd if=/dev/sda5 of=boot.lnx bs=512 count=1
>
> 2. Copy the boot.lnx file to C:\boot.lnx
>
> 3. Launch cmd.exe as administrator and call bcdedit /v which
> will show you something like this:
> ====================================================
> C:\Windows\system32>bcdedit /v
>
> Windows Boot Manager
> --------------------
> identifier {9dea862c-5cdd-4e70-acc1-f32b344d4795}
> device partition=\Device\HarddiskVolume2
> path \bootmgr
> description Windows Boot Manager
> locale en-US
> inherit {7ea2e1ac-2e61-4728-aaa3-896d9d0a9f0e}
> default {fda5ebf3-119b-11df-969c-f924691e8117}
> resumeobject {5744906c-0bf4-11df-8e08-0026b920b49c}
> displayorder {fda5ebf3-119b-11df-969c-f924691e8117}
> {fda5ebf6-119b-11df-969c-f924691e8117}
> toolsdisplayorder {b2721d73-1db4-4c62-bf78-c548a880142d}
> timeout 3
>
> Windows Boot Loader
> -------------------
> identifier {fda5ebf3-119b-11df-969c-f924691e8117}
> device partition=C:
> path \Windows\system32\winload.exe
> description Windows 7 Home Premium
> locale en-US
> recoverysequence {5744906e-0bf4-11df-8e08-0026b920b49c}
> recoveryenabled Yes
> osdevice partition=C:
> systemroot \Windows
> resumeobject {5b312091-116a-11df-8b54-806e6f6e6963}
> ====================================================
>
> The first entry is the bootmgr, the second is MSWindows OS
> partition. First make a back up of the BCD file:
>
> C:\Windows\system32>bcdedit /export C:\BCD_backup
>
> Then create a new entry using bcdedit for the Linux boot image,
> by entering: ====================================================
> bcdedit /create /d "Gentoo Linux2" /application BOOTSECTOR
> The entry {fda5ebf7-119b-11df-969c-f924691e8117} was successfully
> created. ====================================================
>
> Cut and paste the partition ID in all the subsequent commands:
> ====================================================
> bcdedit /set {fda5ebf7-119b-11df-969c-f924691e8117} device boot
>
> bcdedit /set {fda5ebf7-119b-11df-969c-f924691e8117} path
> /boot.lnx
>
> bcdedit /set {fda5ebf7-119b-11df-969c-f924691e8117} locale en-US
> ====================================================
> If you don't get "The operation completed successfully." you know
> you've done something wrong.
>
> Then set it as last in the menu:
> ====================================================
> bcdedit /displayorder {fda5ebf7-119b-11df-969c-f924691e8117}
> /addlast The operation completed successfully.
> ====================================================
>
> and increase the delay before the menu automatically boots the
> default (leave the default as MSWindows until you prove that your
> Linux system can boot):
> ====================================================
> bcdedit /timeout 10
> ====================================================
>
> Then run C:\Windows\system32>bcdedit /v to see what you have just
> made, at the bottom of the menu:
> ====================================================
> Real-mode Boot Sector
> ---------------------
> identifier {fda5ebf6-119b-11df-969c-f924691e8117}
> device boot
> path \boot.lnx
> description Gentoo Linux
> locale en-US
> ====================================================
>
> Now, this may not boot if your MSWindows boot drive is different
> to the MSWindows OS partition (as was in my case). So, we need
> to point the bootmgr at the partition where the linux boot image
> resides, in my case C:
> ====================================================
> bcdedit /set {fda5ebf7-119b-11df-969c-f924691e8117} device
> partition=C: ====================================================
>
> Use the /v option to check all is good and reboot the machine.
> Hopefully, you will be greeted with a GRUB splash. :-)
Thanks for the howto, Mick. I followed it on my Windows Vista Home
Premium 64; got "The operation completed successfully" all the way
through, but on reboot I don't get a boot menu.
This doesn't matter much to me at the moment, as I use Acronis OSS
Selector for boot manager, but this doesn't work on Windows 7, so
my free update to Windows 7 is gathering dust.
--
Peter
========================================================================
Gentoo Linux: Portage 2.2_rc63 kernel-2.6.32-gentoo-r5
AMD Phenom(tm) 9950 Quad-Core Processor gcc(Gentoo: 4.4.3)
KDE: 3.5.10 Qt: 3.3.8b
========================================================================
next prev parent reply other threads:[~2010-03-01 15:05 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-13 15:09 [gentoo-user] Dual booting Dell with Windows 7 Mick
2010-02-13 17:13 ` Willie Wong
2010-02-15 23:45 ` Mick
2010-02-17 1:12 ` Peter Humphrey
2010-02-17 6:58 ` Mick
2010-02-17 10:31 ` Willie Wong
2010-02-28 23:51 ` Mick
2010-03-01 1:46 ` Willie Wong
2010-03-01 15:04 ` Peter Ruskin [this message]
2010-03-01 18:09 ` Mick
2010-03-02 14:31 ` Mick
2010-03-02 23:31 ` Peter Ruskin
2010-03-05 20:03 ` Mick
2010-02-17 12:28 ` Peter Humphrey
2010-02-18 0:16 ` Peter Humphrey
2010-02-17 9:53 ` Nick Cunningham
2010-02-17 22:23 ` Mick
2010-02-13 23:42 ` [gentoo-user] " walt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201003011504.36971.peter.ruskin@dsl.pipex.com \
--to=peter.ruskin@dsl.pipex.com \
--cc=gentoo-user@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox