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 01-06-2006, 04:35 PM   #1
pingu99
LQ Newbie
 
Registered: Dec 2005
Location: Brazil, Porto Alegre
Posts: 6

Rep: Reputation: 0
Windows XP/ Linux dual boot problem


Ok buddies, here is my "drama".


For information effects, I'm newbie.

I had originally installed Windows XP on my PC. Because I want to get free of Microsoft dictatorshit, I installed RedHat 9. I partitioned and stuff. Everything went fine.

Then I messed up Windows registry, and Windows failed to boot. Ok, here I go to reinstall it. Then it asked for some drivers from VIA (viamraid.sys et al). Ok, I got into the motherboard CD, got the drivers.

Windows installation was apparently going well, it accepted the drivers, but eventually it came with the message "Can't read the viamraid.sys driver, do you want to ignore the file and proceed?" I tried many different drivers (from the web) changed diskettes to see if it wasnt media problem, but the message persisted. So I eventuallt tried the "ignore" option.

Until that moment I was able to load Linux with Grub, no problem. After that, Windows arrogantly "took over" my computer and crippled the bootloader. (ie, it tries to boot before Grub). But Windows failed to boot also, saying "windows can't load because you don't have the file xyzabc.sys" and you have to restart."

(Note. As if I wanted Windows to start! Microsoft tries to force the concept that your computer *is* Windows, disrespectfully overwriting/ignoring Linux. That message showed me Microsoft philosophy and it made me real angry)

Then I used the "linux rescue dd" installation option, after setting the BIOS to boot from the cr-rom drive first at startup.

