LinuxQuestions.org
Visit Jeremy's Blog.
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 12-01-2005, 06:45 AM   #1
hommy
LQ Newbie
 
Registered: Nov 2005
Location: London, UK
Distribution: Ubuntu
Posts: 14

Rep: Reputation: 0
Dual boot?


Hi,

I have my machine with Ubuntu only, but now i want to install Windows on another partition, i've never done it this way always the oposite windows and then linux.

My current HD config is has follows:
HD1 has a 500mb boot partition, and a 39gb main partition (where ubuntu is),

HD2 has a 35gb partition and a 4GB swap.

Windows will go into the HD1 39Gb partition that will be split in 2 (to have both OS's)

How can i install windows now, but keep using the boot software of linux (can't remember the name).

Any tips and concerns much apreciated.

Regards,
 
Old 12-01-2005, 04:26 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
When you install windows, it will write its own bootloader to the MBR. You will not be able to boot Linux unless you have a boot floppy/cd, installation cd, or a Linux folder in the windows partition with a batch file, loadlin.exe, and vmlinuz (the compressed kernel image from /boot.

Do yourself a favor and make certain that you have a way to boot Linux after installing windows. Once windows is up and running, reboot to Linux. You will have to manually edit the bootloader config to add windows to it.

You will also have to write the bootloader to the MBR. On boot, it will show you the OSs installed, and give you the choice of which to boot, as well as making one of them the default to boot after a specified amount of time. Of course, you have the option of leaving windows bootloader in the MBR, and booting Linux from floppy. That works ok until the floppy drive dies or the boot disk becomes corrupt.

Ubuntu probably uses the grub bootloader. The grub manual gives good instructions on editing the config file (in some distros that file is /boot/grub/menu.lst. In others it's /etc/grub.conf. Same file; different name and location).
 
Old 12-01-2005, 05:13 PM   #3
hommy
LQ Newbie
 
Registered: Nov 2005
Location: London, UK
Distribution: Ubuntu
Posts: 14

Original Poster
Rep: Reputation: 0
Hi my floppy drive died a long time ago... I have the Ubuntu installation CD, will i be able to boot the installed version from it?

What is the MBR? and how can i write the linux bootloader to it? Is it possible to pre-prepare the bootloader, and force windows not to write it's own bootloader (i guess not but doesn't cost to ask)?

FYI my distro is Breezy and grub's config file is in this location /boot/grub/menu.lst

Thanks for your help
 
Old 12-01-2005, 08:50 PM   #4
namish
Member
 
Registered: Jan 2005
Posts: 51

Rep: Reputation: 15
There are so many sites about this subject.
 
Old 12-02-2005, 07:58 AM   #5
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
kind of tricky if you haven't got a floppy drive.

You can get into a workable buy unbootable Ubuntu any time with any Live CD or original installation CD.

You need to resize the partition in disk 1 to squeeze disk out to create a partition for your Windows first. So your hda1 is /boot, assuming Ubuntu in hda2 and so the new hda3 can be created for your Windows installation. Just make sure Ubuntu is running in the resized hda2 before installing Windows in hda3.

Windows will always write its boot loader on the first 512 bytes (or MBR) of the hard disk so that BIOS can boot it. So it is alright to install Windows after you have Linux.

When have Windows running, no Ubuntu and are happy with it then you dual boot the systems as follow

(1) Boot up a Live CD, any one will do, make a temp directory called /mnt/temp, mount the root of Ubuntu on it, change root to Ubuntu and replicate Ubuntu's Grub in the MBR

mkdir /mnt/temp
mount /dev/hda2 /mnt/temp
chroot /mnt/temp <----------you now inside Ubuntu
grub-install /dev/hda
exit
reboot

(2) Having boot back to Ubuntu, you should have no access to WIndow, so to cure it you add these lines to Ubuntu's /boot/grub/menu.lst

Title My Windows in hda3
root (hd0,2)
chainloader +1

save file on a reboot Windows should be yours again in a dual boot format.

Remeber Grub counts from 0 so (hd0,2) = hda3 or the 3rd partition fron 1st disk.
 
Old 12-08-2005, 10:43 AM   #6
hommy
LQ Newbie
 
Registered: Nov 2005
Location: London, UK
Distribution: Ubuntu
Posts: 14

Original Poster
Rep: Reputation: 0
Ok managed to do it successfully today...

Couple of things for people that want to do this, first when resizing the partition (my case a ext3) when using resize2fs use KB's instead of GB, and the same when shrinking the partition with fdisk. At least with me i've used GB on resize2fs and as well in fdisk, and when doing the check (e2fsck), i had loads of problems, different blocks on superblock and the physical size.

Another thing, when reinstalling grub, do has saikee says, but run grub after the install and run the following commands on the grub console:

root (hd0,0) -> if your boot partition is hda1
setup (hd0)
quit

exit and then mount the boot partition and change the menu as said above.

Good luck..
 
Old 12-08-2005, 10:52 AM   #7
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 113Reputation: 113
hommy,

grub-install is the way to do it in a Bash shell

root ()+setup () is to do the same thing in a Grub shell

The two are identical in nature but the latter is slightly robust.
 
Old 12-15-2005, 06:59 AM   #8
hommy
LQ Newbie
 
Registered: Nov 2005
Location: London, UK
Distribution: Ubuntu
Posts: 14

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by saikee
hommy,

grub-install is the way to do it in a Bash shell

root ()+setup () is to do the same thing in a Grub shell

The two are identical in nature but the latter is slightly robust.
I don't totally agree, do to my experience, when i loaded my machine again, it didn't show me any options, just a grub shell. grub-install didn't configured my Ubuntu load scripts properly, only after setting the root and setup it showed them.

But anyway thanks for your help, if it wasn't for you i would be completely stuck
 
  


Reply


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
Problem with dual boot/dual drive setup Norab Linux - Hardware 10 08-29-2005 03:13 PM
Fedora Core 3 Dual Boot, Dual Hard drives, Grub Boot Loader Denali03 Linux - Newbie 1 03-04-2005 01:44 PM
hOw to dual boot linux suse with a dual boot win98/xp pc walterkai SUSE / openSUSE 1 12-14-2004 05:04 PM
Advice (and some) Needed: Dual-HDD, Dual-Boot - Linux, WinXP elnomadkvn Linux - General 1 03-28-2004 10:11 AM
Newbie needs Mandrake/Win98 dual-HD, dual boot system design help... buddha Linux - Newbie 20 09-04-2003 08:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:49 AM.

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