should be of type 82 if swap and 83 for regular filesystems (whether ReiserFS, ext2/3 or other). </p>

460

<note><c>cfdisk</c> is included on the install CD, and it is <i>considerably</i> easier to use than

461

<c>fdisk</c>. Just type <c>cfdisk</c> to run it; by default, cfdisk will work with <b>/dev/hda</b>. If /dev/hda is not the hard disk you want to partition, give the right value to cfdisk as a parameter. For example: <c>cfdisk /dev/hde</c></note>

462

<note>If <c>fdisk</c> or <c>cfdisk</c> instruct you to do so, please reboot to allow your system to detect the

463

new partition configuration.</note>

464

<note>If you are using RAID your partitions will be a little different. You

465

will have the partitions like this: <path>/dev/ataraid/discX/partY</path> X is

466

the arrays you have made, so if you only have made 1 array, then it will be

467

disc0.Y is the partition number as in <path>/dev/hdaY</path></note>

468

<p>Once you've created your partitions, it's time to initialize

469

the filesystems that will be used to house our data. Initialize swap as follows:</p>

470

<precaption="Initializing Swap">

471

# <c>mkswap /dev/hda2</c>

472

</pre>

473

<p>You can use the <c>mke2fs</c> command to create ext2 filesystems.</p>

474

<precaption="Creating an ext2 Filesystem">

475

# <i>mke2fs /dev/hda1</i>

476

</pre>

477

<p>To create an XFS filesystem, use the <c>mkfs.xfs</c> command.</p>

478

<precaption="Creating a XFS Filesystem">

479

# <c>mkfs.xfs /dev/hda3</c>

480

</pre>

481

<note>

482

You may want to add a couple of additional flags to the <c>mkfs.xfs</c> command: <c>-d agcount=3 -l size=32m</c>.

483

The <c>-d agcount=3</c> command will lower

484

the number of allocation groups. XFS will insist on using at least 1 allocation group per 4 GB of your partition,

485

so, for example, if you hava a 20 GB partition you will need a minimum agcount of 5.

<path>(hd0,0)</path> in GRUB terminology. Then, the second <c>setup ( )

1206

</c> command tells GRUB where to install the

1207

boot record - it will be configured to look for its special files at the <c>root

1208

( )</c> location that you specified. In my case, I want the boot record on the

1209

MBR of the hard drive, so I simply specify <path>/dev/hda</path> (also known as <path>(hd0)</path>).

1210

If I were using another boot loader and wanted to set up GRUB as a secondary boot-loader, I

1211

could install GRUB to the boot record of a particular partition. In that case,

1212

I'd specify a particular partition rather than the entire disk. Once the GRUB

1213

boot record has been successfully installed, you can type <c>quit</c> to quit GRUB.

1214

1215

<note> The tab completion mechanism of grub can be used from within grub,

1216