Ok, I got into the terminal and tried to use fdisk to fix the problem (which I don't really know what is). The partitions are apparently intact.

In short, what happens is that Windows tries to load before Grub, then crashes. Reinstalling Linux didnt't work (it says "No changes were made to kernel, so I won't change your bootloader configuration"). Reinstalling Windows didn't work too.

I want to rescue only my data from the Windows files. I have tried many sites,like this one

redhat.com/docs/manuals/linux/RHL-9-Manual/custom-guide/s1-rescuemode-boot.html

and this
redhat.com/docs/manuals/linux/RHL-9-Manual/custom-guide/s1-rescuemode-boot.html

(the site won't allow me to use URLS because I haven't posted 5 or more messages )

And other sites. It's been 3 days trying to solve it, and good 30 hours on the problem. I got lost on the technical things, and I'm feeling lost in the "jungle". I wonder what problem that could be? Any tips? Any questions?

I guess I could have taken an extreme measure of formatting everything, but I'm feeling challenged, and I would be really frustrated if I didn't solve this problem.

Thank you for reading all this boring stuff
 
Old 01-06-2006, 04:38 PM   #2
redgren
Member
 
Registered: Nov 2004
Distribution: Debian,Homebrew
Posts: 54

Rep: Reputation: 15
Can you log in to your Linux partition? I'm not sure from above if you are running commands (like fdisk) off of the install media or the installed linux partition.

If you can get into a linux partition, it should be no problem to get your windows data, restore your bootloader and get back in business.
 
Old 01-06-2006, 04:41 PM   #3
pingu99
LQ Newbie
 
Registered: Dec 2005
Location: Brazil, Porto Alegre
Posts: 6

Original Poster
Rep: Reputation: 0
Yes, I have access to my Linux partition, on a "rescue mode".

I boot from the cd, then type "linux rescue dd" and enter the rescue mode.
 
Old 01-06-2006, 04:52 PM   #4
redgren
Member
 
Registered: Nov 2004
Distribution: Debian,Homebrew
Posts: 54

Rep: Reputation: 15
At command line, you need to reinstall GRUB to the MBR.

Cut and pasted relevant details from here : Linux Gazette

Quote:
Installing GRUB can be broken into three separate parts:

1. Installation of "stage1" in MBR.
2. Setting up the address or location, "stage2".
3. Setting up a boot menu or set of options to choose which operating oystem to boot.

Start installing GRUB by issuing the following command:

[root@heaven /boot/grub ]# ./grub

This command probes devices to guess BIOS drives and produces an output message. This may take a long time.

end_request: I/O error, dev 02:00 (floppy), sector 0

GRUB version 0.5.96.1 (640K lower / 3072K upper memory)

NOTE: Although it may seem surprising, GRUB does have minimal Bash-like line editing is supported. For the first word, TAB lists possible command completions. Anywhere else TAB lists the possible completions of a device/filename. You may be surprised to see this feature. Something like this then appears:

grub>

Now, I assume that you have installed your Linux distro in the first extended partition in the first disk or /dev/hda5. Remember the GRUB naming convention and rename the above to (hd0,4). Type the following command:

grub> install (hd0,4)/boot/grub/stage1 (hd0) (hd0,4)/boot/grub/stage2 p (hd0,4)/boot/grub/menu.conf

Now let's examine this command in detail:

install
a built-in command that tells GRUB to install (hd0,4)/boot/grub/grub/stage1 to (hd0), the Master Boot Record.
(hd0,4)/boot/grub/stage2
tells grub where the stage2 image is located.
p with the the following options: (hd0,4)/boot/grub/menu.conf
sets the configuration file for displaying nice menus. I will later discuss the structure of the configuration file.

We can also summarize that command as follows:

1. install
2. source_of_stage1
3. where_to_install
4. source_of_stage2
5. p source_of_configuration_file

You have now completed the basic hard drive installation.
Try that and post any questions you have about the process.
 
Old 01-06-2006, 04:53 PM   #5
redgren
Member
 
Registered: Nov 2004
Distribution: Debian,Homebrew
Posts: 54

Rep: Reputation: 15
By the way, you should already have the boot menu from your previous installation, so just point to that one (for my debian system it is /boot/grub/menu.1st - yours may be different.)
 
Old 01-06-2006, 05:09 PM   #6
pingu99
LQ Newbie
 
Registered: Dec 2005
Location: Brazil, Porto Alegre
Posts: 6

Original Poster
Rep: Reputation: 0
Ok, I'm gonna try right now. I will notify you of my results shortly, thank you.
 
Old 01-06-2006, 05:24 PM   #7
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
EDited after send---ignore my post if you want to stick with redgren. We are doing the same thing but mine perhaps should be easier, if redgren agrees.
-----------------------------------------------------

OK If you want to keep your XP data don't partition or format the drive. Everything should be accessible. At least this is my opinion.

When you are in rescue mode you should have access to terminal commands and you can check the partitioning scheme by the fdisk command
Code:
fdisk -l
The l after the "-" is a small "L". You have to know where your XP partition is. It will have a partition ID "0x7" or "7" which is reserved for NTFS partitions.

You can check its content, say it is in hda1, as follow
Code:
mkdir /mnt/hda1
mount /dev/hda1 /mnt/hda1
ls /mnt/hda1
The last statement shows the directory of XP's "C" drive. You should have everything inside.
----------------------------------
I am unsure if your XP can be saved or not but you can get your Red Hat 9 back by the following commands
Code:
mkdir /mnt/hda1
mount /dev/hda1 /mnt/hda1
chroot /mnt/hda1
If you meets no resistance then you are now "inside" Red Hat 9!!!!!

The first thing is to save your position by replicating Red Hat 9 boot loader in 3 locations. Drop a floppy into the drive and type these 3 lines
Code:
grub-install /dev/hda
grub-install /dev/fd0
grub-install /dev/hdax
where hda is for Grub into the MBR, fd0 is to have Grub in a bootable floppy and hdax is the root partition of your Red Hat 9. Hopefully with the "fdisk -l" command you may be able to identify it. If you do not know the you still can ask Grub to tell you. Type this in the terminal
Code:
less /boot/grub/menu.lst
The first line without a "#" at the begining and has a command "root" is the line you after. It is something like
Code:
root (hdi,j)
the i is the disk number and the j is the partition number but Grub counts from 0 so hda1=(hd0,0), hda3=(hd0,2) etc. From it you should know the "root" of your Red Hat 9. As a double check there is a part of "root=/dev/hda?" in the kernel statement following the root command.

After you replicate the boot loader type
Code:
exit
reboot
With the above you should be boot back to Red Hat 9 as Grub is put back into the MBR.

Lets us know how you get on with the above.

One more thing, you can always use Red Hat 9 terminal to make a directory and mount it as described above and then go to the desktop to see your XP partition. You should be able to read all your files but can't write on any of them. That is normal.

Last edited by saikee; 01-06-2006 at 05:28 PM.
 
Old 01-06-2006, 06:26 PM   #8
redgren
Member
 
Registered: Nov 2004
Distribution: Debian,Homebrew
Posts: 54

Rep: Reputation: 15
Much more detailed than my cut and paste.. nice job
 
Old 01-06-2006, 09:32 PM   #9
Keynote
LQ Newbie
 
Registered: Mar 2004
Posts: 17

Rep: Reputation: 0
Hi, I having problem with Linux Red Hat. I was dual boot(Win98se & Red Hat) Because of too long downloading of update2 in dial up so gave it up. I have better idea. Here to your solution. I have 2 hard drive ide install in same computer. Install 2 DPST toggle switch then add wire from power source (Red & Yellow power source to switch. Note (need to cut yellow and red wire power supply box and cut hard drive power cable too) Then add other 2 similiar color wire from switch to 1st hard drive.
Similiar process for install 2nd switch from power source and similiar process, from 2nd switch to 2nd hard drive. You need hard drive to set master boot. So there you can boot either drive. I have my 2 seprate hard drive, both has master boot both install by Win98. Reason to do that because I so piss off by again and again reformat hard drive again. So I decide to that by seprate boot, I has 2 seprate boot drive, 1st boot is for Internet, 2nd boot is for book keeping mean never once touch Internet. But with understand when done Internet or 1st hard drive, you has to shut down complete computer before doing switch to 2nd drive. It work charm. I am now install 3 drive with SATA 250GB hard drive, little more difficult cuz Win98 do not take all 250GB but limit to 137GB. As I am planning to install Linux Federal Core 4 (not sure of which one) in 3rd drive. And at any time you can switch from any drive without dual boot. All need is set master boot for 3rd drives similiar as I mention above. I have 2 hard drives that is working good and able to switch either drive but has to shutdown first before doing switch to other drive. And I am working on 3rd drive with 3rd toggle switch as well. But I am not sure of how ISO downloading work from Ferderal Core website.

Last edited by Keynote; 01-06-2006 at 09:51 PM.
 
Old 01-06-2006, 11:02 PM   #10
pingu99
LQ Newbie
 
Registered: Dec 2005
Location: Brazil, Porto Alegre
Posts: 6

Original Poster
Rep: Reputation: 0
The idea of using different hard drives is not bad, I just must get the time ($$) to implement it

Now, I solved the problem partially!

Here is what happened: I got into the terminal in rescue mode and found out that I didn't have to mount (mount /dev/hda1 /mnt/hda1), as suggested by you Saikee, because the installer hinted at mounting to /mnt/sysimage. Of course I initially did exactly as you told me, but as it didn't work I had to think. When I do disk -l I don't get hda1, hda2 etc, but sda1, sda2, etc. Linux was in /dev/sda2.

Ok, I did less /boot/grub/menu.lst and found the entry you mentioned to be hd0,2. So you told me it was equivalent to hda3 or, heuristically, sda3. But fdisk informed me Linux was in sda2...(think... think...)

Redgren said I needed to run grub and do install (hd0,x)/boot/grub {etc}, and it is later explained that that is a way to tell grub the path to the files. (think...think...)

It mentioned in the header "File generated by anaconda" (the RedHat installer) so I thought, "it can be wrong", (since i reinstalled at a later time it could have been misconfigured. Nonsense? Probably). So I tried vi menu.lst (I know the basics... I use Linux in college for numerical simulations. I'm a mere user yet though) and edited hd0,2 and changed to hd0,1, so it would be equivalent to sda2.

Ok, I did the commands grub-install /dev/sda and/dev/fd0 and /dev/sda2. It worked (good omen?)

Then I restarted and voilą!! I never loved that screen so much before.

Kind thanks to you saikee and redrgren, thank you for your time.

I have another question, though. I wasn't able to mount the XP partition while in the terminal (to check out) with the message "the device must be a block one" (or something like that). I would like to know how to access the partitions of XP from inside Linux, so I can record them on DVD and backup all my data before I start messing around again .

And maybe flush Windows from my computer once and for all.
 
Old 01-07-2006, 04:16 AM   #11
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
The making of a directory and mount it is the general technique. Using the rescue mode is to have it party done for you but you need the installation CD. Not all installation CD has the rescue facility.

The general technique is good for all Linux as you can use a Live CD to accomplish what you want.

If your XP partition is sound, which I believe to be the case, then you should be able to mount it with the instructions already given. If things starts to get complicated you may need to tell the LInux of the partition type as well by adding the -t parameter in the mounting instruction as follow
Code:
mount -t ntfs /dev/hdax /mnt/hdax
subsitute the hdax with your XP partition reference.

A complication is possible if you pick the wrong partition.

If you still have a problem, list the fdisk -l information here.

----------------------------------------------------
Keynote,

Would you still switch between the drives "electrically" after looking at this thread which shows one can select 100+ systems between 4 disks to boot by just using Grub alone.

Last edited by saikee; 01-07-2006 at 04:18 AM.
 
Old 01-07-2006, 09:18 AM   #12
Keynote
LQ Newbie
 
Registered: Mar 2004
Posts: 17

Rep: Reputation: 0
No, the computer has to shut down before doing switch drive A or drive B. Both drive has set jumper to master and both installed windows 98. ie: Shut down computer and wait till complete shutdown, then turn switch A on and turn switch B off, then push computer on. I think with grub, it don't work on switch either A or B drive but will work if partation drive set divide into 2 or more. In regards of both drive A & B do not commuicate each other so I have add other drive called external drive Maxtor OneTouch external drive so I can back up both drive A & B to external drive just in case.
 
Old 01-07-2006, 04:20 PM   #13
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
Keynote,

If you want to stop the drives by hardware means (toggle switch) you can use the software method as follow

(1) Put Re Hat disk as 1st bootable disk and so Win98 becomes the 2nd disk in the booting queue.

(2) Boot up Red Hat and add these lines to /boot/grub/menu.lst
Code:
title My Win98 installed as 1st bootable now booted in 2nd disk
root (hd1,0)
map (hd1) (hd0)
map (hd0) (hd1)
chainloader +1
The two red statements perform the toggling between 1st and 2nd disk just before WIn98 is booted.

I have written the above assuming you Win98 is in the first primary partition. If it is not then you need to adjust the partition reference to suit your case.
 
Old 01-07-2006, 08:59 PM   #14
Keynote
LQ Newbie
 
Registered: Mar 2004
Posts: 17

Rep: Reputation: 0
Several year ago sold Red Hat software to someone. Today I have order Fedora Core 4 DVD disc and will install in Drive 3. Today I have install switch 3 and hook up Drive 3. All switch from 1 to 3 are function working good. Going to full installation Fedora on Drive 3 without Window 98 so no need grub dual boot.
 
Old 01-08-2006, 05:38 AM   #15
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
It doesn't bother me the least if you don't take up my advice to replace the hardware switching by software but I am just curious that you don't seem to have an ambition to mount and access all the disks in Linux. After all the fun, purpose and power of using a Linux is to go inside a Dos/Windows partition and find all photos can be seen, MP3 can be played, office documents can be worked on in Linux the same way they are in Windows.

I have about 20 hard disks all in caddies. Only the mobile rack frames are permanently fixed to the PC as I have also moble rack frames fixed to USB external hard disk enclosure. All of my disks can be inserted in seconds to become either a Master or a slave or an external or internal drive and between PCs.

I only set the jumper to "cable select" once for each one. The insertion position of the mobile rack frame determines if the disk is a master or a slave. In "cable select" the disk connected to an end plug is automatically a master. The same disk if connected to the middle plug, with the end plug is connected to another disk, becomes a slave.

The probable reason your disk A and B cannot communicate each other is because you set both disks to master!

In using one IDE cable to connect two disks one has to set up as a master while the other a slave so as to tell the BIOS which one is to be booted first.
 
  


Reply



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
DUAL Boot Problem: Windows XP - Linux Boeboe Linux - General 7 05-23-2006 04:15 PM
Solution Dual Boot Windows & Linux [ALL DONE IN WINDOWS] No Linux terminology DSargeant Linux - Newbie 4 11-10-2005 11:37 AM
dual boot windows xp and suse linux 9.0 partitioning problem spodops Linux - Newbie 3 10-31-2004 03:38 PM
Strange Dual boot Windows/Linux Problem KiLLaWaBBiT Linux - Software 3 09-08-2004 03:34 AM
Dual boot Redhat Linux 9.0/Windows XP home NIC problem shawn_t Linux - Hardware 6 03-09-2004 12:57 AM

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

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