LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Linux Answers > Applications / GUI / Multimedia
User Name
Password

Notices

By aashiks at 2005-03-30 02:53
Now I am a newbie and i must say i am well on the path to loosing that status thanks to forums like these. And i feel i must give something back.

Well I think this How TO may help any newbies like me.

This is for those people who have dumped Windows 98 and adopted Windows 2000/NT/XP as their os's and want linux to dual boot with these.

CAUTION : This how to wont work with Windows 98/95/ME . Actually i haven't used ME and so i don't know.Anyways this will only work with those Windows versions which use ntloader to boot.

There are a few pre requisites.

a) a linux boot disk/live cd
b) Use Windows 2000/NT/Xp and one of its partitions must be FAT (other than NTFS)
c) You should really know basics like partition naming in Linux and mounting.


Problem :

Installing / re installing Linux/Windows 2000/XP/NT whenever You want , without managing to mess up the MBR.


Scenario 1.

Installing Linux along with an existing windows installation .

I.Setting Up partitions

If You don't have a linux partition , make space for it , by repartitioning my disk.

Ideally You would free up a partition and divide it into two , one part for swap space , the other part for the installation.swap space partition size = 2 times that of your RAM

In the non ideal case that is , if you cant free up a whole partition you would first defragment the drive and then create two new partitions from it using PQMagic , so you don't loose data and you get two more drives. the new partition's size will be as above

II.Installing Linux

Now you can go about installing your linux system. Here the issue to be taken care of is installing the boot loader (LILO/GRUB) to the proper place

Usually the installation program will ask u were to load the boot loader. default choice would be on the MBR. Now DON'T GO FOR THIS . If u want to go my way , don't go for it. Instead , get the installer to install the boot loader onto the root partition.Also note down the root partition's name , ie) the '/dev/hda*' where * is 1,4,5 etc.
If possible create a boot disk

III. Setting up the system to boot windows too.

now when you reboot , you will go directly to the NT/XP/2000 boot menu.

Don't worry , your Linux installation is safely sitting there.

Now boot using the linux boot disk / live cd

mount the non NTFS windows partition using the following commands

mkdir /mnt/windowsdrive
mount /dev/hda* /mnt/windowsdrive

where * is 1,4,5 etc.


Now use this command to get first 512 bytes of your root partition


dd if=/dev/hdaN of=/mnt/windowsdrive/bootsect.lnx bs=512 count=1


replace /dev/hdaN with your Linux root partition name (/dev/hda something) .I had asked you to note it down , hadn't I?

now boot to windows. find out the bootsect.lnx file from which ever drive u wrote it to using the previous command.Copy it to C:\

open boot.ini and add the following line to its end

c:\bootsect.lnx="Linux"

Reboot

Now you will see "Linux" showing up in your Windows boot menu.

When u choose linux it will load the linux boot loader (LILO/Grub which ever u installed.)

You may want to remove the "Windows" choice from the linux boot loader's menu. There is no harm if u leave it there



Scenario 2.

Installing Windows NT/2000/XP along with an existing Linux installation .

1.Setup partitions.

Don't touch the linux partitions. No other precaution needed. also make the windows partition bootable.

2.Install Windows NT/2000/XP. Let it over write the MBR

3.Follow step III of Scenario 1.

Thats all

by aneroid on Mon, 2005-05-23 03:40
small modification so that u don't have to reboot into windows to add linux to the OS list:
if boot.ini is not on NTFS...
after this step
Code:
dd if=/dev/hdaN of=/mnt/windowsdrive/bootsect.lnx bs=512 count=1
Quote:
replace /dev/hdaN with your Linux root partition name (/dev/hda something) .I had asked you to note it down , hadn't I?

now boot to windows. find out the bootsect.lnx file from which ever drive u wrote it to using the previous command.Copy it to C:\

open boot.ini and add the following line to its end

