LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-24-2010, 03:09 AM   #1
NDR008
Member
 
Registered: Nov 2006
Location: (Bristol or Coventry) (UK) or Malta
Distribution: openSUSE 11.0
Posts: 173

Rep: Reputation: 30
Grub XP option reloads grub


Yesterday I installed EasyPeasy (an Ubuntu based distro) on my netbook.

Somehow I mucked up the installation of grub...

/dev/sda1 * 1 9407 75561696 7 HPFS/NTFS
/dev/sda2 9408 18813 75552769 5 Extended
/dev/sda3 18814 19451 5124735 1c Hidden W95 FAT32 (LBA)
/dev/sda4 19452 19457 48195 ef EFI (FAT-12/16/32)
/dev/sda5 9408 14271 39062528 83 Linux
/dev/sda6 14271 18689 35489792 83 Linux
/dev/sda7 18689 18813 998400 82 Linux swap / Solaris


/dev/sda1 = Windows Partition with XP
/dev/sda5 = My linux partition
/dev/sda3 = Windows Recovery stuff

Now, during the installation of EasyPeasy, I installed the bootloader on /dev/sda1 and NOT /dev/sda.

As a result, Windows was not available

So I then ran:
sudo update-grub

And an option to book /dev/sda1 came up as Windows XP.

However when I select /dev/sda1 Windows XP, it re-loads the bootloader itself.
What do I have to edit to (if possible) leave the bootlader in /dev/sda1 (dislike it being on the MBR out of fear of mucking the MBR up and making the whole system useless), and making the option /dev/sda1 Windows XP point to the actual boot up of Windows and not the bootloader itself?