assuming you wrote <c> root (</c> and that you hit the TAB key, you would

1217

be prompted with a list of the available devices (not only harddrives),

1218

hitting the TAB key having written <c> root (hd</c>, grub would print the

1219

available harddrives and hitting the TAB key after writing <c> root (hd0,</c>

1220

would make grub print the list of partitions on the first harddrive.

1221

1222

Checking the syntax of the grub location with completion should really help

1223

to make the right choice.

1224

</note>

1225

1226

Gentoo Linux is now

1227

installed, but we need to create the <path>/boot/grub/grub.conf</path> file so that

1228

we get a nice GRUB boot menu when the system reboots. Here's how to do it.

1229

</p>

1230

<impo>To ensure backwards compatibility with GRUB, make sure to make a link from

1231

<i>grub.conf</i> to <i>menu.lst</i>. You can do this by doing

1232

<c>ln -s /boot/grub/grub.conf /boot/grub/menu.lst </c>. </impo>

1233

<p>Now, create the grub.conf file (<c>nano -w /boot/grub/grub.conf</c>), and add the following to it:

1234

</p>

1235

<precaption="Grub.conf for GRUB">

1236

default 0

1237

timeout 30

1238

splashimage=(hd0,0)/boot/grub/splash.xpm.gz

1239

1240

title=My example Gentoo Linux

1241

root (hd0,0)

1242

kernel /boot/bzImage root=/dev/hda3

1243

1244

<comment> #Below is for setup using hardware RAID</comment>

1245

title=My Gentoo Linux on RAID

1246

root (hd0,0)

1247

kernel /boot/bzImage root=/dev/ataraid/discX/partY

1248

1249

<comment># Below needed only for people who dual-boot</comment>

1250

title=Windows NT Workstation

1251

root (hd0,5)

1252

chainloader +1

1253

</pre>

1254

<note>

1255

(hd0,0) should be written without any spaces inside the parentheses.

1256

</note>

1257

<impo>

1258

If you set up scsi emulation for an IDE cd burner earlier, then to get it to

1259

actually work you need to add an &quot;hdx=ide-scsi&quot; fragment to the kernel

1260

line in grub.conf (where &quot;hdx&quot; should be the device for your cd burner).

1261

</impo>

1262

<p>After saving this file, Gentoo Linux installation is complete. Selecting the first option will

1263

tell GRUB to boot Gentoo Linux without a fuss. The second part of the grub.conf file is optional,

1264

and shows you how to use GRUB to boot a bootable Windows partition.

1265

</p>

1266

<note>Above, <path>(hd0,0)</path> should point to your &quot;boot&quot; partition

1267

(<path>/dev/hda1</path> in our example config) and <path>/dev/hda3</path> should point to

1268

your root filesystem. <path>(hd0,5)</path> contains the NT boot

1269

loader.

1270

</note>

1271

<note>

1272

The path to the kernel image is relative to the boot partition. If for example you have separated boot partition <path>(hd0,0)</path> and root partition <path>(hd0,1)</path>, all paths in the grub.conf file above will become <path>/bzImage</path>.

1273

</note>

1274

<p>If you need to pass any additional options to the kernel, simply

1275

add them to the end of the <c>kernel</c> command. We're already passing one option

1276

(<c>root=/dev/hda3</c>), but you can pass others as well. In particular, you can

1277

turn off devfs by default (not recommended unless you know what you're doing) by

1278

adding the <c>gentoo=nodevfs</c> option to the <c>kernel</c> command.

1279

</p>

1280

<note>Unlike in earlier versions of Gentoo Linux, you no longer have to add

1281

<c>devfs=mount</c> to the end of the <c>kernel</c> line to enable devfs. In rc6

1282

devfs is enabled by default.

1283

</note>

1284

</body>

1285

</section>

1286

</chapter>

1287

<chapter>

1288

<title>Final steps: Configure LILO</title>

1289

<section>

1290

<body>

1291

<p>While GRUB may be the new alternative for most people, it is not always the best choice.

1292

LILO, the LInuxLOader, is the tried and true workhorse of Linux bootloaders. Here's how to install

1293

LILO if you would like to use it instead of GRUB:

1294

</p>

1295

<p>The first step is to emerge LILO:

1296

</p>

1297

<precaption="Emerging LILO">

1298

# <c>emerge lilo</c>

1299

</pre>

1300

<p>Now it is time to configure LILO. I will give you a small <i>lilo.conf</i> to use, and I will explain

1301

the different parts of the file.

1302

</p>

1303

<precaption="Example lilo.conf">

1304

boot=/dev/hda

1305

map=/boot/map

1306

install=/boot/boot.b

1307

prompt

1308

timeout=50

1309

message=/boot/message

1310

lba32

1311

default=linux

1312

1313

image=/boot/vmlinuz-2.4.20

1314

label=linux

1315

initrd=/boot/initrd-2.4.20.img

1316

read-only

1317

root=/dev/hda5

1318

1319

#For dual booting windows/other OS

1320

other=/dev/hda1

1321

label=dos

1322

1323

</pre>

1324

<li><i>boot=/dev/hda</i> tells LILO to install itself on the first hard disk on the first IDE controller. </li>

1325

<li><i>map=/boot/map</i> states the map file. In normal use, this should not be modified. </li>

1326

<li><i>install=/boot/boot.b</i> tells LILO to install the specified file as the new boot sector.

1327

In normal use, this should not be altered. If the install line is missing, LILO will

1328

assume a default of /boot/boot.b as the file to be used. </li>

1329

<li>The existence of <i>prompt</i> tells LILO to show you whatever is referenced in the message line.

1330

While it is not recommended that you remove the prompt line, if you do remove it, you can still

1331

get a prompt by holding down the [Shift] key while your machine starts to boot. </li>

1332

<li><i>timeout=50</i> sets the amount of time that LILO will wait for user input before proceeding

1333

with booting the default line entry. This is measured in tenths of a second, with 50 as the default. </li>

1334

<li><i>message=/boot/message</i> refers to the screen that LILO displays to let you select the

1335

operating system or kernel to boot. </li>

1336

<li><i>lba32</i> describes the hard disk geometry to LILO. Another common entry here is linear. You should

1337

not change this line unless you are very aware of what you are doing. Otherwise, you could put

1338

your system in an unbootable state. </li>

1339

<li><i>default=linux</i> refers to the default operating system for LILO to boot from the

1340

options listed below this line. The name linux refers to the label line below in each of the boot options. </li>

1341

<li><i>image=/boot/vmlinuz-2.4.20</i> specifies the linux kernel to boot with this particular boot option. </li>

1342

<li><i>label=linux</i> names the operating system option in the LILO screen. In this case,

1343

it is also the name referred to by the default line. </li>

1344

<li><i>initrd=/boot/initrd-2.4.20.img</i> refers to the initial ram disk image that is used at boot time

1345

to actually initialize and start the devices that makes booting the kernel possible. The initial

1346

ram disk is a collection of machine-specific drivers necessary to operate a SCSI card, hard drive, or any

1347

other device needed to load the kernel. You should never try to share initial ram disks between machines. </li>

1348

<li><i>read-only</i> specifies that the root partition (see the root line below) is read-only and cannot be

1349

altered during the boot process. </li>

1350

<li><i>root=/dev/hda5</i> tells LILO what disk partition to use as the root partition. </li>