LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 10-07-2007, 01:40 AM   #1
oem
LQ Newbie
 
Registered: Jun 2007
Distribution: gentoo
Posts: 7

Rep: Reputation: 0
Help with installing windows after linux and dual-booting


Hi, I need help on this subject. I'm running Gentoo and I need to install Windows in one of my 2 HDs. I have found some stuff in google, but doesn't seems to match my config.


fdisk -l output:
--------------------------------------------------------------
Disk /dev/hda: 82.3 GB, 82348277760 bytes
255 heads, 63 sectors/track, 10011 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 4 32098+ 83 Linux
/dev/hda2 1959 10010 64677690 f W95 Ext'd (LBA)
/dev/hda3 5 66 498015 82 Linux swap / Solaris
/dev/hda4 67 1958 15197490 83 Linux
/dev/hda5 1959 10010 64677658+ 7 HPFS/NTFS

Partition table entries are not in disk order

Disk /dev/hdb: 20.4 GB, 20416757760 bytes
255 heads, 63 sectors/track, 2482 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 1 5 40131 83 Linux
/dev/hdb2 6 68 506047+ 82 Linux swap / Solaris
/dev/hdb3 * 69 625 4474102+ 7 HPFS/NTFS
/dev/hdb4 626 2482 14916352+ 7 HPFS/NTFS
--------------------------------------------------------------

hda1 is my /boot.
hda2 is and extended that I don't know how it appeared.
hda3 is my swap.
hda4 is my /
hda5 is a data NTFS partition.

hdb1 & hdb2 are from an old gentoo install and can be deleted.
hdb3 is from an old Win2000 installation (and I was planning to install WinXP in there).
hdb4 is another data partition.

