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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 11568 - (hide annotations) (download) (as text)
Sun Mar 21 12:12:18 2004 UTC (9 years, 3 months ago) by waldi
File MIME type: text/xml
File size: 14072 byte(s)
doc/manual: Enable keyword expansion.
1 toff 3352 <!-- retain these comments for translator revision tracking -->
2 mck 6297 <!-- $Id: chroot-install.xml,v 1.5 2003/11/20 06:39:20 mck Exp $ -->
3 toff 3352
4     <sect1 id="linux-upgrade">
5     <title>Installing Debian GNU/Linux from a Unix/Linux System</title>
6    
7     <para>
8    
9     This section explains how to install Debian GNU/Linux from an existing
10     Unix or Linux system, without using the ncurses-based, menu-driven
11     installer as explained in the rest of the manual. This "cross-install"
12     HOWTO has been requested by users switching to Debian GNU/Linux from
13     Redhat, 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 "zero downtime" Debian GNU/Linux
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    
47     $ mke2fs -j /dev/hda6
48    
49     </screen></informalexample>
50    
51     To create an ext2 file system instead, omit <userinput>-j</userinput>.
52    
53     </para><para>
54    
55     Initialize and activate swap (substitute the partition number for
56     your intended Debian swap partition):
57    
58     <informalexample><screen>
59    
60     $ mkswap /dev/hda5
61     $ sync; sync; sync
62     $ swapon /dev/hda5
63    
64     </screen></informalexample>
65    
66     </para><para>
67    
68     Mount one partition as <filename>/mnt/debinst</filename> (the
69     installation point, to be the root (<filename>/</filename>) filesystem
70     on your new system). The mount point name is strictly arbitrary, it is
71     referenced later below.
72    
73     <informalexample><screen>
74    
75     $ mkdir /mnt/debinst
76     $ mount /dev/hda6 /mnt/debinst
77    
78     </screen></informalexample>
79    
80     </para>
81     </sect2>
82    
83     <sect2>
84     <title>Install <command>debootstrap</command></title>
85     <para>
86    
87     The tool that the Debian installer uses, which is recognized as the
88     official way to install a Debian base system, is
89     <command>debootstrap</command>. It uses <command>wget</command>, but
90     otherwise depends only on <classname>glibc</classname>. Install
91     <command>wget</command> if it isn'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    
107     $ mkdir work
108     $ cd work
109    
110     </screen></informalexample>
111     </para><para>
112    
113     The <command>debootstrap</command> binary is located in the Debian
114     archive (be sure to select the proper file for your
115     architecture). Download the <command>debootstrap</command> .deb from
116     the <ulink url="http://ftp.debian.org/debian/pool/main/d/debootstrap/">
117     pool</ulink>, copy the package to the work folder, and extract the
118     binary files from it. You will need to have root privileges to install
119     the binaries.
120    
121     <informalexample><screen>
122    
123     $ ar -xf debootstrap_0.X.X_arch.deb
124     $ cd /
125     $ zcat &#60; /full-path-to-work/work/data.tar.gz | tar xv
126    
127     </screen></informalexample>
128    
129     </para>
130     </sect2>
131    
132     <sect2>
133     <title>Run <command>debootstrap</command> (Network-connected)</title>
134     <para>
135    
136     <command>debootstrap</command> can download the needed files directly
137     from the archive when you run it. You can substitute any Debian
138     archive mirror for <userinput>http.us.debian.org/debian</userinput> in
139     the command example below, preferably a mirror close to you
140     network-wise. Mirrors are listed at
141     <ulink url="http://www.debian.org/misc/README.mirrors"></ulink>.
142    
143     </para><para>
144    
145     If you have a woody version Debian GNU/Linux CD mounted at
146     <filename>/cdrom</filename>, you could substitute a file URL instead
147     of the http URL: <userinput>file:/cdrom/debian/</userinput>
148    
149     </para><para>
150    
151     Substitute one of the following for <replaceable>ARCH</replaceable>
152     in the <command>debootstrap</command> command:
153    
154     <userinput>alpha</userinput>,
155     <userinput>arm</userinput>,
156     <userinput>hppa</userinput>,
157     <userinput>i386</userinput>,
158     <userinput>ia64</userinput>,
159     <userinput>m68k</userinput>,
160     <userinput>mips</userinput>,
161     <userinput>mipsel</userinput>,
162     <userinput>powerpc</userinput>,
163     <userinput>s390</userinput>, or
164     <userinput>sparc</userinput>.
165    
166     <informalexample><screen>
167    
168     $ /usr/sbin/debootstrap --arch ARCH woody \
169     /mnt/debinst http://http.us.debian.org/debian
170    
171     </screen></informalexample>
172    
173     </para>
174    
175     </sect2>
176    
177     <sect2>
178     <title>Run <command>debootstrap</command>
179     (Using <filename>basedebs.tar</filename>)</title>
180     <para>
181    
182     <command>debootstrap</command> can use the
183     <filename>basedebs.tar</filename> file, if you have already downloaded
184     it ahead of time. The <filename>basedebs.tar</filename> file is
185     generated only every once in a while, so you'll get the latest version
186     of the base system by pointing <command>debootstrap</command> directly
187     to a Debian archive as shown in the previous section.
188    
189     </para><para>
190    
191     The <filename>basedebs.tar</filename> file is found in the
192     <filename>base-images-current</filename> directory of the Debian
193     archive for your architecture, for example:
194     <ulink url="http://http.us.debian.org/debian/dists/woody/main/disks-&architecture;/base-images-current/basedebs.tar"></ulink>
195    
196     </para><para>
197    
198     Substitute one of the following for <replaceable>ARCH</replaceable> in the
199     <command>debootstrap</command> command:
200    
201     <userinput>alpha</userinput>,
202     <userinput>arm</userinput>,
203     <userinput>hppa</userinput>,
204     <userinput>i386</userinput>,
205     <userinput>ia64</userinput>,
206     <userinput>m68k</userinput>,
207     <userinput>mips</userinput>,
208     <userinput>mipsel</userinput>,
209     <userinput>powerpc</userinput>,
210     <userinput>s390</userinput>, or
211     <userinput>sparc</userinput>.
212     <informalexample><screen>
213    
214     $ /usr/sbin/debootstrap --arch ARCH --unpack-tarball \
215     /path-to-downloaded/basedebs.tar woody /mnt/debinst
216    
217     </screen></informalexample>
218     </para>
219     </sect2>
220    
221     <sect2>
222     <title>Configure The Base System</title>
223    
224     <para>
225    
226     Now you've got a real Debian system, though rather lean, on disk.
227     <command>Chroot</command> into it:
228    
229     <informalexample><screen>
230    
231     $ chroot /mnt/debinst /bin/bash
232    
233     </screen></informalexample>
234     </para>
235    
236     <sect3>
237     <title>Mount Partitions</title>
238     <para>
239    
240     You need to create <filename>/etc/fstab</filename>.
241    
242     <informalexample><screen>
243    
244     # editor /etc/fstab
245    
246     </screen></informalexample>
247    
248     </para><para>
249    
250     Here is a sample you can modify to suit:
251    
252     <informalexample><screen>
253    
254     # /etc/fstab: static file system information.
255     #
256     # file system mount point type options dump pass
257     /dev/XXX / ext2 defaults 0 0
258     /dev/XXX /boot ext2 ro,nosuid,nodev 0 2
259    
260     /dev/XXX none swap sw 0 0
261     proc /proc proc defaults 0 0
262    
263     /dev/fd0 /mnt/floppy auto noauto,rw,sync,user,exec 0 0
264     /dev/cdrom /mnt/cdrom iso9660 noauto,ro,user,exec 0 0
265    
266     /dev/XXX /tmp ext2 rw,nosuid,nodev 0 2
267     /dev/XXX /var ext2 rw,nosuid,nodev 0 2
268     /dev/XXX /usr ext2 rw,nodev 0 2
269     /dev/XXX /home ext2 rw,nosuid,nodev 0 2
270    
271     </screen></informalexample>
272    
273     </para><para>
274    
275     Use <userinput>mount -a</userinput> to mount all the file systems you
276     have specified in your <filename>/etc/fstab</filename>, or to mount
277     file systems individually use:
278    
279     <informalexample><screen>
280    
281     # mount /path # e.g.: mount /usr
282    
283     </screen></informalexample>
284    
285     </para><para>
286    
287     You can mount the proc file system multiple times and to arbitrary
288     locations, though /proc is customary. If you didn't use
289     <userinput>mount -a</userinput>, be sure to mount proc before
290     continuing:
291    
292     <informalexample><screen>
293    
294     # mount -t proc proc /proc
295    
296     </screen></informalexample>
297    
298     </para>
299 toff 5236
300     <para>
301     A RedHat user reports that on his system, this should be
302    
303     <informalexample><screen>
304    
305     # mount -t none proc /proc
306    
307     </screen></informalexample>
308     </para>
309 toff 3352 </sect3>
310    
311     <sect3>
312     <title>Configure Keyboard</title>
313    
314     <para>
315    
316     To configure your keyboard:
317    
318     <informalexample><screen>
319    
320     # dpkg-reconfigure console-data
321    
322     </screen></informalexample>
323    
324     </para>
325     </sect3>
326    
327     <sect3>
328     <title>Configure Networking</title>
329     <para>
330    
331     To configure networking, edit
332     <filename>/etc/network/interfaces</filename>,
333     <filename>/etc/resolv.conf</filename>, and
334     <filename>etc/hostname</filename>.
335    
336     <informalexample><screen>
337    
338     # editor /etc/network/interfaces
339    
340     </screen></informalexample>
341    
342     </para><para>
343    
344     Here are some simple examples from
345     <filename>/usr/share/doc/ifupdown/examples</filename>:
346    
347     <informalexample><screen>
348     ######################################################################
349     # /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
350     # See the interfaces(5) manpage for information on what options are
351     # available.
352     ######################################################################
353    
354     # We always want the loopback interface.
355     #
356     auto lo
357     iface lo inet loopback
358    
359     # To use dhcp:
360     #
361     # auto eth0
362     # iface eth0 inet dhcp
363    
364     # An example static IP setup: (broadcast and gateway are optional)
365     #
366     # auto eth0
367     # iface eth0 inet static
368     # address 192.168.0.42
369     # network 192.168.0.0
370     # netmask 255.255.255.0
371     # broadcast 192.168.0.255
372     # gateway 192.168.0.1
373     </screen></informalexample>
374    
375     </para><para>
376    
377     Enter your nameserver(s) and search directives in
378     <filename>/etc/resolv.conf</filename>:
379    
380     <informalexample><screen>
381    
382     # editor /etc/resolv.conf
383    
384     </screen></informalexample>
385    
386     </para><para>
387    
388     A simple <filename>/etc/resolv.conf</filename>:
389    
390     <informalexample><screen>
391    
392     # search hqdom.local\000
393     # nameserver 10.1.1.36
394     # nameserver 192.168.9.100
395    
396     </screen></informalexample>
397    
398     </para><para>
399    
400     Enter your system's host name (2 to 63 characters):
401    
402     <informalexample><screen>
403    
404     # echo DebianHostName &#62; /etc/hostname
405    
406     </screen></informalexample>
407    
408     </para><para>
409    
410     If you have multiple network cards, you should arrange the names of
411     driver modules in the <filename>/etc/modules</filename> file into the
412     desired order. Then during boot, each card will be associated with the
413     interface name (eth0, eth1, etc.) that you expect.
414    
415     </para>
416     </sect3>
417    
418     <sect3>
419     <title>Configure Timezone, Users, and APT</title>
420    
421     <para>
422    
423     Set your timezone, add a normal user, and choose your <command>apt</command>
424     sources by running
425    
426     <informalexample><screen>
427    
428     # /usr/sbin/base-config
429    
430     </screen></informalexample>
431     </para>
432     </sect3>
433    
434     <sect3>
435     <title>Configure Locales</title>
436     <para>
437    
438     To configure your locale settings to use a language other than
439     English, install the locales support package and configure it:
440    
441     <informalexample><screen>
442    
443     # apt-get install locales
444     # dpkg-reconfigure locales
445    
446     </screen></informalexample>
447    
448     NOTE: Apt must be configured before, ie. during the base-config phase.
449     Before using locales with character sets other than ASCII or latin1,
450     please consult the appropriate localisation HOWTO.
451    
452     </para>
453     </sect3>
454     </sect2>
455    
456     <sect2>
457     <title>Install a Kernel</title>
458    
459     <para>
460    
461     If you intend to boot this system, you probably want a Linux kernel
462     and a boot loader. Identify available pre-packaged kernels with
463    
464     <informalexample><screen>
465    
466     # apt-cache search kernel-image
467    
468     </screen></informalexample>
469    
470     </para><para>
471    
472     Then install your choice using its package name.
473    
474     <informalexample><screen>
475    
476     # apt-get install kernel-image-2.X.X-arch-etc
477    
478     </screen></informalexample>
479    
480     </para>
481     </sect2>
482    
483     <sect2>
484     <title>Set up the Boot Loader</title>
485     <para>
486    
487     To make your Debian GNU/Linux system bootable, set up your boot
488     loader to load the installed kernel with your new root partition.
489    
490 toff 4119 </para><para arch="i386">
491 toff 3352
492     Check <userinput>man lilo.conf</userinput> for instructions on setting
493     up the bootloader. If you are keeping the system you used to install
494     Debian, just add an entry for the Debian install to your existing
495     lilo.conf. You could also copy it to the new system and edit it
496     there. After you are done editing, call lilo (remember it will use
497     lilo.conf relative to the system you call it from).
498    
499 toff 4119 </para><para arch="i386">
500 toff 3352
501     Here is a basic /etc/lilo.conf as an example:
502    
503     <informalexample><screen>
504    
505     boot=/dev/hda6
506     root=/dev/hda6
507     install=/boot/boot-menu.b
508     delay=20
509     lba32
510     image=/vmlinuz
511     label=Debian
512    
513     </screen></informalexample>
514    
515 toff 4119 </para><para arch="powerpc">
516 toff 3352
517     Check <userinput>man yaboot.conf</userinput> for instructions on
518     setting up the bootloader. If you are keeping the system you used to
519     install Debian, just add an entry for the Debian install to your
520     existing yaboot.conf. You could also copy it to the new system and
521     edit it there. After you are done editing, call ybin (remember it will
522     use yaboot.conf relative to the system you call it from).
523    
524 toff 4119 </para><para arch="powerpc">
525 toff 3352
526     Here is a basic /etc/yaboot.conf as an example:
527    
528     <informalexample><screen>
529    
530     boot=/dev/hda2
531     device=hd:
532     partition=6
533     root=/dev/hda6
534     magicboot=/usr/lib/yaboot/ofboot
535     timeout=50
536     image=/vmlinux
537     label=Debian
538    
539     </screen></informalexample>
540    
541     On some machines, you may need to use <userinput>ide0:</userinput>
542     instead of <userinput>hd:</userinput>.
543    
544 mck 6297 </para><para arch="not-i386;not-powerpc">
545 toff 3352
546 toff 4119 <phrase condition="FIXME">
547 toff 3352 FIXME: Someone may eventually supply an example for this architecture.
548 toff 4119 </phrase>
549 toff 3352
550     </para>
551     </sect2>
552     </sect1>

Properties

Name Value
svn:keywords Id

  ViewVC Help
Powered by ViewVC 1.1.5