/[d-i]/trunk/installer/doc/manual/en/appendix/chroot-install.xml
ViewVC logotype

Contents of /trunk/installer/doc/manual/en/appendix/chroot-install.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 31190 - (show annotations) (download) (as text)
Thu Oct 6 15:51:32 2005 UTC (7 years, 7 months ago) by fjp
File MIME type: text/xml
File size: 13292 byte(s)
Use ext3 instead of ext2 in fstab example
1 <!-- retain these comments for translator revision tracking -->
2 <!-- $Id$ -->
3
4 <sect1 id="linux-upgrade">
5 <title>Installing &debian; from a Unix/Linux System</title>
6
7 <para>
8
9 This section explains how to install &debian; from an existing
10 Unix or Linux system, without using the menu-driven installer as
11 explained in the rest of the manual. This <quote>cross-install</quote>
12 HOWTO has been requested by users switching to &debian; from
13 Red Hat, Mandrake, and SUSE. In this section some familiarity with
14 entering *nix commands and navigating the file system is assumed. In
15 this section, <prompt>$</prompt> symbolizes a command to be entered in
16 the user's current system, while <prompt>#</prompt> refers to a
17 command entered in the Debian chroot.
18
19 </para><para>
20
21 Once you've got the new Debian system configured to your preference,
22 you can migrate your existing user data (if any) to it, and keep on
23 rolling. This is therefore a <quote>zero downtime</quote> &debian;
24 install. It's also a clever way for dealing with hardware that
25 otherwise doesn't play friendly with various boot or installation
26 media.
27
28 </para>
29
30 <sect2>
31 <title>Getting Started</title>
32 <para>
33
34 With your current *nix partitioning tools, repartition the hard
35 drive as needed, creating at least one filesystem plus swap. You
36 need at least 150MB of space available for a console only install,
37 or at least 300MB if you plan to install X.
38
39 </para><para>
40
41 To create file systems on your partitions. For example, to create an
42 ext3 file system on partition <filename>/dev/hda6</filename> (that's
43 our example root partition):
44
45 <informalexample><screen>
46 # mke2fs -j /dev/hda6
47 </screen></informalexample>
48
49 To create an ext2 file system instead, omit <userinput>-j</userinput>.
50
51 </para><para>
52
53 Initialize and activate swap (substitute the partition number for
54 your intended Debian swap partition):
55
56 <informalexample><screen>
57 # mkswap /dev/hda5
58 # sync; sync; sync
59 # swapon /dev/hda5
60 </screen></informalexample>
61
62 Mount one partition as <filename>/mnt/debinst</filename> (the
63 installation point, to be the root (<filename>/</filename>) filesystem
64 on your new system). The mount point name is strictly arbitrary, it is
65 referenced later below.
66
67 <informalexample><screen>
68 # mkdir /mnt/debinst
69 # mount /dev/hda6 /mnt/debinst
70 </screen></informalexample>
71
72 </para>
73 <note><para>
74
75 If you want to have parts of the filesystem (e.g. /usr) mounted on
76 separate partitions, you will need to create and mount these directories
77 manually before proceding with the next stage.
78
79 </para></note>
80 </sect2>
81
82 <sect2>
83 <title>Install <command>debootstrap</command></title>
84 <para>
85
86 The tool that the Debian installer uses, which is recognized as the
87 official way to install a Debian base system, is
88 <command>debootstrap</command>. It uses <command>wget</command> and
89 <command>ar</command>, but otherwise depends only on
90 <classname>/bin/sh</classname>. Install <command>wget</command> and
91 <command>ar</command> if they aren't already on your current system,
92 then download and install <command>debootstrap</command>.
93
94 </para><para>
95
96 If you have an rpm-based system, you can use alien to convert the
97 .deb into .rpm, or download an rpm-ized version at
98 <ulink url="http://people.debian.org/~blade/install/debootstrap"></ulink>
99
100 </para><para>
101
102 Or, you can use the following procedure to install it
103 manually. Make a work folder for extracting the .deb into:
104
105 <informalexample><screen>
106 # mkdir work
107 # cd work
108 </screen></informalexample>
109
110 The <command>debootstrap</command> binary is located in the Debian
111 archive (be sure to select the proper file for your
112 architecture). Download the <command>debootstrap</command> .deb from
113 the <ulink url="http://ftp.debian.org/debian/pool/main/d/debootstrap/">
114 pool</ulink>, copy the package to the work folder, and extract the
115 binary files from it. You will need to have root privileges to install
116 the binaries.
117
118 <informalexample><screen>
119 # ar -x debootstrap_0.X.X_arch.deb
120 # cd /
121 # zcat /full-path-to-work/work/data.tar.gz | tar xv
122 </screen></informalexample>
123
124 </para><para>
125
126 Note that running <command>debootstrap</command> may require you to have
127 a minimal version of <classname>glibc</classname> installed (currently
128 GLIBC_2.3). <command>debootstrap</command> itself is a shell script, but
129 it calls various utilities that require <classname>glibc</classname>.
130
131 </para>
132 </sect2>
133
134 <sect2>
135 <title>Run <command>debootstrap</command></title>
136 <para>
137
138 <command>debootstrap</command> can download the needed files directly
139 from the archive when you run it. You can substitute any Debian
140 archive mirror for <userinput>http.us.debian.org/debian</userinput> in
141 the command example below, preferably a mirror close to you
142 network-wise. Mirrors are listed at
143 <ulink url="http://www.debian.org/misc/README.mirrors"></ulink>.
144
145 </para><para>
146
147 If you have a &releasename; &debian; CD mounted at
148 <filename>/cdrom</filename>, you could substitute a file URL instead
149 of the http URL: <userinput>file:/cdrom/debian/</userinput>
150
151 </para><para>
152
153 Substitute one of the following for <replaceable>ARCH</replaceable>
154 in the <command>debootstrap</command> command:
155
156 <userinput>alpha</userinput>,
157 <userinput>arm</userinput>,
158 <userinput>hppa</userinput>,
159 <userinput>i386</userinput>,
160 <userinput>ia64</userinput>,
161 <userinput>m68k</userinput>,
162 <userinput>mips</userinput>,
163 <userinput>mipsel</userinput>,
164 <userinput>powerpc</userinput>,
165 <userinput>s390</userinput>, or
166 <userinput>sparc</userinput>.
167
168 <informalexample><screen>
169 # /usr/sbin/debootstrap --arch ARCH &releasename; \
170 /mnt/debinst http://http.us.debian.org/debian
171 </screen></informalexample>
172
173 </para>
174 </sect2>
175
176 <sect2>
177 <title>Configure The Base System</title>
178 <para>
179
180 Now you've got a real Debian system, though rather lean, on disk.
181 <command>Chroot</command> into it:
182
183 <informalexample><screen>
184 # LANG= chroot /mnt/debinst /bin/bash
185 </screen></informalexample>
186
187 </para>
188
189 <sect3>
190 <title>Mount Partitions</title>
191 <para>
192
193 You need to create <filename>/etc/fstab</filename>.
194
195 <informalexample><screen>
196 # editor /etc/fstab
197 </screen></informalexample>
198
199 Here is a sample you can modify to suit:
200
201 <informalexample><screen>
202 # /etc/fstab: static file system information.
203 #
204 # file system mount point type options dump pass
205 /dev/XXX / ext3 defaults 0 1
206 /dev/XXX /boot ext3 ro,nosuid,nodev 0 2
207
208 /dev/XXX none swap sw 0 0
209 proc /proc proc defaults 0 0
210
211 /dev/fd0 /mnt/floppy auto noauto,rw,sync,user,exec 0 0
212 /dev/cdrom /mnt/cdrom iso9660 noauto,ro,user,exec 0 0
213
214 /dev/XXX /tmp ext3 rw,nosuid,nodev 0 2
215 /dev/XXX /var ext3 rw,nosuid,nodev 0 2
216 /dev/XXX /usr ext3 rw,nodev 0 2
217 /dev/XXX /home ext3 rw,nosuid,nodev 0 2
218 </screen></informalexample>
219
220 Use <userinput>mount -a</userinput> to mount all the file systems you
221 have specified in your <filename>/etc/fstab</filename>, or to mount
222 file systems individually use:
223
224 <informalexample><screen>
225 # mount /path # e.g.: mount /usr
226 </screen></informalexample>
227
228 You can mount the proc file system multiple times and to arbitrary
229 locations, though <filename>/proc</filename> is customary. If you didn't use
230 <userinput>mount -a</userinput>, be sure to mount proc before continuing:
231
232 <informalexample><screen>
233 # mount -t proc proc /proc
234 </screen></informalexample>
235
236 </para><para>
237
238 The command <userinput>ls /proc</userinput> should now show a non-empty
239 directory. Should this fail, you may be able to mount proc from outside
240 the chroot:
241
242 <informalexample><screen>
243 # mount -t proc proc /mnt/debinst/proc
244 </screen></informalexample>
245
246 </para>
247 </sect3>
248
249 <sect3>
250 <title>Configure Keyboard</title>
251 <para>
252
253 To configure your keyboard:
254
255 <informalexample><screen>
256 # dpkg-reconfigure console-data
257 </screen></informalexample>
258
259 </para><para>
260
261 Note that the keyboard cannot be set while in the chroot, but will be
262 configured for the next reboot.
263
264 </para>
265 </sect3>
266
267 <sect3>
268 <title>Configure Networking</title>
269 <para>
270
271 To configure networking, edit
272 <filename>/etc/network/interfaces</filename>,
273 <filename>/etc/resolv.conf</filename>, and
274 <filename>/etc/hostname</filename>.
275
276 <informalexample><screen>
277 # editor /etc/network/interfaces
278 </screen></informalexample>
279
280 Here are some simple examples from
281 <filename>/usr/share/doc/ifupdown/examples</filename>:
282
283 <informalexample><screen>
284 ######################################################################
285 # /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
286 # See the interfaces(5) manpage for information on what options are
287 # available.
288 ######################################################################
289
290 # We always want the loopback interface.
291 #
292 auto lo
293 iface lo inet loopback
294
295 # To use dhcp:
296 #
297 # auto eth0
298 # iface eth0 inet dhcp
299
300 # An example static IP setup: (broadcast and gateway are optional)
301 #
302 # auto eth0
303 # iface eth0 inet static
304 # address 192.168.0.42
305 # network 192.168.0.0
306 # netmask 255.255.255.0
307 # broadcast 192.168.0.255
308 # gateway 192.168.0.1
309 </screen></informalexample>
310
311 Enter your nameserver(s) and search directives in
312 <filename>/etc/resolv.conf</filename>:
313
314 <informalexample><screen>
315 # editor /etc/resolv.conf
316 </screen></informalexample>
317
318 A simple <filename>/etc/resolv.conf</filename>:
319
320 <informalexample><screen>
321 search hqdom.local\000
322 nameserver 10.1.1.36
323 nameserver 192.168.9.100
324 </screen></informalexample>
325
326 Enter your system's host name (2 to 63 characters):
327
328 <informalexample><screen>
329 # echo DebianHostName &gt; /etc/hostname
330 </screen></informalexample>
331
332 If you have multiple network cards, you should arrange the names of
333 driver modules in the <filename>/etc/modules</filename> file into the
334 desired order. Then during boot, each card will be associated with the
335 interface name (eth0, eth1, etc.) that you expect.
336
337 </para>
338 </sect3>
339
340 <sect3>
341 <title>Configure Timezone, Users, and APT</title>
342 <para>
343
344 Set your timezone, add a normal user, and choose your <command>apt</command>
345 sources by running
346
347 <informalexample><screen>
348 # /usr/sbin/base-config new
349 </screen></informalexample>
350
351 </para>
352 </sect3>
353
354 <sect3>
355 <title>Configure Locales</title>
356 <para>
357
358 To configure your locale settings to use a language other than
359 English, install the locales support package and configure it:
360
361 <informalexample><screen>
362 # apt-get install locales
363 # dpkg-reconfigure locales
364 </screen></informalexample>
365
366 NOTE: Apt must be configured before, ie. during the base-config phase.
367 Before using locales with character sets other than ASCII or latin1,
368 please consult the appropriate localization HOWTO.
369
370 </para>
371 </sect3>
372 </sect2>
373
374 <sect2>
375 <title>Install a Kernel</title>
376 <para>
377
378 If you intend to boot this system, you probably want a Linux kernel
379 and a boot loader. Identify available pre-packaged kernels with
380
381 <informalexample><screen>
382 # apt-cache search kernel-image
383 </screen></informalexample>
384
385 Then install your choice using its package name.
386
387 <informalexample><screen>
388 # apt-get install kernel-image-<replaceable>2.X.X-arch-etc</replaceable>
389 </screen></informalexample>
390
391 </para>
392 </sect2>
393
394 <sect2>
395 <title>Set up the Boot Loader</title>
396 <para>
397
398 To make your &debian; system bootable, set up your boot loader to load
399 the installed kernel with your new root partition. Note that debootstrap
400 does not install a boot loader, though you can use apt-get inside your
401 Debian chroot to do so.
402
403 </para><para arch="i386">
404
405 Check <userinput>info grub</userinput> or <userinput>man
406 lilo.conf</userinput> for instructions on setting up the
407 bootloader. If you are keeping the system you used to install Debian, just
408 add an entry for the Debian install to your existing grub
409 <filename>menu.lst</filename> or <filename>lilo.conf</filename>. For
410 <filename>lilo.conf</filename>, you could also copy it to the new system and
411 edit it there. After you are done editing, call lilo (remember it will use
412 <filename>lilo.conf</filename> relative to the system you call it from).
413
414 </para><para arch="i386">
415
416 Here is a basic <filename>/etc/lilo.conf</filename> as an example:
417
418 <informalexample><screen>
419 boot=/dev/hda6
420 root=/dev/hda6
421 install=menu
422 delay=20
423 lba32
424 image=/vmlinuz
425 label=Debian
426 </screen></informalexample>
427
428 </para><para arch="powerpc">
429
430 Check <userinput>man yaboot.conf</userinput> for instructions on
431 setting up the bootloader. If you are keeping the system you used to
432 install Debian, just add an entry for the Debian install to your
433 existing <filename>yaboot.conf</filename>. You could also copy it to
434 the new system and
435 edit it there. After you are done editing, call ybin (remember it will
436 use <filename>yaboot.conf</filename> relative to the system you call it from).
437
438 </para><para arch="powerpc">
439
440 Here is a basic <filename>/etc/yaboot.conf</filename> as an example:
441
442 <informalexample><screen>
443 boot=/dev/hda2
444 device=hd:
445 partition=6
446 root=/dev/hda6
447 magicboot=/usr/lib/yaboot/ofboot
448 timeout=50
449 image=/vmlinux
450 label=Debian
451 </screen></informalexample>
452
453 On some machines, you may need to use <userinput>ide0:</userinput>
454 instead of <userinput>hd:</userinput>.
455
456 </para>
457 </sect2>
458 </sect1>

Properties

Name Value
svn:keywords Id

  ViewVC Help
Powered by ViewVC 1.1.5