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.
|
 |
12-01-2005, 06:45 AM
|
#1
|
LQ Newbie
Registered: Nov 2005
Location: London, UK
Distribution: Ubuntu
Posts: 14
Rep:
|
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,
|
|
|
12-01-2005, 04:26 PM
|
#2
|
LQ Addict
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908
|
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).
|
|
|
12-01-2005, 05:13 PM
|
#3
|
LQ Newbie
Registered: Nov 2005
Location: London, UK
Distribution: Ubuntu
Posts: 14
Original Poster
Rep:
|
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
|
|
|
12-01-2005, 08:50 PM
|
#4
|
Member
Registered: Jan 2005
Posts: 51
Rep:
|
There are so many sites about this subject.
|
|
|
12-02-2005, 07:58 AM
|
#5
|
Senior Member
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Rep: 
|
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.
|
|
|
12-08-2005, 10:43 AM
|
#6
|
LQ Newbie
Registered: Nov 2005
Location: London, UK
Distribution: Ubuntu
Posts: 14
Original Poster
Rep:
|
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..
|
|
|
12-08-2005, 10:52 AM
|
#7
|
Senior Member
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Rep: 
|
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.
|
|
|
12-15-2005, 06:59 AM
|
#8
|
LQ Newbie
Registered: Nov 2005
Location: London, UK
Distribution: Ubuntu
Posts: 14
Original Poster
Rep:
|
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 
|
|
|
All times are GMT -5. The time now is 07:49 AM.
|
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
|
|