LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 04-01-2007, 05:10 PM   #1
ngjunkie0011
Member
 
Registered: Jun 2005
Location: New York
Distribution: Ubuntu Studio
Posts: 105

Rep: Reputation: 15
Uninstalling GRUB (unique scenario) from HD to enable XP boot-up


Here is the scenario:

I have 2 hard drives, the primary set up as Master with XP on it.

The other HD is set up as slave and has SuSE 10.2 installed.

It used to boot up fine for a couple of weeks but now it refuses to boot, when GRUB tries to kick in I get the following error:

GRUB loading, please wait....
Error 21.

It looks like the "/" partition is damaged and is unable to boot. I used my SuSE 10.2 to try and fix GRUB to confirm this, the setup utility can see my other partitions but fails to repair GRUB, I get an error about a non-existing partition.

I took off the HD with XP on it, configured as Master the HD with Linux and tried reinstalling SuSE 10.2. Not only did this not work but it brought down my PC, it refused to turn on as if the power supply was dead.

I think the HD is completely dead by now but I'd rather just buy another HD and start all over again.

Now here is the question -----> how do I get rid of GRUB installed on the HD with XP so I can boot into XP??

I've tried EVERYTHING that I know of windows-wise and it didn't work! I already boot up using the XP CD, ran fixboot, fixmbr, and nothing seems to work! I don't know what GRUB did or where it's installed but it refuses to go away, yelp!!!!!!
 
Old 04-01-2007, 07:22 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Boot up a Linux liveCD and let's see what "/sbin/fdisk -l" says.
 
Old 04-01-2007, 07:32 PM   #3
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 133Reputation: 133
That brings back painful memories. When I ran into a similar issue about six months ago, I had to install XP64 all over again, there was just no way to fix it Even the reinstall failed at first until I unplugged my second disk and deleted all the partitions on the first one.

Btw, if you have your XP disk on slave right now, you may need to make it master again. I doubt whether XP can boot off a slave disk.
 
Old 04-01-2007, 11:49 PM   #4
ngjunkie0011
Member
 
Registered: Jun 2005
Location: New York
Distribution: Ubuntu Studio
Posts: 105

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by jay73
That brings back painful memories. When I ran into a similar issue about six months ago, I had to install XP64 all over again, there was just no way to fix it Even the reinstall failed at first until I unplugged my second disk and deleted all the partitions on the first one.

Btw, if you have your XP disk on slave right now, you may need to make it master again. I doubt whether XP can boot off a slave disk.
I know how to work with windoze systems, I'm trying to learn Linux and get more into open source appz and development. I have 2 PC's, an old and a new one, the new one has XP and Linux, the old one has XP. I very rarely use the new PC with XP but I do have a bunch of data that I would like to save and it's going to take me some time for me to copy to another HD. Right now I have the HD from the new machine with XP setup as slave on the old machine and it looks like a normal HD with an NTFS partition, that's weird.

The easiest solution is going to be for me to just get a new HD, install SuSE 10.2 on that one and then GRUB will reconfigure itself to do the dual-boot. Unfortunately I don't have a lot of time and money is a little tight and I have some data on the HD with Linux, I'm going to work on it for a few days see if I can get the data off of it, meanwhile I have to use the old PC with XP on it.

If you know of any utilities for windows that lets me see/fix Linux native partitions please let me know!!!
 
Old 04-02-2007, 12:18 AM   #5
ngjunkie0011
Member
 
Registered: Jun 2005
Location: New York
Distribution: Ubuntu Studio
Posts: 105

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by syg00
Boot up a Linux liveCD and let's see what "/sbin/fdisk -l" says.
I bootup my machine using the SuSE 10.2 DVD on rescue mode. I have the HD with the XP installation set up as master HD, here are the results when I ran fdisk -l:

DEVICE BOOT START END BLOCKS LD SYSTEM
/dev/hda1 * 1 2550 20582843+ 7 HPFS/NTFS
/dev/hda2 2551 9728 57657285 f W95 Ext'd(LBA)
/dev/hda5 2551 9728 57657253+ 7 HPFS/NTFS


Is there a command I can use to uninstall grub????

What about a utility that will allow me to do a "check disk" but for Linux and that works on linux native partitions??

I can't believe I can't get rid of GRUB using the SuSE 10.2 DVD, I was able to reset the MBR on the first HD from within SuSE but now I'm unable to do it using the Linux DVD or the XP CD. Is there such a utility for Linux that I can use booting up with a Live CD??

I apologize for the long message but the idea here is to learn Linux and not to go back to XP. I want to fix the XP HD again only because it's a fast machine and don't want to use the old machine and I won't be able to get a new HD for maybe 2-3 weeks.
 
Old 04-02-2007, 01:45 AM   #6
Uffizi
LQ Newbie
 
Registered: Jul 2005
Location: Poland
Distribution: Gentoo
Posts: 2

Rep: Reputation: 0
Quote:
Originally Posted by ngjunkie0011
Is there a command I can use to uninstall grub????

What about a utility that will allow me to do a "check disk" but for Linux and that works on linux native partitions??

I can't believe I can't get rid of GRUB using the SuSE 10.2 DVD, I was able to reset the MBR on the first HD from within SuSE but now I'm unable to do it using the Linux DVD or the XP CD. Is there such a utility for Linux that I can use booting up with a Live CD??

I apologize for the long message but the idea here is to learn Linux and not to go back to XP. I want to fix the XP HD again only because it's a fast machine and don't want to use the old machine and I won't be able to get a new HD for maybe 2-3 weeks.
the easiest way to 'repair the damage' is to use FIXMBR command in windows console. After that grub should be just a history. Another option is to reload grub (with good conf file) to MBR - sorry i dont know how because i still use lilo - it never fails
 
Old 04-02-2007, 04:21 AM   #7
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 61
For the disc with Linux, check with manufacturer to see all possible jumper settings. Some hard drives have to have the jumpers set to "single", not "master or cable select" when installed alone. Also make sure to have the install disc in the drive to make sure the computer does not attempt to boot it. If the computer starts and you have the disc in, you may be able to re-install grub to recognize the "primary" drive location.

To recover the data from Windows.
Get a Knoppix live CD, if you have another Live CD, try it first, but the newer the better to get the latest copy of testdisk. Put the Linux disc as slave, boot up with the Live CD, open a terminal "full screen" and su to root. Change directory to the Windows partition you want to store the data. Run this command:

Quote:
photorec
Go through the configuration to pick the type of data you want to recover, (this works great for mp3 compared to foremost". Data will be restored in the directory you are in. Foremost data carver should also be on the Knoppix CD. Sample command for Foremost to recover .jpg photos from /dev/hdb2 to /dev/hda1 would be:

Quote:
foremost -v -t jpg -i /dev/hdb2 -o /dev/hda1/recovered
The recovered directory/folder will be created.

http://servers.linux.com/servers/06/...tid=119&tid=13
Quote
Quote:
Right now I have the HD from the new machine with XP setup as slave on the old machine and it looks like a normal HD with an NTFS partition, that's weird.
Nothing weird about that, you should see all folders of the Windows installation and the My Document through C:\Documents_and_Settings\User\My_Documents to get data off this drive.

Last edited by Junior Hacker; 04-02-2007 at 04:28 AM.
 
Old 04-02-2007, 04:37 AM   #8
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Quote:
Originally Posted by ngjunkie0011
DEVICE BOOT START END BLOCKS LD SYSTEM
/dev/hda1 * 1 2550 20582843+ 7 HPFS/NTFS
/dev/hda2 2551 9728 57657285 f W95 Ext'd(LBA)
/dev/hda5 2551 9728 57657253+ 7 HPFS/NTFS

Is there a command I can use to uninstall grub????
That partition structure looks o.k. You don't "uninstall" a bootloader - you simply replace it with a new one, as you did with grub. Presuming you did the fixmbr from XPs recovery console, did you get any messages ???. Check your BIOS to ensure you don't have any "virus protection" or similar - unlikely given grub went on.

If all else fails, from a Linux console the following will erase a bootloader
Code:
dd if=/dev/zero of=/dev/hda bs=1 count=446
Type carefully !!!.
Then try your fixmbr again.
 
Old 04-02-2007, 04:40 AM   #9
bandwidthjunkie
LQ Newbie
 
Registered: Jan 2007
Location: london
Distribution: Gentoo(amd64) - 2.16.20
Posts: 26

Rep: Reputation: 15
This may not help you in your present situation, but in my experience the following strategy is the best for a happy dual boot computer.

1) Install Windows first at the beginning of the hard drive; this will be your main boot partition.
2) Create an extended partition (even if this in on another physical drive) for your linux partitions to sit in. Windows hates two bootable partitions on the same drive as I know to my cost.
3) When you install linux make sure you create a boot partition inside your extended partition and install grub there, not in the windows boot partition.
4) Now to boot into linux you need to point the windows bootloader at grub a la this HOWTO http://www.geocities.com/epark/linux...w2k-HOWTO.html

Of course this isn't the only way to do it, many people just use grub and without problems, but windows is very fussy and if it decides that day that it doesn't like grub any more you are in trouble. Linux is very flexible and much more willing to accommodate. Having two bootloaders is a bit inelegant, but seems to be very functional.
 
Old 04-02-2007, 12:12 PM   #10
ngjunkie0011
Member
 
Registered: Jun 2005
Location: New York
Distribution: Ubuntu Studio
Posts: 105

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by syg00

If all else fails, from a Linux console the following will erase a bootloader
Code:
dd if=/dev/zero of=/dev/hda bs=1 count=446
Type carefully !!!.
Then try your fixmbr again.

Kudos to syg00 he was able to discern what I wanted from the description of the problem.

Thanks to everyone for your input!

The problem was that the second HD set up as slave on my system had a corrupted "/" partition, that's why I was unable to boot up my machine and get the menu to boot to either XP or Linux.

I was able to log in to the HD using my openSuSE 10.2 DVD and repair the HD but because I did so many config changes to the system while trying to fix it the setup doesn't work anymore, I'm going to have to completely reinstall Linux again. I'm going to do that as soon as I am able to recover a few files that I had in the HD with Linux, I don't have too much data, I've only used it for about a month, the only real pain will be having to reconfigure the system again.

In any case, for those of you interested, I was attempting to fix the Master Boot Record on the Hard Drive that had XP on it. Booting into XP and going into recovery mode did not work because running "fixmbr" did not do anything. This is because I had to first erase the linux boot loader installed on my HD by executing the quoted line that syg00 suggested.

The Hard Drive with XP is now working normally, now I have to find a way to recover the files I have in my Linux hard drive.

Thanks to everyone for all your help, this is the second Hard Drive that has died on me after installing Linux, I'm going to go to the hardware part of the forum and ask for a recommended reliable hard drive, I just have plain bad luck with HD's and the ones that I buy end up dying on me.
 
Old 04-03-2007, 07:21 AM   #11
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Quote:
Originally Posted by ngjunkie0011
Booting into XP and going into recovery mode did not work because running "fixmbr" did not do anything. This is because I had to first erase the linux boot loader installed on my HD by executing the quoted line that syg00 suggested.
Be aware that this should not be necessary. I regularly trash boot records (entire MBRs usually), and I *very* rarely have to erase the boot record to install another loader. Fixmbr generally works as advertised, but is poorly designed - e.g. if you have more than one (or none as it happens) partitions marked bootable, the CD just exits. No messages, no nuthin'.
Hence my question about your partition layout.

You've just been unlucky. Like your disk apparently ...
 
  


Reply

Tags
grub, remove



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
Questions about dual-boot partition scenario ericthered8 SUSE / openSUSE 2 09-09-2006 04:52 PM
Unique Grub Issues (RAID 1 --fake-- involved) TruANTOlogy Ubuntu 1 07-05-2006 03:30 PM
uninstalling grub loader from master boot record m3rlin6984 Linux - General 3 01-12-2006 03:12 PM
Re-installation coaching wanted (for dual boot scenario) lhoff Linux - Hardware 1 01-14-2003 05:25 PM
dual boot problem - my scenario has not been covered joy_division Linux - Software 11 04-03-2002 12:20 AM

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

All times are GMT -5. The time now is 12:58 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