LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Help with installing windows after linux and dual-booting (https://www.linuxquestions.org/questions/linux-general-1/help-with-installing-windows-after-linux-and-dual-booting-589999/)

oem 10-07-2007 01:40 AM

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.

Simon Bridge 10-07-2007 01:49 AM

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...)

syg00 10-07-2007 02:48 AM

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.

oem 10-07-2007 05:31 PM

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.

saikee 10-07-2007 06:05 PM

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.

Simon Bridge 10-07-2007 07:41 PM

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.

oem 10-07-2007 08:49 PM

Quote:

Originally Posted by Simon Bridge (Post 2916674)
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 (Post 2916611)
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.

Simon Bridge 10-07-2007 09:37 PM

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.

oem 10-08-2007 10:00 AM

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 (Post 2916757)
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.

saikee 10-08-2007 11:28 AM

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.

Simon Bridge 10-08-2007 11:57 AM

Quote:

The (hd0) and (hd1) in Lilo are called 0x80 and 0x81 respectively.
Oh I see... I'm getting my mootloaders bixed.

oem 10-08-2007 07:48 PM

Quote:

Originally Posted by saikee (Post 2917321)
The (hd0) and (hd1) in Lilo are called 0x80 and 0x81 respectively.

hd0 & hd1 or hda & hdb?

I will try those lines.
Thanks!
OEM.

saikee 10-09-2007 02:20 AM

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.

oem 10-09-2007 10:16 PM

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! :D
OEM.

saikee 10-10-2007 02:20 AM

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.


All times are GMT -5. The time now is 02:21 AM.