File: larriera.html

package info (click to toggle)
lg-issue36 2-4
  • links: PTS
  • area: main
  • in suites: woody
  • size: 2,920 kB
  • ctags: 242
  • sloc: makefile: 36; sh: 4
file content (203 lines) | stat: -rw-r--r-- 8,979 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
<!--startcut ==========================================================-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<title>Booting Linux with the NT Loader LG #36</title>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#A000A0"
ALINK="#FF0000">
<!--endcut ============================================================-->

<H4>
"Linux Gazette...<I>making Linux just a little more fun!</I>"
</H4>

<P> <HR> <P> 
<!--===================================================================-->

<center>
<H1><font color="maroon">Booting Linux with the NT Loader</font></H1>
<H4>By <a href="mailto:glarrier@ei.edu.uy">Gustavo Larriera</a></H4>
</center>
<P> <HR> <P>  

On these days technical professionals like you and me often
must deal with the following scenario: To make Linux and NT
peacefully coexist on the same machine. Many HOW-TOs have been
written -and it's a good advice to give them a look- about how to
configure LILO (The Linux Loader) to do the task. Unfortunately,
classic documentation have little references about the NT Loader.
Yes, I know for some people there's some kind of religious war
between Linux and NT out there :-) But from the point of view of
a IT professional, the main objective is to have the job well
done. </p>

<p>In many real-life situations we must tackle with a
installation where it is not desirable to alter the NT boot
process. May be it is your machine's boss and he/she prefers to
keep on booting the same way for ever ;-) In this article I will
focus on how to configure the NT Loader so as to boot Linux (and
continue booting NT also!). </p>

<p>I hope these tips will help Linux users to successfully boot
Linux through the NT Loader the easiest way. The procedure I will
explain works for NT Server 4 and NT Workstation 4 running on
Intel-compatible PC. </p>

<h2>The Scenario </h2>

<p>After long conversation you have convinced your boss to put
Linux on her computer machine. She is a happy NT user, she loves
Word and Excel and such. She also is a clever person and has
decided to give Linux a try. So she wants to have Linux
installed. Just a moment: She prefers to keep booting with her
familiar loading menu, from where she can choose to boot NT or
DOS. Her wishes are your wishes, so you decide not to use LILO to
dual-boot her computer. </p>

<h2>The MBR considered useful </h2>

<p>The most important thing you must always remember is that many
software products sit on your unique precious hard disk's Master
Boot Record (MBR). So does NT without asking and so optionally
does LILO if you want to. The machine's BIOS executes code stored
on the active partition to initiate your preferred OS. </p>

<p>When NT is installed, the MBR is modified to load a program
called NTLDR from the active partition's root directory. The
original MBR is saved on a small file called BOOTSECT.DOS. After
a NT installation, be careful never overwrite the MBR, because
the NT will no longer boot. To fix this problem, a NT user needs
the NT's Emergency Repair Disk (ERD). </p>

<p>With those things in mind, take note you must be careful to
configure LILO *not* to install on MBR. Instead you will need to
configure LILO on the root partition of Linux. That's safe for NT
and Linux can live without the MBR. </p>

<h2>NT loading process </h2>

<p>Once the NTLDR program launchs the NT user watch the &quot;OS
Loader V4.xx&quot; message. Then NTLDR shifts the processor to
386 mode and starts a very simple file system. After that, it
reads the file BOOT.INI to find out if there are other operating
systems and prompts the user with a menu. A typical BOOT.INI
looks like this: </p>

