LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Dual boot Debian Etch and XP with GRUB - Debian installed First - one HDD (https://www.linuxquestions.org/questions/debian-26/dual-boot-debian-etch-and-xp-with-grub-debian-installed-first-one-hdd-516830/)

bence8810 01-06-2007 02:59 AM

Dual boot Debian Etch and XP with GRUB - Debian installed First - one HDD
 
Hi

I have set up my usual Debian setup on my new laptop, but the company I work for requires me to VPN in the system through a Netscreen Firewall, which supplies an SPD file for the VPN connection. This can only be used from Windows, so there I go, stuck with Bill again...

Since I already have Debian configured, and I read on the net that I need Windows first, I am a bit confused if this will work or not. I had a 10GB partition free, to which I am currently installing XP on a FAT32 filesystem for compatibility. As I understand, from now on, my Laptop will only boot to Windows, as NTLDR took over the MBR. How can I get GRUB back, and able to dual-boot? Should I insert the Debian CD again, and do a rescue, or something similar?

Thanks for any suggestions,

Ben

saman007uk 01-06-2007 07:15 AM

You can always beckup your MBR, and then restore it using al ive CD. Then booting to Debian, and doing a grub-install should work.

Backing up:
Code:

dd if=/dev/hda of=MBR-backup bs=446 count=1
Then, install windows, and afterwards boot a live CD. To restore the MBR, do:
Code:

dd if=MBR-backup of=/dev/hda bs=446 count=1
Where /dev/hda is your hard disk. Afterwards, login to Debian as root and do:
Code:

grub-install /dev/hda
This should detect the Windows installation and add it to your boot menu. Anotherway, in which you don't need to backup the MBR, is to simply chroot into the debian installation from a live-cd and then doing a grub-install.

Chinook06 01-06-2007 09:53 AM

I have similar problem. I have 200GB sata disk. There I had windows XP and DEBIAN. But I reinstalled WINDOWS XP and GRUB have lost. Now, windows is booting only. I want install linux, but I can see only partition 200GB. In windows XP I can see 30GB for linux and 170GB NTFS(aproximately). What should I make with this?
sorry about my english

bence8810 01-06-2007 10:25 AM

Hi

I am done, thanks for the quick response.

What I did was the following.

I installed Debian (weeks ago) on a 10GB partition and 512 for SWAP. I left another 9,5GB for Windows. Once my Debian install was done and stable, I installed XP on the 9,5GB partition. This safely killed of GRUB of course. Now, after I posted here, and got the response, I replugged the CD drive, and booted from the same exact Debian NET install CD. In the boot prompt I started the Install with

Code:

rescue
It booted, and asked me questions as if I was setting up a new system. Obviously, it doesnt matter what you answer for the questions, but of course you should kind of set the Right keymap for the keyboard :) for example I need Japanese, so I used that.

When the Resuce window comes up, there will be as many choices as many partitions you have to choose from. I chose the second one, as the first one is SWAP, second is Debian Root, and 3rd is XP. Now, you have several options, executing a shell, or just simply reinstalling GRUB. It asked me where I wanted to install it, so I entered

Code:

hd0
Once I rebooted, I got the friendly GRUB screen, so I chose my current kernel, and booted. Now, to allow XP to breathe, I had to edit

Code:

/boot/grub/menu.lst
and added this right below my linux boot parameters

Code:

title windows XP
        root (hd0,2)
        chainloader +1
        makeactive

Note root (hd0,2) where 2 stands for the third partition. 0,1,2

Best regards, and thanks again for the suggestions.

Ben

Chinook06 01-07-2007 08:46 AM

I have resolved it parially. I have two disks (/dev/hda(primary with GRUB) and /dev/sda (with windows XP and debian)). When I set boot disk sda in bios. Windows is started. When I set boot disk hda in bios. Grub is started, but I can start only DEBIAN. When I choose windows, then PC is started boot from hda and hanged. How can I set boot windows?

Chinook06 01-07-2007 09:12 AM

I have resolved it parially. I have two disks (/dev/hda(primary with GRUB) and /dev/sda (with windows XP and debian)). When I set boot disk sda in bios. Windows is started. When I set boot disk hda in bios. Grub is started, but I can start only DEBIAN. When I choose windows, then PC is started boot from hda and hanged. How can I set boot windows?
Boot parameters:
Quote:

title Debian GNU/Linux, kernel 2.6.8-2-686
root (hd1,1)
kernel /boot/vmlinuz-2.6.8-2-686 root=/dev/sda2 ro
initrd /boot/initrd.img-2.6.8-2-686
savedefault
boot

title Microsoft Windows XP Professional
root (hd1,0)
savedefault
makeactive
chainloader +1
sorry for my english

bence8810 01-07-2007 09:22 AM

Hi
It seems like NTLDR is on your second disk for sure. SO when you boot from there, you will get Windows. How many partitions you have on your second disk and what are they?

And if I may ask, why is GRUB installed on a different physical device than your system? There could be some advantages for that, I just dont know it.

Your menu.lst shows that your Debian install is on the 2nd partition of the second HDD, while Windows is on the first one. Is this correct?

What I would try is to install GRUB on the second HDD, on the second partition, and then set your BIOS to boot from your second HDD, and leave your existing menu.lst for the GRUB config. However, as I am nowhere near being advanced, maybe it wouldnt hurt to hear out some other users comments.

Best regards,

Ben

title Debian GNU/Linux, kernel 2.6.8-2-686
root (hd1,1)
kernel /boot/vmlinuz-2.6.8-2-686 root=/dev/sda2 ro
initrd /boot/initrd.img-2.6.8-2-686
savedefault
boot

title Microsoft Windows XP Professional
root (hd1,0)
savedefault
makeactive
chainloader +1

Chinook06 01-07-2007 09:48 AM

Quote:

Originally Posted by bence8810
Hi
It seems like NTLDR is on your second disk for sure. SO when you boot from there, you will get Windows. How many partitions you have on your second disk and what are they?

My partitions are:
hda1-ntfs
sda1-ntfs windows
sda2-ext2 linux
sda3-swap
sda4-ntfs

Maybe

Quote:

Originally Posted by bence8810
Your menu.lst shows that your Debian install is on the 2nd partition of the second HDD, while Windows is on the first one. Is this correct?

Yes.
Quote:

Originally Posted by bence8810
And if I may ask, why is GRUB installed on a different physical device than your system? There could be some advantages for that, I just dont know it.

What I would try is to install GRUB on the second HDD, on the second partition, and then set your BIOS to boot from your second HDD, and leave your existing menu.lst for the GRUB config. However, as I am nowhere near being advanced, maybe it wouldnt hurt to hear out some other users comments.

I first installed Windows on second disk. Then I started to installed of Debian. Grub saved automaticly on first disk when I had set boot from second disk in bios.

bence8810 01-07-2007 09:58 AM

Hi

If I were you, I would install GRUB on the second partition of your second HDD, and then set that for boot, and see how it goes.

You can do this by booting to your linux, and then issue

Code:

grub-install /dev/sda2
But before you do so, read the man page, so to see if you also agree with this step or not.

Ben

luis14 01-07-2007 10:07 AM

If I'm reading this thread correctly -
edit the windows entry in your /boot/grub/menu.lst to look like this:

Code:

title          Windows XP
root (hd1,0)
map  (hd0) (hd1)
map  (hd1) (hd0)
rootnoverify (hd1,0)
chainloader +1

then set bios to boot disk hda.

Chinook06 01-07-2007 10:41 AM

luis14: Thanks. Windows boot over grub from first drive!

luis14 01-07-2007 10:45 AM

Your welcome - glad that worked for you.


All times are GMT -5. The time now is 09:43 AM.