LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   dual boot gone wrong (https://www.linuxquestions.org/questions/linux-newbie-8/dual-boot-gone-wrong-382138/)

slap 11-11-2005 10:16 AM

dual boot gone wrong
 
I'm trying to get a dual boot setup, currently I can not boot into windows. When I installed Debian, by mistake I put Grub onto the MBR. (or something like that.) From what I've read online I can use Grub to boot XP but I'm having a little trouble. FYI...Debian in on the Samsung IDE and XP is on the SATA raptor. Thank you in advance for your help and suggestions...

Here is my menu.list file
title Windows XP
rootnoverify (hd1,0)
map (hd0) (hd1)
map (hd1) (hd0)
makeactive
chainloader +1

Here is the output of fdisk -l
Device Boot Start End Blocks Id System
/dev/hda1 * 1 851 6835626 83 Linux
/dev/hda2 852 9733 71344665 5 Extended
/dev/hda5 852 1037 1494013+ 82 Linux swap / Solaris
/dev/hda6 1038 9733 69850588+ 83 Linux

Device Boot Start End Blocks Id System
/dev/sda1 * 1 4499 36138186 7 HPFS/NTFS
/dev/sda2 4500 4500 8032+ b W95 FAT32


I've searched the net with google and I think I found my problem but it's a bit over my head Here is the output of fdisk -l /dev/sda1

Disk /dev/sda1: 37.0 GB, 37005502464 bytes
255 heads, 63 sectors/track, 4498 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

This doesn't look like a partition table
Probably you selected the wrong device.

Device Boot Start End Blocks Id System
/dev/sda1p1 ? 13578 119522 850995205 72 Unknown
Partition 1 does not end on cylinder boundary.
/dev/sda1p2 ? 45382 79243 271987362 74 Unknown
Partition 2 does not end on cylinder boundary.
/dev/sda1p3 ? 10499 10499 0 65 Novell Netware 386
Partition 3 does not end on cylinder boundary.
/dev/sda1p4 167628 167631 25817+ 0 Empty
Partition 4 does not end on cylinder boundary.

Partition table entries are not in disk order

saikee 11-11-2005 10:33 AM

Your Sata is corrupted. XP will not loaded as it doesn't know how to deal with it.

My recommendation is boot to Debian, log in as root, in terminal mode just run cfdisk to delete your sda2, as it is too small to hold anything but may cause a system to abandon the attempt to read it.

After the deletion, exit Debian and reboot to see if the problem persists.

Your Windows booting commands look OK to me and may boot if XP can read the Sata.

TruongAn 11-11-2005 10:44 AM

Put grub in MBR is not a mistake, it is what you have to do.
In the menu.lst file, you specified that you have installed Windows XP in hda1 partition, but hda1 was a linux partiton.
So where did you install window?
What is the error message when you try to boot window?

And, for further post, but the command output in the tage [code] to make your better appear.

saikee 11-11-2005 11:30 AM

I believe Windows is in sda1 and the IDE disk hda has earmarked as the first bootable disk and so Grub calls it (hd0). Sata is therefore (hd1) to Grub. The truncated menu.lst does show Grub has prepared to boot Windows from partition (hd1,0) and that is sda1 which matches the fdisk-l information of

/dev/sda1 * 1 4499 36138186 7 HPFS/NTFS

Also there is no FAT or NTFS partition in the other disk.

It is the duty of every system to check the integrity of itself on booting. If sda has erroneous entries in the partition table no system knows how to get over it and the easiest way out is to refuse to boot. It will happen to Linux too but the current case is sda is a 100% Windows disk and may not be affecting Debian.

slap 11-11-2005 11:48 AM

Thank you for the replies. I apoligize if my post was difficult to read.


TruongAn:
Windows was installed first on the Sata drive and Debian afterwards on the IDE drive. Windows was bootable before the Debian installion. I've never had a problem booting Debian. From debain, I can mount the sata drive and read files if that matters.

Also I don't get any errors when I attempt to boot windows. I get the screen with the contents of my menu.list file and a blinking cursor.


Saikee:
I will attempt to delete the sda2 partion. Is there any additional information I need to know other than what you posted.

saikee 11-11-2005 12:15 PM

slap,

If you want to play safe print out the content of fdisk -l.

Then you boot up into Debian, log in as root and activate a Grub shell by typing at the terminal

grub

Then you can use Grub to interrogate sda by typing

geometry (hd1)

If the number of cylinders/heads/sectors matches then it would be quite safe to delete sda2, which incidentally is only 8032 bytes.

Your description confirms Grub did manage to pass the control to XP but XP itself failed to boot up. It is not a Linux problem and XP has to deal with it itself.

If after deleting the partition (don't forget to reboot) you still couldn't get XP up then my suggestion is to dig out XP's installation disk and let XP carry out the repair job. XP will advise you to do a re-installation if it couldn't cope with the damage. If you want to save your data it is time to make a backup before permitting XP to do a re-install.

slap 11-11-2005 12:21 PM

OK, I deleted the sda2 partion and no luck on the reboot. I get the following screen...

Booting 'Windows XP'
rootnoverify (hd1,0)
map (hd0) (hd1)
map (hd1) (hd0)
makeactive
chainloader +1

and a blinking cursor.

I have the Windows disk handy. I've read online that the fixmbr command might work but my concern is that windows will make debian unbootable. How can I avoid this?

saikee 11-11-2005 12:56 PM

Easy, just boot to Debian, log in as root, pop a floppy into the drive and type

grub-install /dev/fd0

Exit Debian and you should be able to boot up your existing arrangement from the floppy (can still boot to MBR if floppy is removed)

You can proceed to restore XP's MBR. I always use a DOS bootable floppy (with fdisk.exe inside), boot it up and type

fdisk /mbr

This beats the XP installation CD with fixmbr as it takes a lot longer. There are still people around thinking XP's MBR must be restored by its original CD. Good luck to them.

Once XP's MBR takes over you will only be able to get your Debian back by the floppy. As you can boot Debian you can always restore its Grub any time by typing

grub-install /dev/hda

Therefore you can swap the boot loader any number of times but my fear restoring XP's MBR may not be enough to get over your current problem.

By the way even if you lose the Grub floppy Debian can still be rescued by any Live CD.

slap 11-11-2005 01:19 PM

Hmm I got an error...

debian:/# grub-install /dev/fd0
/dev/fd0: Not found or not a block device.

saikee 11-11-2005 04:42 PM

OK this one got me too.

I ran my Debian Sarge and it has the same problem with Grub-install. Debian Sarge uses V 0.95 of Grub but the latest is 0.97.

I am 85% certain that this is a bug because I can do

mkdir /mnt/fd0
mount /dev/fd0 /mnt/fd0

and was able to read and write to the floppy with Debian. It is only the combination of 0.95 version of Grub and Debian (with 2.6.7 kernel) that doesn't work properly.

I also tried Ubuntu 5.0.4 because it also has Grub 0.95. Ubuntu also reported /dev/fd0 isn't a BIOS drive. So it seems that is a dead end. Ubuntu has a 2.6.10 kernel.

Lastly I ran Kanotix 9.2004, which has a 2.6.8 kernel. I checked its Grub 0.95 first (type Grub at root terminal and the version will show up) before dooing a grub-install /dev/fd0

It worked!

There was a time I relegiously creating a bootable floppy for every Linux I installed but I stopped doing it as I have found one Grub floppy, unattached to a system, can boot all of them. May be this the the way for you to go.

-----------------------------------
Step 1 - Arrange the boot loader Grub inside Debian's root partition

I am guessing the root partition of your Debian is in hda1 so putting Grub in hda1 is

grub-install /dev/hda1

If you omit 1 after hda it goes into the whole disk which is the MBR. Do feel free to alter hda1 to the directory you specify as / for Debian.

The above works as I did it with Debian before so it is bomb proof.

-----------------------------------
Step 2 - How to make a bootable Grub floppy unattached to an operating system

I have typed this method repeatedly recently so if you don't mind please refer to

Post #9 and #15 of this thread Make sure you read the alterations I put in #15

You may be relieved to learn that the poster got it working and was very happy about it.

-----------------------
Step 3 - To boot Debian manually with Grub floppy (unattached to system)

You boot up the floppy into a Grub prompt. You then type

root (hd0,0)
chainloader +1
boot

That should boot up the Grub hiding inside hda1. The floppy-Grub then hands over the control to the hda1-Grub and you get back 100% of what your current condition is now now, but without the need of the MBR.

-------------------------

Step 4 -- To boot Windows with Grub floppy (unattached to system)

Yes why not. This in fact is the acid test. You basically type the parts of Debian's /boot/grub/menu.lst on Windows but omitting the "title" line and add "boot" after thelast line, like this

rootnoverify (hd1,0)
map (hd0) (hd1)
map (hd1) (hd0)
makeactive
chainloader +1
boot

If your XP is good it will be booted by the Grub floppy, otherwise try to restore the MBR

Good luck

DSargeant 11-11-2005 10:11 PM

There's an alternative way . use the windows way by using the boot.ini. Search for" mbrwiz Solution Dual Boot Windows and Linux" in the Linuxquestions.org. this method is fool proof and it will work everytime. It's all done in windows. You won't need luck.

slap 11-11-2005 10:25 PM

Sorry for the delay of my reply, I just got back home.

Quote:

Originally posted by DSargeant
There's an alternative way . use the windows way by using the boot.ini. Search for" mbrwiz Solution Dual Boot Windows and Linux" in the Linuxquestions.org. this method is fool proof and it will work everytime. It's all done in windows. You won't need luck.
I'm confused by this. Did you read the OP? I can't boot into windows.

slap 11-11-2005 10:48 PM

I think I might have bigger problems with my floppy drive.

debian:/dev# mkdir /mnt/fd0
debian:/dev# mount /dev/fd0 /mnt/fd0
mount: you must specify the filesystem type

saikee 11-12-2005 02:48 AM

No

Just put in -tand then the file type should do it. I tried it out myself, remeber?

I am fairly comfortable with it being a bug because I have also verified it in Grub shell

You can do it also to prove Debian can accept (fd0) but can write to it, so (fd0) being not a BIOS drive is incorrect.

If you type Grub at shell

root (fd0) will get Grub to report back what kind of file type in (fd0)

The grub-install /dev/fd0 can be achieved in Grub shell by

root (hd0,0) <-----------------indicating the Debian Grub files location
setup (fd0) <------------------put Grub into fd0

Above failed too.

Therefore, together with the same response I got from Ubuntu I think it is a bug.
---------------------------------------------

I don't have much problem for people advocating XP's NTloder to multi-boot because I also have it too in the box booting 10 systems, which is its limit. Since I got 50+ systems I have to use Grub for all of them.

When the operating systems have been "properly" arranged, each with a boot loader inside its root partition, then all of them can be booted up by Grub (in a floppy, a CD, a root partition or in MBR), using the same 3 lines of commands but changing the partition reference only. You can get anything simpler and neater than this

Root (hdi,j) <-----------tell Grub the root partition is located in ith disk jth partition.
cahinloader +1 <-----------tell Grub to boot the system's boot loader
boot <-----------green light for Grub to go for it

For 50+ systems I also have 50+ bootloaders and can confirm that between Grub, Lilo and NTloader the first needs the least amount of work to boot. I would even say Grub needs 1/10 of NTloader's effort but is able to boot 10 times more systems. NTloader also has a limitation of booting only one DOS-based of M$ system (select from DOS, Win3x,Win9x etc). Grub in my box boot 2 DOS, 2 Windows, 1 Win2k and 1 XP, beside the remainder of the 50+ systems.

I do believe Linux users are wasting their time to avoid Linux boot loaders and trying to multi-boot with Windows. Yes it can be done but it is a awfully long way to get to when there are at least 2 short cuts offered by Lilo and Grub. This is the opinion from a guy who have walked through every pace in all the three routes

slap 11-12-2005 06:43 AM

salkee thank you for your patience...

I guess I'm still a newbie because I still can't mount the floppy. I even went into the bios to confirm the floppy is there because I can't say i use it all that often.

debian:/# mount -t ext2 /dev/fd0 /mnt/fd0
mount: special device /dev/fd0 does not exist

grub> root (fd0)
root (fd0)

Error 21: Selected disk does not exist

Perhaps the floppy is called something else? How would I confirm that?


All times are GMT -5. The time now is 10:14 PM.