<pre>
[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(2)\WINNT

[operating systems]
multi(0)disk(0)rdisk(0)partition(2)\WINNT=&quot;NT V4 is here&quot;
multi(0)disk(0)rdisk(0)partition(2)\WINNT=&quot;NT V4 VGAMODE&quot; /basevideo /sos
C:\=&quot;DOS is here&quot;
</pre>

<p>The BOOT.INI file has two sections. The &quot;boot loader
section&quot; specifies how long in seconds will be the menu on
screen and the default menu choice. The &quot;opearating systems
section&quot; specifies the different OSs the user can choose. We
can read the machine boots NT (either in normal mode or in VGA
diagnosing mode) and also can boot DOS. We can deduce from this
example that DOS boots from the partition C: (first partition on
first disk) and NT boots from the second partition. Typical
installations have a C: partition formatted with DOS's FAT file
system and NT on another partition formatted with its NTFS (NT
File System). </p>

<p>If the user chooses to load NT, another program NTDETECT.COM
runs to check the existent hardware. If everything was okay, the
NT kernel is loaded and that's all we need to know. </p>

<p>Let's examine what happens if the user decide to choose other
OS rather than NT. In this situation, NTLDR needs to know which
is the boot sector required to load the non-NT OS. The appropiate
boot sector image must exists on a small 512-byte file. For
instance, to load DOS, NTLDR searches for a boot sector image
file called BOOTSECT.DOS. This image was created by the NT
installation. </p>

<p>So, what if I want to load Linux? It's quite simple, all we
need is a boot sector image file, let's name it BOOTSECT.LIN
(later we'll see how to obtain this file). You must put
BOOTSECT.LIN on C: and edit BOOT.INI, the &quot;operating systems
section&quot; now looking something like this: </p>

<pre>
[operating systems]
multi(0)disk(0)rdisk(0)partition(2)\WINNT=&quot;NT V4 is here&quot;
multi(0)disk(0)rdisk(0)partition(2)\WINNT=&quot;NT V4 VGAMODE&quot; /basevideo /sos
C:\=&quot;DOS is here&quot;
C:\BOOTSECT.LIN=&quot;Now Linux is here&quot; 
</pre>

<p>The BOOT.INI can be edited with any plain ASCII text editor.
Normally this file has system-hidden-readonly attributes, so you
must change them using the 'attrib' DOS command or within NT,
from the file's property dialogbox. </p>

<h2>The Linux side of the story </h2>

<p>Now let's concentrate on the Linux shore. We need to install
Linux, configure LILO and create the BOOTSECT.LIN file. </p>

<p>The first step is to have Linux installed. We all know how to
do that: Choose appropiate partitions for Linux system, swap and
user's stuff, run installation program, etc. Easy cake, first
step is completed okay in less than 45 minutes. </p>

<p>Then we must configure LILO. We also know how to do that, but
be careful *not* to install LILO on the MBR (unless you hate NT
too much :-)) When configuring LILO, choose to install it on your
Linux root partition. If you don't know how to configure LILO,
spend some minutes reading the HOW-TOs or use some of the useful
setup programs most modern Linux distributions have. My
installation is S.u.S.E., so I use the 'yast' (Yet Another Setup
Tool). </p>

<p>Once LILO is configured (let's asume the Linux root partition
is /dev/hda3) we must use 'dd' to create the boot record image.
Login as root and do the following: </p>

<pre>
# dd if=/dev/hda3 bs=512 count=1 of=/dosc/bootsect.lin 
</pre>

<p>Prior you have mounted the FAT C: partition as /dosc. Just in
case you cannot access to this partition, for instance if it's
formatted with NTFS, just write BOOTSECT.LIN to a DOS-formatted
diskette or some partition where NT can read from. If you put
BOOTSECT.LIN in a place othet than C:\ remember to modify the
BOOT.INI file accordingly. </p>

<p>Now your boss can choose Linux from her NT Loader's menu. The
NTLDR will load the BOOTSECT.INI and she'll see the LILO prompt.
Then she'll plunge into her new Linux box. Finally, if you
configured LILO to load Linux and also the DOS on C: when LILO
prompts, your boss will reload from the active C: partition,
again into NT Loader. The procedure described may be repeated if
you wish to boot several Linuxes, you must just create
appropiated boot sector image files for each of your Linuxes.</p>


<!--===================================================================-->
<P> <hr> <P> 
<center><H5>Copyright &copy; 1999, Gustavo Larriera<BR> 
Published in Issue 36 of <i>Linux Gazette</i>, January 1999</H5></center>

<!--===================================================================-->
<P> <hr> <P> 
<A HREF="./lg_toc36.html"><IMG ALIGN=BOTTOM SRC="../gx/indexnew.gif" 
ALT="[ TABLE OF CONTENTS ]"></A>
<A HREF="../lg_frontpage.html"><IMG ALIGN=BOTTOM SRC="../gx/homenew.gif"
ALT="[ FRONT PAGE ]"></A>
<A HREF="./lg_answer36.html"><IMG SRC="../gx/back2.gif"
ALT=" Back "></A>
<A HREF="./defurne1.html"><IMG SRC="../gx/fwd.gif" ALT=" Next "></A>
<P> <hr> <P> 
<!--startcut ==========================================================-->
</BODY>
</HTML>
<!--endcut ============================================================-->