menuentry "Microsoft Windows XP Home Edition (on /dev/sda1)" {
insmod ntfs
set root='(hd0,1)'
search --no-floppy --fs-uuid --set 7ae0a82de0a7ee17
drivemap -s (hd0) ${root}
chainloader +1

This is the entry that re-loads itself....

Thanks in advance.
 
Old 05-24-2010, 05:05 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,144

Rep: Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308Reputation: 2308
Quote:
Originally Posted by NDR008 View Post
Y/dev/sda1 * 1 9407 75561696 7 HPFS/NTFS
/dev/sda2 9408 18813 75552769 5 Extended
/dev/sda3 18814 19451 5124735 1c Hidden W95 FAT32 (LBA)
/dev/sda4 19452 19457 48195 ef EFI (FAT-12/16/32)
/dev/sda5 9408 14271 39062528 83 Linux
/dev/sda6 14271 18689 35489792 83 Linux
/dev/sda7 18689 18813 998400 82 Linux swap / Solaris


/dev/sda1 = Windows Partition with XP
/dev/sda5 = My linux partition
/dev/sda3 = Windows Recovery stuff
When grub's screen comes up, hit the letter e
whatever line you had highlighted will come up. Hit e again, and you can edit that line. Then press return to finish, and b to boot from it.
I thing you may have a problem with disk numbering, or the location of your kernel.

Last edited by business_kid; 05-24-2010 at 05:10 AM.
 
Old 05-24-2010, 05:09 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,103

Rep: Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117
Quote:
Originally Posted by NDR008 View Post
...What do I have to edit to (if possible) leave the bootlader in /dev/sda1 (dislike it being on the MBR out of fear of mucking the MBR up and making the whole system useless)
Well you've already proven how wrong that attitude is.
The MBR is easy to fix - from both Linux and XP. On the other hand you have potentially over-written vital data within the XP partition. It certainly can't be fixed with a simple edit. Search for "fixmbr" here on LQ - this comes up all the time.
Even with "classic" grub couldn't always be recovered by the M$oft utility - I have no idea how many sectors grub2 overwites.
 
Old 05-24-2010, 05:14 AM   #4
NDR008
Member
 
Registered: Nov 2006
Location: (Bristol or Coventry) (UK) or Malta
Distribution: openSUSE 11.0
Posts: 173

Original Poster
Rep: Reputation: 30
Well, linux loads fine from GRUB (which I know realised is grub2), which is on /dev/sda5
Windows XP is on /dev/sda1 which on grub I gather would have been called hd0,0 but on grub2 is now referred to as hd0,1.

The hard disk pre-linux had 3 partitions:
XP Parition NTFS C:\
Empty NTFS D:\
hiden parition FAT32 used to restore windows on the netbook (since it has no CD-ROM)

I deleted the second partition, and created:
a partition /
a parition /home
and the swap parition

Grub gives:
Linux....
Linux recovery...
Memtest
Memtest (some variation of above)
Windows XP
Windows (the hidden parition)

They all load except windows XP. During the GUI installation of this distro, I chose to install /dev/sda1 which was the bootable partition.
I would even be happy removing grub completely off /dev/sda1 because I did not like this distro and want to go for nbr ubuntu.

Thanks again.
 
Old 05-24-2010, 05:16 AM   #5
NDR008
Member
 
Registered: Nov 2006
Location: (Bristol or Coventry) (UK) or Malta
Distribution: openSUSE 11.0
Posts: 173

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by syg00 View Post
Well you've already proven how wrong that attitude is.
The MBR is easy to fix - from both Linux and XP. On the other hand you have potentially over-written vital data within the XP partition. It certainly can't be fixed with a simple edit. Search for "fixmbr" here on LQ - this comes up all the time.
Even with "classic" grub couldn't always be recovered by the M$oft utility - I have no idea how many sectors grub2 overwites.
Hehe, true, live and learn. I have done it this way in the past, but obviously, now it would seem MBR was the right way to go... *sighs*

Well, if I have no resort, I will just restore XP from the hidden partition, it is not the end of the world. Would rather not though.
 
Old 05-24-2010, 05:45 AM   #6
NDR008
Member
 
Registered: Nov 2006
Location: (Bristol or Coventry) (UK) or Malta
Distribution: openSUSE 11.0
Posts: 173

Original Poster
Rep: Reputation: 30
Got an idea I will try once I get home (why oh why did I not get my netbook, guess was assuming my (some overpaid) lecturers to be in on time at uni...)
Will make a USB drive with the XP recovery console.
Use the fixboot function
fixboot Drive:

Fingers crossed, will let you know, if anyone has any ideas, let us know please.
 
Old 05-24-2010, 05:52 AM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,103

Rep: Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117
Yeah sorry, fixboot is what you need, not fixmbr. Was going to correct my post, but you picked up my error first.
G'luck - sometimes it works, sometimes not.
 
Old 05-24-2010, 06:01 AM   #8
NDR008
Member
 
Registered: Nov 2006
Location: (Bristol or Coventry) (UK) or Malta
Distribution: openSUSE 11.0
Posts: 173

Original Poster
Rep: Reputation: 30
When I had installed grub in the MBR and had issues many many years ago, it was fixmbr - and it is the most often recited step - so easy mistake there
 
Old 05-24-2010, 11:07 AM   #9
NDR008
Member
 
Registered: Nov 2006
Location: (Bristol or Coventry) (UK) or Malta
Distribution: openSUSE 11.0
Posts: 173

Original Poster
Rep: Reputation: 30
After much searching and swearing because most USB pendrive bootable XP recovery consoles work on 2GB or less pendrives, I found a modern one:

Problem solved, follow this guide:
http://tuts4tech.net/2009/07/14/crea...overy-console/

With one modification, when you open a CMD to run BootSect.exe, open the CMD as administrator, because BootSect.exe will require very high level admin rights to the USB drive.

Reboot from USB pendrive on the netbook (or victim PC),
let the recovery console boot
select the windows installation damage

fixboot

Done! Then get ready to re-install a better Linux distro till you have the sanity to never go Windows again!
If you want to keep the Linux installation you had and XP, I suggest re-installing the Linux Distro, some have a recovery function that re-installs the bootloader, just choose the MBR this time OR find a Windows resident and Windows based grub installation or other bootloader.

Last edited by NDR008; 05-24-2010 at 11:17 AM.
 
  


Reply

Tags
grub2, netbook, recovery, windows, xp


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing GRUB-GRUB, GRUB-LILO and vice versa andreas_skw Linux - Newbie 1 06-05-2008 06:40 AM
Booting my new ubuntu install = "GRUB GRUB GRUB GRUB GRUB" etc. dissolved soul Ubuntu 2 01-13-2007 12:55 PM
Grub - fallback option? coralsaw Debian 9 12-21-2005 07:07 AM
GRUB option Rªdical_£D SUSE / openSUSE 13 09-18-2005 12:31 PM
dual rh 9 no grub option BobNz Linux - Newbie 6 05-02-2004 11:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration