Uninstalling GRUB (unique scenario) from HD to enable XP boot-up
Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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!!!!!!
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.
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!!!
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.
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
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:
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.
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
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.
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.
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 ...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.