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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
10-07-2007, 02:40 AM
|
#1
|
LQ Newbie
Registered: Jun 2007
Distribution: gentoo
Posts: 7
Rep:
|
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 09:58 PM.
|
|
|
10-07-2007, 02:49 AM
|
#2
|
LQ Guru
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211
Rep:
|
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 02:50 AM.
|
|
|
10-07-2007, 03:48 AM
|
#3
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,317
|
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.
|
|
|
10-07-2007, 06:31 PM
|
#4
|
LQ Newbie
Registered: Jun 2007
Distribution: gentoo
Posts: 7
Original Poster
Rep:
|
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 09:57 PM.
|
|
|
10-07-2007, 07:05 PM
|
#5
|
Senior Member
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Rep:
|
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 07:10 PM.
|
|
|
10-07-2007, 08:41 PM
|
#6
|
LQ Guru
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211
Rep:
|
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.
|
|
|
10-07-2007, 09:49 PM
|
#7
|
LQ Newbie
Registered: Jun 2007
Distribution: gentoo
Posts: 7
Original Poster
Rep:
|
Quote:
Originally Posted by Simon Bridge
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
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 09:51 PM.
|
|
|
10-07-2007, 10:37 PM
|
#8
|
LQ Guru
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211
Rep:
|
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.
|
|
|
10-08-2007, 11:00 AM
|
#9
|
LQ Newbie
Registered: Jun 2007
Distribution: gentoo
Posts: 7
Original Poster
Rep:
|
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
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.
|
|
|
10-08-2007, 12:28 PM
|
#10
|
Senior Member
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Rep:
|
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.
|
|
|
10-08-2007, 12:57 PM
|
#11
|
LQ Guru
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211
Rep:
|
Quote:
The (hd0) and (hd1) in Lilo are called 0x80 and 0x81 respectively.
|
Oh I see... I'm getting my mootloaders bixed.
|
|
|
10-08-2007, 08:48 PM
|
#12
|
LQ Newbie
Registered: Jun 2007
Distribution: gentoo
Posts: 7
Original Poster
Rep:
|
Quote:
Originally Posted by saikee
The (hd0) and (hd1) in Lilo are called 0x80 and 0x81 respectively.
|
hd0 & hd1 or hda & hdb?
I will try those lines.
Thanks!
OEM.
|
|
|
10-09-2007, 03:20 AM
|
#13
|
Senior Member
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Rep:
|
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.
|
|
|
10-09-2007, 11:16 PM
|
#14
|
LQ Newbie
Registered: Jun 2007
Distribution: gentoo
Posts: 7
Original Poster
Rep:
|
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.
|
|
|
10-10-2007, 03:20 AM
|
#15
|
Senior Member
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Rep:
|
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 12:22 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|