Linux and Windows 7 Dual Boot

The pre-installed Windows Vista Home in my laptop just pissing me off. It came to a point where most shortcuts in "My Documents" do not work anymore as it prompts me that I don't have the rights to those directories. My open source programs kept on crashing. Until I decided to dual boot it with PCLinuxOS 2009.

The choice of PCLinux 2009 was that, it was the only LiveCD distro (and Mandriva Live) that enabled my wireless connectivity out-of-the-box. It was unfortunate that Ubuntu, gOS, Fedora Core nor Zenwalk failed in that respect.

The installation of PCLinuxOS was a breeze with no glitch at all. The bootloader was able to detect the current Windows. I was able to dual boot Linux with Windows Vista. Now came Windows 7. I decided to upgrade my pre-installed OS with this much hyped Windows.  Like the PCLinuxOS 2009 installation, I did not have any problem not until I want to boot on my PCLinuxOS. Windows 7 have overwritten GRUB boot loader and failed (or deliberately did not) to include non-Windows operating systems.

Why do I still need Windows where in fact I have my Linux? Well, I still use some Windows only programs. I only use it for these programs nothing else.

Back to my problem, how can I reactivate my Linux. I don't want to re-install it as I did so much custom configuration and I don't want to lose them. I tried searching the net about GRUB re-installation. The simplest is Doctor's Blog.

To summarize the steps in re-installing GRUB:

  1. Boot with the PCLinuxOS 2009 LiveCD as root
  2. Open terminal as a super user
  3. Type "grub" then enter. The grub> prompt will appear.
  4. Type grub>find /boot/grub/stage1 then enter. A list similar to this will appear.
    (hd0,0)
    (hd0,4)
    (hd0,5)
  5. You need to know which partition your Linux OS is located. In my case it is (hd0,4) thus I typed the commands
    grub> root (hd0,4)
    grub> setup (hd0)
  6. Exit GRUB by typing "quit"
  7. Restart you computer. The GRUB bootloader should now appear.

In my case, the problem did not stop there. If I select Windows 7, it just fail to start. So, at this instance, my Linux works but my Windows not.

I remembered that during the installation of Windows 7, there was a menu about repair so I tried clicking it, then selected restore from a previous restore point. After this process, I restarted my laptop and was able to boot either PCLinuxOS or Windows 7 without any glitch at all.

890 = 888 = 920

About the Author

Ver Pangonilo

A Filipino Engineer, Registered Professional Engineer of Queensland (RPEQ) – Australia and Professional Electrical Engineer (PEE) – Philippines with extensive experience in concept select, front-end engineering, HV & LV detail design, construction and commissioning of Hazardous and Non-Hazardous Area electrical installations in water and waste water pipeline and pumping facilities, offshore platforms, hydrocarbon process plants and pipelines including related facilities. Hazardous area classification and design certification (UEENEEM015B, UEENEEM016B, UEENEEM017B).

  • Bruno

    Thanks! This was just what I needed to get my triple boot (WinXP-Win7-PCLinuxOS) system up and running after installing Win7.

    I will say though, I was able to boot into PCLinux afterward, and then you have a few ways to get Windows back without having to use

    Windows Repair or system restore.

    1.) manually edit “/boot/grub/menu.lst”, adding an entry for windows boot manager like this

    title Windows Boot Manager
    root (hd0,0)
    chainloader +1

    supposedly hd0,0 is always where Windows 7 places it’s boot manager (for instance replacing my WinXP MBR).

    2). open the PCLinuxOS Control Center, go to the Boot menu, and modify the existing boot manager by adding an entry for

    non-Linux/Windows OS.

    Also another relevant tip: you know how the Windows 7 boot menu gives you choice to boot Windows 7 or the “Previous windows version”?

    Well I wanted it to say “Windows XP Home”. Here’s how you do that:
    a.) open Administrative command prompt
    b.) type bcdedit /set {legacy} Description “Windows XP Home”

    of course you can change that to any name you want. Then if you want to boot the old Windows as default, do this:
    c.) bcdedit /default {legacy}

    Part c.) can also be done in Windows 7 in the system properties advanced menu if you prefer a GUI.

  • old-polack

    Ver,

    You’re more than welcome. Looks much nicer now. ;-D

    Cheers back at ya.

    O-P

  • Ver

    Hi old-polack,

    I have updated & corrected the steps. Thanks a lot.

    Cheers,

    Ver

  • old-polack

    Ver,

    Seriously, you need to rewrite the part in the article above, where you summarize the grub commands from the Doctor’s Blog. Trust me on this, as I’m the guy who wrote the original post, that Doctor Tux used for that blog article. As current written in your article, it won’t work, You need the “root (hd0,4)” line to tell grub which partition’s grub to use, and the setup line needs to point to the MBR of the disk, (hd0)

    As written above, you say;

    In my case it is (hd0,4) thus I typed the command
    setup (hd4,0)

    first, the drive and partition numbers are transposed, and that should be the line;

    grub> root (hd0,4)

    followed by;

    grub> setup (hd0)

    then

    grub> quit

    I’m not trying to be picky, as the article overall is great, but it also needs to be accurate in the details where grub is concerned, or it loses credibility for those who try the commands as presently written, and they don’t work.

  • parnote

    Ver,

    Thank you for the permission to reprint your blog entry in the PCLinuxOS Magazine. LOL … I don’t know why I didn’t think of posting a reply when I was looking for a way to contact you.

    parnote

  • Robert Chambers

    The person who runs the PClinuxOS Magazine has looked on your blog site for a way to contact you to ask for permission to add this article to the PClinuxOS Magazine.

    If you decide to go to the PClinuxOS forums he is known as parnote

    • Ver

      Hi Robert,

      Please do so, It is my pleasure to have my blog be added into the PCLinuxOS Magazine.

      Cheers,

      Ver

  • old-polack

    Your grub commands are wrong.

    grub.> find /boot/grub/stage1
    (hd0,4)

    grub> root (hd0,4)

    grub> setup (hd0)

    grub> quit

  • Phil Wadsworth

    If you make a LiveCD remaster of your running PCLinuxOS system then you can use this to put your full Linux configuration back to what it was if it gets borked, including the Grub menu. I’ve done this several times afrer playing around with Windows installs on my dual boot machine.

  • David

    PCLos and Mandriva make it even simpler – no CLI. With the Live disk go to “Configure My Computer” -> “Boot” section -> “Set Up Boot System” and it will do it for you. You can also easily change the default OS (if you really want) and do further tweaks although I just suggest you agree to everything as you go along. Also in the System menu you have “Redombr” which basically show you your boot (grub) configuration.

Facebook Auto Publish Powered By : XYZScripts.com