Re: hibernate, then start Windows [SOLVED]



On Tue, 2010-08-31 at 07:38 -0600, Greg Woods wrote:
This is in regard to the issue that, when Linux is hibernated, upon
reboot the thaw starts immediately and the grub menu is not presented.

I am now absolutely convinced this is not a BIOS issue, it is a kernel
or boot loader issue.

I worked around it by adding a level of indirection to the boot process.
To do this requires that you have at least one Linux partition that is
not / or /boot.

The basic idea is that Linux is booted with a chainloader, same as
Windows. So the main grub menu gives you a choice of Linux or Windows,
and both are implemented with "chainloader +1" stanzas. It works, but I
don't recommend trying this unless you are fairly familiar with how the
boot loader works, and are comfortable reinstalling the boot loader from
a rescue CD/DVD if something goes wrong.

The high-level instructions go like this:

1) In your extra Linux partition, create "boot" and "boot/grub"
directories.
2) Copy the contents of /boot/grub to this new grub directory.
3) Edit the boot/grub/grub.conf file in this new directory so that
Windows and Linux are presented as "chainloader +1" stanzas.
4) Install grub in the master boot record, pointing to this partition
5) Install grub in the first sector of your root partition, with the
usual kernel choices.

When this is done, at boot time you get a choice of Linux or Windows. If
you select Linux, the second boot loader comes up with the usual choice
of kernels. If Linux is hibernated, you can then boot and run Windows
just fine (my Windows install doesn't have a hibernate option so I
wasn't able to test hibernating Windows in this scenario). If you boot
again and select Linux, instead of getting the choice of kernels, it
immediately resumes the hibernated image. This is how I *want* it to
work, so I have left it this way.

Suppose you have this:

/dev/sda1 Windows
/dev/sda2 Linux root
/dev/sda3 Linux /local

Then /boot/grub gets copied to /local/boot/grub, then
edit /local/boot/grub/grub.conf so that you have something like this:

title Linux
root (hd0,1)
chainloader +1
title Windows
root (hd0,0)
chainloader +1

Then run:

# grub
[...]
grub> root (hd0,2)
grub> setup (hd0)

This loads the master boot record that points to /dev/sda2, the
chainloader configuration.

Now edit /boot/grub/grub.conf and remove the Windows stanza (you don't
need it here any more). Then run:

# grub
[...]
grub> root (hd0,1)
grub> setup (hd0,1)

This loads grub into the first sector of the Linux root partition,
pointing at that partition and presenting the usual choice of kernels.

This has worked great for me. I can now hibernate Linux, boot into
Windows, and later resume from the hibernated Linux image.

--Greg



A more elegant solution would be to hack the script responsible for
modifying grub.conf at hibernate time, and put an reasonable timeout
there (let's say 5-10 secs) to let you choose the windows entry.

Of course, you will have to redo this hack everytime pm-utils will
update.

HTH,
--


Calin

Key fingerprint = 37B8 0DA5 9B2A 8554 FB2B 4145 5DC1 15DD A3EF E857

=================================================
Children's talent to endure stems from their ignorance of alternatives.
-- Maya Angelou, "I Know Why the Caged Bird Sings"

--
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines



Relevant Pages

  • fixing grub : mbr fix when windows install after linux
    ... "There is not a boot manager screen at all, ... windows but GRUB boot window does not appear. ... "I forgot to install GRUB, I didn't install GRUB in the MBR, I chose ... Fedora but that was not an active primary partition". ...
    (comp.os.linux.misc)
  • Re: wrong boot partition
    ... then in windows disk manager the Ubuntu partition was made active, of cause when rebooted it starts the live cd, now its just getting it back to windows and finding a boot manager so one or the other can be booted to as and when its wanted ... Grub on the other hand, doesn't absolutely need the boot flag. ... Linux will load the MBR with grub boot code. ...
    (microsoft.public.windowsxp.general)
  • Re: Fedora Core 5 Installation
    ... Check out the grub manual ... The manual also has the instructions for what commands to issue to alter your OS boot instructions at boot time. ... The first thing I did was burn Fedora Core 5 CDs and tried installing it on my hard drive partition that I created by resizing my Windows XP Pro partition. ... Because I wanted to dual boot Windows and Linux, and also from the instructions in the Fedora Core 5 Installation Manual, I opted for GRUB boot loader. ...
    (Fedora)
  • Re: dual boot with WinXP
    ... > Which boot loader should I use? ... Well, you didn't say which Linux distro you installed, ... Both of them will boot Windows, ... maintain than the 'grub' boot-loader; ...
    (comp.os.linux.setup)
  • Re: F7-x86-64 Stopped Booting - GRUB Issue
    ... I got the latest kernel and other updates via yum as I normally do, but when I went to reboot, all I got was a simple text message saying "GRUB" in the upper left hand corner of my screen, and that's all I've gotten ever since. ... I just tried to do an upgrade install of Fedora 7 to fix the issue, and specifically told it to replace the boot loader configuration on the proper partition, but that didn't work to correct the issue. ... A little more detail is that I'm using the Windows XP boot.ini/boot configuration to load WinXP or to load GRUB which in turn loads Linux. ...
    (Fedora)