Partitions that cannot be touched: hda4 (don't want to reinstall gentoo) & hda5 & hdb4 (lots of data). The others can be modified as long as data inside hda4, hda5 and hdb4 can still be accessible.

Problem is: when I tried to install WinXP in hdb3, installation said that it needed some space in the master HD (hda).
What can I do to install WinXP with my configuration?
Thanks a lot in advance!

OEM.

Last edited by oem; 10-07-2007 at 08:58 PM.
 
Old 10-07-2007, 01:49 AM   #2
Simon Bridge
Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 197Reputation: 197
XP wants to be on the primary master.

Remove the gentoo drive, set the other drive to primary master and install windows normally.

Reorder the drives and boot back to gentoo.

Add a grub entry for the windows partition - remembering to use the map command.

(thats probably safest - I suspect that widows just wants it's bootloader in the mba...)

Last edited by Simon Bridge; 10-07-2007 at 01:50 AM.
 
Old 10-07-2007, 02:48 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,285

Rep: Reputation: 1029Reputation: 1029Reputation: 1029Reputation: 1029Reputation: 1029Reputation: 1029Reputation: 1029Reputation: 1029
I don't like dicking with the drives - just change the boot order in the BIOS, then change it back when the 'doze install is finished.
Else, as per above.
 
Old 10-07-2007, 05:31 PM   #4
oem
LQ Newbie
 
Registered: Jun 2007
Distribution: gentoo
Posts: 7

Original Poster
Rep: Reputation: 0
no /boot/vmlinuz?!

I haven't switched HDs yet, but I wanted to add the entry in lilo.conf first. When I ran /sbin/lilo, the following error came up:

/sbin/lilo output:
-------------------------------------
Warning: LBA32 addressing assumed
Fatal: open /boot/vmlinuz: No such file or directory
-------------------------------------

I looked into /boot and indeed there's no vmlinuz in there!
Do I have to recompile kernel to get that image?

Thanks.
OEM.

Last edited by oem; 10-07-2007 at 08:57 PM.
 
Old 10-07-2007, 06:05 PM   #5
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
Read Section A of the 2nd link in my signature. It was written for a user with two disks; one for Linux and one for Windows.

The heart of the method is to use Lilo to reverse the boot disk order on-the-fly. Your boot disk should always hda. You use Bios to boot hdb as the first boot disk when install the Windows, have it working properly then change back to hda as the boot disk and never touch the Bios again. The re-mapping of the hard disks is a basic function of the Linux boot loaders. Both Grub and Lilo eat such task for breakfast.

Last edited by saikee; 10-07-2007 at 06:10 PM.
 
Old 10-07-2007, 07:41 PM   #6
Simon Bridge
Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 197Reputation: 197
Quote:
I looked into /boot and indeed there's no vmlinuz in there!
Presumably you have been able to boot fine so far... it doesn't matter if you add the lilo.conf entry after installing windows. But everyone I've seen do this just uses a text editor on the actual file.
 
Old 10-07-2007, 08:49 PM   #7
oem
LQ Newbie
 
Registered: Jun 2007
Distribution: gentoo
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Simon Bridge View Post
Presumably you have been able to boot fine so far... it doesn't matter if you add the lilo.conf entry after installing windows. But everyone I've seen do this just uses a text editor on the actual file.
Yes, my gentoo boots fine right now, even without /boot/vmlinuz...


Quote:
Originally Posted by saikee View Post
Read Section A of the 2nd link in my signature. It was written for a user with two disks; one for Linux and one for Windows.

The heart of the method is to use Lilo to reverse the boot disk order on-the-fly. Your boot disk should always hda. You use Bios to boot hdb as the first boot disk when install the Windows, have it working properly then change back to hda as the boot disk and never touch the Bios again. The re-mapping of the hard disks is a basic function of the Linux boot loaders. Both Grub and Lilo eat such task for breakfast.
Yes, I think that would work ok, but the thing is I cannot write to the MBR using /sbin/lilo because of that error. Also, I don't understand very well that mapping thing.
How can I recover the vmlinuz image?

Thank you.
OEM.

Last edited by oem; 10-07-2007 at 08:51 PM.
 
Old 10-07-2007, 09:37 PM   #8
Simon Bridge
Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 197Reputation: 197
Quote:
I cannot write to the MBR
You don't need to. The windows installer will overwrite the mbr of the BIOS-designated primary master. At install, this is not the gentoo drive. After windows is installed, you get BIOS to swap the drives over again... the gentoo MBR goes under the gun again and boots like normal.

You will now have two physical drives. The GENTOO drive has lilo in it's MBR and the WINDOWS drive has NTLoader(?) in it's MBR. BIOS is set to boot from information in the GENTOO MBR, which will load LILO. This is A Good Thing.

At this stage, windows is unbootable. You correct this by adding a lilo.conf entry which maps the windows partition to (hd0,0) and chainloads the windows bootloader.
 
Old 10-08-2007, 10:00 AM   #9
oem
LQ Newbie
 
Registered: Jun 2007
Distribution: gentoo
Posts: 7

Original Poster
Rep: Reputation: 0
The problem was that after editing lilo.conf I had to run /sbin/lilo, but it always gave me that "Fatal: open /boot/vmlinuz: No such file or directory" error. I fixed it by copying /usr/local/src/linux/i386/bzImage (I think that was the path) to /boot/vmlinuz. Now /sbin/lilo runs without errors (I wonder why those images dissapeared...). Now I have installed windows. Next thing is...

Quote:
Originally Posted by Simon Bridge View Post
At this stage, windows is unbootable. You correct this by adding a lilo.conf entry which maps the windows partition to (hd0,0) and chainloads the windows bootloader.
How do I add those entries, Simon, and what they are for?

Thanks!!
OEM.
 
Old 10-08-2007, 11:28 AM   #10
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
If you have installed Windows to hdb3 then these lines in lilo.conf should fire it up
Code:
other=/dev/hdb3
label=Windows-hdb3
map-drive = 0x81
to = 0x80

map-drive = 0x80
to = 0x81
The (hd0) and (hd1) in Lilo are called 0x80 and 0x81 respectively.
 
Old 10-08-2007, 11:57 AM   #11
Simon Bridge
Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 197Reputation: 197
Quote:
The (hd0) and (hd1) in Lilo are called 0x80 and 0x81 respectively.
Oh I see... I'm getting my mootloaders bixed.
 
Old 10-08-2007, 07:48 PM   #12
oem
LQ Newbie
 
Registered: Jun 2007
Distribution: gentoo
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by saikee View Post
The (hd0) and (hd1) in Lilo are called 0x80 and 0x81 respectively.
hd0 & hd1 or hda & hdb?

I will try those lines.
Thanks!
OEM.
 
Old 10-09-2007, 02:20 AM   #13
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
hda and hdb are names in Linux

(hd0) and (hd1) are the same device names in Grub. Grub's ambition lies beyond Linux and is a general boot loader for a PC system. Thus one must adopt its convention when instructing Grub.

The official Linux Loader is Lilo so everything about Lilo is compatible with Linux. I believe the number 0x80 and 0x81 are the hex numbers of the first two hard disk devices as handed by the Bios.
 
Old 10-09-2007, 10:16 PM   #14
oem
LQ Newbie
 
Registered: Jun 2007
Distribution: gentoo
Posts: 7

Original Poster
Rep: Reputation: 0
from lilo.conf(5) man page:
-------------------------------------------------
map-drive=<num>
Maps BIOS calls for the specified drive to the device code specified on the next line as to=<num>. This mapping is useful for
booting operating systems, such as DOS, from the second hard
drive. The following, swaps the C: and D: drives,

map-drive=0x80
to=0x81
map-drive=0x81
to=0x80

This option is largely rendered obsolete by "boot-as=", intro-
duced with LILO version 22.5.
-------------------------------------------------

so I did:

other=/dev/hdb1
label=winXP
table=/dev/hdb
boot-as=0x80

and worked fine!
Thank you so much, people!
OEM.
 
Old 10-10-2007, 02:20 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: 112Reputation: 112
oem,

Thanks for the reminder. I use it because the 2 "map-drive" statements are very similar to the Grub's 2 "map" statements, thus easy to remember.
 
  


Reply

Tags
dual boot, linux, windows


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
New to Linux - dual booting with Windows FlameLover Linux - Newbie 4 12-12-2005 09:18 AM
dual booting Linux with Windows XP jimpalla Linux - Newbie 6 01-20-2005 11:00 AM
Dual booting windows + linux untwisted Linux - General 8 09-23-2004 01:26 PM
Dual Booting Linux and Windows Mandarb Linux - Software 3 05-05-2004 09:41 AM
dual booting windows with linux garorag Linux - General 1 01-19-2003 09:17 PM


All times are GMT -5. The time now is 05:22 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration