LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-08-2006, 05:09 PM   #1
metalx1000
Member
 
Registered: Jun 2006
Distribution: Debian
Posts: 111

Rep: Reputation: 16
Grub and Windows XP


Hello,

I've have a duel boot on my laptop of knoppix and windows XP on my laptop for the past month or two and about an hour ago I screwed it up.

I was messing with the grub command and now when I get the Grub boot menu I still have the option to boot to Linux or Windows but when I select Windows it quickly flashes the following.
Quote:
Booting 'windows 2K/XP/2003(hda1)'
Chain load (hd0,0)+1
Grub loading stage2...
And that's not the worst of it. When I do boot to linux or to one of my liveCD's the windows partion shows up (hda1) but when I try to mount it I get the following message
Quote:
Could not mount device.
The reported error was:
Failed to startup volume : Invalid argument
Couldn't mount device '/dev/hda1' : Invalid argument
Mount failed.
I could use some help.
Thanks

Last edited by metalx1000; 09-08-2006 at 05:26 PM.
 
Old 09-08-2006, 05:14 PM   #2
masonm
Senior Member
 
Registered: Mar 2003
Location: Following the white rabbit
Distribution: Solus
Posts: 2,254

Rep: Reputation: 47
What do you mean by messing around with the grub command?

You may need to reinstall grub if you really borked it. I'm assuming you made no changes to menu.lst?
 
Old 09-08-2006, 05:32 PM   #3
metalx1000
Member
 
Registered: Jun 2006
Distribution: Debian
Posts: 111

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by masonm
What do you mean by messing around with the grub command?

You may need to reinstall grub if you really borked it. I'm assuming you made no changes to menu.lst?
Well every once and a while when I selected my Linux partion it would get an error and not boot. The way I got around this was by booting a liveCD and mounting that partion. Then next time I rebooted my linux partion would boot just fine.

This would happen every week or so, and as you can imagine, this was a major pain in the butt.

So I read on upgrading my verion on Grub. I thought it would fix my problem, but what ever I did screwed up my windows partion.

I don't remember what I typed excatly, but it was something like
Code:
grub
setup (hd0,0)
 
Old 09-08-2006, 07:25 PM   #4
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 59
Quote:
setup (hd0,0)
Yep, that will mess things up as that is your windows partition. Should have been setup (hd0) .

Here's my notes on that from long ago. Can't remember who wrote this.
Code:
If you mistakenly install GRUB onto another partition on your hard drive instead of the MBR (for example, the command 'grub-install /dev/hda1' writes the GRUB stage1 to the first partition on the hard drive hda... in my case this was my Windows partition.

1.Zero out MBR. (but not all of it!) You need to use 'dd' to erase the MBR.
Run the  command: dd if=/dev/zero of=/dev/hda bs=446 count=1
Why the 'bs=446'? Because the rest of your MBR holds the partition table for the drive... which you do not want to destroy. (note how 'hda' in this context refers to the MBR where, in general, 'hda' is the first hard drive in your system) 

2.Zero out the boot sector of the Windows partition.
Run the  command: dd if=/dev/zero of=/dev/hda1 bs=512 count=1
This erases the boot sector of the first partition on hda.

3.Re-write a Windows MBR. You'll need to boot into DOS with your trusty Windows boot disk and type: fdisk /mbr

4.Copy Windows system files to boot sector of Windows partition.
Type: sys a: c:
Which tells DOS to copy the system files from a: to the boot sector of c:.

5.At this point your computer should be able to reboot into Windows as if you just had Windows installed. Try it by rebooting.

6.If all has gone well, you can reinstall GRUB.
Don't forget setup (hd0)
 
Old 09-08-2006, 07:48 PM   #5
masonm
Senior Member
 
Registered: Mar 2003
Location: Following the white rabbit
Distribution: Solus
Posts: 2,254

Rep: Reputation: 47
Yeah, you installed grub to the windows partition. You'll need to rerun it to hd0 after cleaning up the mess as indicated in the above post.

What distro are you using anyway?
 
Old 09-09-2006, 08:56 AM   #6
metalx1000
Member
 
Registered: Jun 2006
Distribution: Debian
Posts: 111

Original Poster
Rep: Reputation: 16
sys a: c:

Thanks for the help so far.

I've tried what you've told me but I do not have a floppy drive on my laptop.
I tried my win98 and Bootable DOS CD I download. I looking for my winXP CD right now. So far the'sys a: c:' command did not work (Bad command of file name). If you have any suggestions I would be very greatful.

Last edited by metalx1000; 09-09-2006 at 09:07 AM.
 
Old 09-09-2006, 09:17 AM   #7
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 59
Quote:
So far the'sys a: c:'
If you are booted into a cdrom, a: is going to be something else .
 
Old 09-09-2006, 09:23 AM   #8
metalx1000
Member
 
Registered: Jun 2006
Distribution: Debian
Posts: 111

Original Poster
Rep: Reputation: 16
I know that. The one CD did boot the CD as the A: drive. and on the win98 CD I use D:
 
Old 09-09-2006, 09:38 AM   #9
metalx1000
Member
 
Registered: Jun 2006
Distribution: Debian
Posts: 111

Original Poster
Rep: Reputation: 16
I finally found a DOs 6.22 .ISO image and loaded that. The command 'SYS' works, but the c: is just unreconized. I only had a few thing on it that I did have backed up, so I'm just going to start from scratch. Thanks for all the help.
 
  


Reply


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
Help of GRUB, How to Linux, Windows XP and Windows 200 ERBRMN Linux - General 4 04-25-2006 09:26 PM
GRUB dual boot problem: Boot "other" (windows) just restarts GRUB! stevod333 Linux - Software 13 04-06-2006 06:26 AM
windows and grub marioV Linux - General 1 11-28-2005 02:36 PM
SuSE 9.1 and Windows Xp refuse to live in harmony: error loading windows through GRUB sanctumtacete Linux - Newbie 3 10-19-2004 08:47 AM
Boot windows 98,windows XP and linux by GRUB Swift&Smart Linux - General 6 02-22-2003 10:11 AM


All times are GMT -5. The time now is 12:19 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration