forked from JKtheSlacker/slackbook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
chapter_02.xml
403 lines (322 loc) · 14.6 KB
/
chapter_02.xml
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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
<?xml version="1.0"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"/usr/share/xml/docbook/xml-dtd-4.5/docbookx.dtd">
<chapter>
<title>Installation</title>
<para>
Slackware's installation is a bit more simplistic than that of most
other Linux distributions and is very reminiscent of installing one of the
varieties of BSD operating systems. If you're familiar with those, you
should feel right at home. If you've never installed Slackware or used
a distribution that makes use of a non-graphical installer, you may
feel a bit overwhelmed at first. Don't panic! The installation is very easy
once you understand it, and it works on just about any x86 platform.
</para>
<para>
The latest versions of Slackware Linux are distributed on DVD or CD
media, but Slackware can be installed in a variety of other ways. We're
only going to focus on the most common method - booting from a DVD - in
this book. If you don't have a CD or DVD drive, you might wish to take
a look at the various README files inside the
<filename>usb-and-pxe-installers</filename> directory at your favorite
Slackware mirror. This directory includes the necessary files and
instructions for booting the Slackware installer from a USB flash drive
or from a network card that supports PXE. The files there are the best
source of information available for such boot methods.
</para>
<section>
<title>Booting the Installer</title>
<para>
Booting the installer is simply a process of inserting the Slackware
install disk into your CD or DVD drive and rebooting. You may have to
enter your computer's BIOS and alter the boot order to place the
optical drive at a higher boot priority than your hard drives. Some
computers allow you to change the boot order on the fly by pressing a
specific function key during system boot-up. Since every computer is
different, we can't offer instructions on how to do this, but the
method is simple on nearly all machines.
</para>
<para>
Once your computer boots from the CD you'll be taken to a screen that
allows you to enter any special kernel parameters. This is here
primarily to allow you to use the installer as a sort of rescue disk.
Some systems may need special kernel parameters in order to boot, but
these are very rare exceptions to the norm. Most users can simply press
enter to let the kernel boot.
</para>
<screen>
Welcome to Slackware version 13.37 (Linux kernel 2.6.37.6)!
If you need to pass extra parameters to the kernel, enter them at the prompt
below after the name of the kernel to boot (huge.s etc).
In a pinch, you can boot your system from here with a command like:
boot: huge.s root=/dev/sda1 rdinit= ro
In the example above, /dev/sda1 is the / Linux partition.
This prompt is just for entering extra parameters. If you don't need to enter
any parameters, hit ENTER to boot the default kernel "huge.s" or press [F2]
for a listing of more kernel choices.
</screen>
<para>
You should see a lot of text go flying across your screen. Don't be
alarmed, this is all perfectly normal. The text you see is generated by
the kernel during boot-up as it discovers your hardware and prepares to
load the operating system (in this case, the installer). You can later
read these messages with the <application>dmesg</application>(1)
command if you're interested. Often these messages are very important
for troubleshooting any hardware problems you may have. Once the kernel
has completed its hardware discovery, the messages should stop and
you'll be given an option to load support for non-us keyboards.
</para>
<screen>
<OPTION TO LOAD SUPPORT FOR NON-US KEYBOARD>
If you are not using a US keyboard, you may not load a different
keyboard map. To select a different keyboard map, please enter 1
now. To continue using the US map, just hit enter.
Enter 1 to select a keyboard map: _
</screen>
<para>
Entering <keycap>1</keycap> and pressing <keycap>ENTER</keycap> will
give you a list of keyboard mappings. Simply select the mapping that
matches your keyboard type and continue on.
</para>
<screen>
Welcome to the Slackware Linux installation disk! (version 13.37)
###### IMPORTANT! READ THE INFORMATION BELOW CAREFULLY. ######
- You will need one or more partitions of type 'Linux' prepared. It is also
recommended that you create a swap partition (type 'Linux swap') prior
to installation. For more information, run 'setup' and read the help file.
- If you're having problems that you think might be related to low memory, you
can try activating a swap partition before you run setup. After making a
swap partition (type 82) with cfdisk or fdisk, activate it like this:
mkswap /dev/<partition> ; swapon /dev/<partition>
- Once you have prepared the disk partitions for Linux, type 'setup' to begin
the installation process.
- If you do not have a color monitor, type: TERM=vt100
before you start 'setup'.
You may now login as 'root'.
slackware login: <userinput>root</userinput>
</screen>
<para>
Unlike other Linux distributions which boot you directly into a
dedicated installer program, Slackware's installer drops you into a
limited Linux distribution loaded into your system's RAM. This
limited distribution is then used to run all the installation programs
manually, or can be used in emergencies to fix a broken system that
fails to boot. Now that you're logged in as root (there is no password
within the installer) it's time to start setting up your disks. At this
point, you may setup software RAID or LVM support if you wish or even
an encrypted root partition, but
those topics are outside of the scope of this book. I encourage you to
refer to the excellent <filename>README_RAID.TXT</filename>,
<filename>README_LVM.TXT</filename>, and
<filename>README_CRYPT.TXT</filename> files on your CD if you desire to
set up your system with these advanced tools. Most users won't have any
need to do so and should proceed directly to partitioning.
</para>
</section>
<section>
<title>Partitioning</title>
<para>
Unlike many other Linux distributions, Slackware does not make use of a
graphical disk partitioning tool in its installer; rather, Slackware
makes use of <application>fdisk</application>(8) and
<application>cfdisk</application>(8), both of which are console tools.
<application>cfdisk</application> is a curses-based partitioning tool
while <application>fdisk</application> is not. Which one you decide
to use should only rarely matter. In this book, we'll only discuss
<application>fdisk</application>.
</para>
<para>
In order to partition your hard drive, you'll first need to know how to
identify it. In Linux, all hardware is identified by a special file
called a device file. These are all (typically) located in the
<filename>/dev</filename> directory. Hard drives, both the older IDE
(PATA) and Serial ATA (SATA) disks are identified as SCSI devices by
the kernel, and as such, they'll be assigned a device node such as
<filename>/dev/sda</filename>. If you don't know which device node is
assigned to your hard drive, <application>fdisk</application> can help you
find out.
</para>
<screen><prompt>root@slackware:/# </prompt><userinput>fdisk -l</userinput>
Disk /dev/sda: 72.7 GB, 72725037056 bytes
255 heads, 63 sectors/track, 8841 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
</screen>
<para>
Here, you can see that my system has a hard drive located at
<filename>/dev/sda</filename> that is 72.7 GB in size. You can also
see some additional information about this hard drive (in my case, this
is actually three SCSI hard drives on a hardware RAID controller that
makes them appear as a single drive). The <arg>-l</arg> argument to
<application>fdisk</application> tells it to display the hard drives
and all the partitions it finds on those drives, but it won't make any
changes to the disks. In order to actually partition our drives, we'll
have to tell <application>fdisk</application> the drive on which to operate.
</para>
<screen><prompt>root@slackware:/# </prompt><userinput>fdisk /dev/sda</userinput>
The number of cylinders for this disk is set to 8841.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help):
</screen>
<para>
Now we've told fdisk what disk we wish to partition, and it has dropped
us into command mode after printing an annoying warning message. The
1024 cylinder limit has not been a problem for quite some time, and
Slackware's boot loader will have no trouble booting disks larger than
this. Typing <arg>m</arg> and pressing ENTER will print out a helpful
message telling you what to do with <application>fdisk</application>.
</para>
<screen>Command (m for help): <userinput>m</userinput>
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
</screen>
<para>
Now that we know what commands will do what, it's time to begin partitioning
our drive. At a minimum, you will need a single <filename>/</filename>
partition, and you should also create a swap partition.
You might also want to make a separate <filename>/home</filename>
partition for storing user files (this will make it easier to upgrade
later or to install a different Linux operating system by keeping all of
your users' files on a separate partition). Therefore, let's go ahead and
make three partitions. The command to create a new partition is
<arg>n</arg> (which you noticed when you read the help).
</para>
<screen>Command: (m for help): <userinput>n</userinput>
Command action
e extended
p primary partition (1-4)
<userinput>p</userinput>
Partition number (1-4): <userinput>1</userinput>
First cylinder (1-8841, default 1): <userinput>1</userinput>
Last cylinder or +size or +sizeM or +sizeK (1-8841, default 8841): <userinput>+8G</userinput>
Command (m for help): n
Command action
e extended
p primary partition (1-4)
<userinput>p</userinput>
Partition number (1-4): <userinput>2</userinput>
First cylinder (975-8841, default 975): <userinput>975</userinput>
Last cylinder or +size or +sizeM or +sizeK (975-8841, default 8841): <userinput>+1G</userinput>
</screen>
<para>
Here we have created two partitions. The first is 8GB in size, and the
second is only 1GB. We can view our existing partitions with the
<arg>p</arg> command.
</para>
<screen> Command (m for help): <userinput>p</userinput>
Disk /dev/sda: 72.7 GB, 72725037056 bytes
255 heads, 63 sectors/track, 8841 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 1 974 7823623+ 83 Linux
/dev/sda2 975 1097 987997+ 83 Linux
</screen>
<para>
Both of these partitions are of type "83" which is the standard Linux
filesystem. We will need to change <filename>/dev/sda2</filename> to
type "82" in order to make this a swap partition. We will do this with
the <arg>t</arg> argument to <application>fdisk</application>.
</para>
<screen>Command (m for help): <userinput>t</userinput>
Partition number (1-4): <userinput>2</userinput>
Hex code (type L to list codes): <userinput>82</userinput>
Command (me for help): <userinput>p</userinput>
Disk /dev/sda: 72.7 GB, 72725037056 bytes
255 heads, 63 sectors/track, 8841 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 1 974 7823623+ 83 Linux
/dev/sda2 975 1097 987997+ 82 Linux swap
</screen>
<para>The swap partition is a special partition that is used for
virtual memory by the Linux kernel. If for some reason you run out of
RAM, the kernel will move the contents of some of the RAM to swap in
order to prevent a crash. The size of your swap partition is up to
you. A great many people have participated in a great many flamewars
on the size of swap partitions, but a good rule of thumb is to make your
swap partition about twice the size of your system's RAM. Since my machine
has only 512MB of RAM, I decided to make my swap partition 1GB. You may
wish to experiment with your swap partition's size and see what works best
for you, but generally there is no harm in having "too much" swap.
That being said, there's generally no good reason to follow this "rule of
thumb" if you have a *lot* of RAM (e.g. more than 2 GB). If you plan to
use hibernation (suspend to disk), you will need to have at least as much
swap space as you have physical memory (RAM), so keep that in mind.
</para>
<para>
At this point we can stop, write these changes to the disk, and
continue on, but I'm going to go ahead and make a third partition which
will be mounted at <filename>/home</filename>.
</para>
<screen>Command: (me for help): <userinput>n</userinput>
Command action
e extended
p primary partition (1-4)
<userinput>p</userinput>
Partition number (1-4): <userinput>3</userinput>
First cylinder (1098-8841, default 1098): <userinput>1098</userinput>
Last cylinder or +size or +sizeM or +sizeK (1098-8841, default 8841): <userinput>8841</userinput>
</screen>
<para>
Now it's time to finish up and write these changes to disk.
</para>
<screen>Command: (me for help): <userinput>w</userinput>
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
<prompt>root@slackware:/# </prompt>
</screen>
<para>
At this point, we are done partitioning our disks and are ready to
begin the <application>setup</application> program. However, if you
have created any extended partitions, you may wish to reboot once to
ensure that they are properly read by the kernel.
</para>
</section>
<section>
<title>The <application>setup</application> Program</title>
<!-- Each part of setup gets its individual subsection. -->
<section>
<title>Help</title>
</section>
<section>
<title>Keymap</title>
</section>
<section>
<title>Addswap</title>
</section>
<section>
<title>Target</title>
</section>
<section>
<title>Source</title>
</section>
<section>
<title>Select</title>
</section>
<section>
<title>Install</title>
</section>
<section>
<title>Configure</title>
</section>
</section>
</chapter>