LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 01-06-2007, 02:59 AM   #1
bence8810
Member
 
Registered: Nov 2004
Location: Budapest, Hungary
Distribution: Debian
Posts: 110

Rep: Reputation: 15
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
 
Old 01-06-2007, 07:15 AM   #2
saman007uk
Member
 
Registered: Dec 2003
Location: ~root
Distribution: Debian
Posts: 364

Rep: Reputation: 33
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.

Last edited by saman007uk; 01-06-2007 at 07:21 AM.
 
Old 01-06-2007, 09:53 AM   #3
Chinook06
LQ Newbie
 
Registered: Mar 2006
Posts: 15

Rep: Reputation: 0
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

Last edited by Chinook06; 01-06-2007 at 09:56 AM.
 
Old 01-06-2007, 10:25 AM   #4
bence8810
Member
 
Registered: Nov 2004
Location: Budapest, Hungary
Distribution: Debian
Posts: 110

Original Poster
Rep: Reputation: 15
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
 
Old 01-07-2007, 08:46 AM   #5
Chinook06
LQ Newbie
 
Registered: Mar 2006
Posts: 15

Rep: Reputation: 0
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?
 
Old 01-07-2007, 09:12 AM   #6
Chinook06
LQ Newbie
 
Registered: Mar 2006
Posts: 15

Rep: Reputation: 0
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

Last edited by Chinook06; 01-07-2007 at 09:13 AM.
 
Old 01-07-2007, 09:22 AM   #7
bence8810
Member
 
Registered: Nov 2004
Location: Budapest, Hungary
Distribution: Debian
Posts: 110

Original Poster
Rep: Reputation: 15
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
 
Old 01-07-2007, 09:48 AM   #8
Chinook06
LQ Newbie
 
Registered: Mar 2006
Posts: 15

Rep: Reputation: 0
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.
 
Old 01-07-2007, 09:58 AM   #9
bence8810
Member
 
Registered: Nov 2004
Location: Budapest, Hungary
Distribution: Debian
Posts: 110

Original Poster
Rep: Reputation: 15
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
 
Old 01-07-2007, 10:07 AM   #10
luis14
Member
 
Registered: Jun 2006
Location: Des Moines
Distribution: Debian Lenny
Posts: 59

Rep: Reputation: 15
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.

Last edited by luis14; 01-07-2007 at 10:10 AM.
 
Old 01-07-2007, 10:41 AM   #11
Chinook06
LQ Newbie
 
Registered: Mar 2006
Posts: 15

Rep: Reputation: 0
luis14: Thanks. Windows boot over grub from first drive!
 
Old 01-07-2007, 10:45 AM   #12
luis14
Member
 
Registered: Jun 2006
Location: Des Moines
Distribution: Debian Lenny
Posts: 59

Rep: Reputation: 15
Your welcome - glad that worked for you.
 
  


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 failure(Debian Etch and WindowsXP pro) MichaelYoung Debian 9 10-23-2006 11:48 AM
Urgent: Installing debian etch on a new hdd but grub won't install (fatal error) MrInept Debian 4 09-14-2006 08:54 AM
Dual boot XP(internal IDE HDD) Debian(external USB-IDE HDD) using boot.ini PolarDog Linux - Laptop and Netbook 2 07-01-2005 09:50 PM
? Configuring GRUB on Debian/sarge to boot Knoppix from HDD? killerwh Debian 4 10-14-2004 09:38 AM
debian dual boot with xp on separare hdd katanads Debian 3 09-25-2004 08:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 02:32 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
Open Source Consulting | Domain Registration