c:\bootsect.lnx="Linux"
open boot.ini (u're still in linux) and add that line.

to add a newline safely...whether or not it's already there:
Code:
echo -ne '\r\nc:\\bootsect.lnx="Linux"\r\n' >> /mnt/windowsdrive/boot.ini
(note the c:\\ so that \b isn't interpreted).

no winboot required. (useful for kernel compiles and anytime u might run lilo).

anirudh

by JesusFreak84 on Sat, 2005-09-24 01:57
Is there somewhere I can get a windows-compatable partitioner for free?

by dvius on Tue, 2005-11-22 20:14
I hope somone sees this soon, cause I really wanna get out of this windows environment!
I installed Ubuntu (latest) and then Win XP Pro. I now cannot get into my Linux OS.. AAARGH!!! I installed Grub on the MBR so when I use an app called "Bootpart.exe" from within Windows to add my Linux line to Boot.ini it works up to the point where I select it from the windows bootloader, and then it says it can't find the system files on me Root partition. So I assume I'm suppose to install grub on the first sector of the Root partition? but how?
My drives look like this:

/ = hda1 ##Root (and boot?) partition for Linux
/usr = hda2 ##other partition for everything else under Linux
WindowsXP = hda3 ##Windows system partition

WindowsStorage = hdb1 ##Just space to store windows related documents etc
WindowsPageFile= hdb2 ##Dedicated windows pagefile partition
/Swap = hdb3 ## Dedicated swap partition for Linux

Windows Storage2 = hdc1 ##more dedicated storage space for windows stuff
/storage = hdc2 ##storage space for music, movies etc under Linux

by aneroid on Tue, 2005-11-22 21:33
it tends to be convenient to install the windows system partition, C: on hda1. if u haven't got too much linux data (user files or storage) on it, u may wanna consider reformatting.

but even i know that's a crappy solution. if u can boot off the cd into the linux on ur hard drive (i think specifying root=/dev/hda1, at least in slackware), then use that to create a lilo or grub conf file. i haven't used grub but in this scenario, the hide/unhide features would work well. check out http://www.faqs.org/docs/Linux-mini/...ith-GRUB.html.

in the partition example he's used, he's got win98 where u've got win xp (1st hard disk, 3rd partition).
Code:
title Windows 98
hide (hd0,0)
hide (hd0,1)
unhide (hd0,2)
rootnoverify (hd0,2)
chainloader +1
makeactive
win2k, win98 and dos follow similar rules. 'hide' all the non winxp boot partitions; specifically the one's before it, since it won't read the linux roots after. (basically, it wants to be on the 1st partition of the 1st disk).

u can store ur config on a floppy with grub-install '(fd0)'. i just read Dual-Boot Linux and Windows 2000/Windows XP with GRUB HOWTO. apparently grub isn't to be installed on the mbr. fyi, i've installed lilo on the MBR (like i said, i haven't used grub). that doc follows the same steps as the parent article. steps from both: write grub to a floppy (optional) and to a file on a shared partition and then add it to boot.ini.

wondering how ur winxp managed to install on hda without using 'hide' and a rescue floppy. did it get formatted?

hth.
anirudh

by dvius on Thu, 2005-11-24 01:00
yeah I formatted the whole disk and started from scratch. I first installed LInux (cause that's what i wanted to use) but then kinda jad to install XP.

In light of your answer. I tried using a live CD and got onto my Linux part's fine, but I couldn't get how to actually tell it to install grub to hda1, so I just formattted again and reinstalled Linux.

I'm a little impatient sometimes (and stubborn) :P

thanx for your help though!

d

by aneroid on Thu, 2005-11-24 02:06
no prob.

so finally it was: format, winxp, linux?

u might wanna search the forum for grub specific stuff, i'm sure there are others with similar issues.

anirudh

(right now reading MS's "Removing the Linux LILO Boot Manager" article. kinda funny/strange that they didn't mention why u should. can't beleive they didn't use that as another placement for 'get the facts') :P

by sundialsvcs on Thu, 2005-11-24 16:49
Save yourself a lot of hassle and simply buy a second hard-disk drive. Most motherboards have two disk-drive controllers on-board, giving you the ability to easily have three hard-drives and a CD-ROM. (And that's excluding USB 2.0 and/or FireWire if you have those!) Installing a new drive is a snap.

Most machines these days can boot from any drive, as well as (usually) USB/FireWire and maybe even the network. So you can install Linux onto a nice, "pristine" drive .. with a boot loader such as Grub, and an entry for both Windows and Linux on the startup menu. No changes whatsoever need to be made to Windows. You can even make the OS selection directly from the BIOS ("Setup") screen.

by aneroid on Thu, 2005-11-24 17:19
nice option. but he already has 3 drives. hopefully that'll be my setup real soon. my machine (about 3 yrs old) doesn't boot from usb :-( and it's only got usb 1.0. also no OS selection in BIOS.

by MarioLavoie on Thu, 2005-12-01 20:21
I had that problem for a long time until I heard of GAG, which solved all my windows and Linux installation problems.

http://gag.sourceforge.net/

by linmix on Sat, 2005-12-17 17:51
What happened to the original article. It appears to have disappeared.


  



All times are GMT -5. The time now is 09:22 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration