/[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 18767 - (hide annotations) (download) (as text)
Sat Jul 31 14:14:52 2004 UTC (8 years, 9 months ago) by mck-guest
File MIME type: text/xml
File size: 12544 byte(s)
Fix some typos and add proper tags
1 toff 3352 <!-- retain these comments for translator revision tracking -->
2 joeyh 11648 <!-- $Id$ -->
3 toff 3352
4     <sect1 id="linux-upgrade">
5 fjpop-guest 12756 <title>Installing &debian; from a Unix/Linux System</title>
6 toff 3352
7     <para>
8    
9 fjpop-guest 12756 This section explains how to install &debian; from an existing
10 toff 3352 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 fjpop-guest 12756 HOWTO has been requested by users switching to &debian; from
13 toff 3352 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 fjpop-guest 12756 rolling. This is therefore a "zero downtime" &debian;
24 toff 3352 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 joeyh 18643 otherwise depends only on <classname>/bin/sh</classname>. Install
91 toff 3352 <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 joeyh 18643 <title>Run <command>debootstrap</command></title>
134 toff 3352 <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 joeyh 18643 If you have a &releasename; &debian; CD mounted at
146 toff 3352 <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 joeyh 18643 $ /usr/sbin/debootstrap --arch ARCH sarge \
169 toff 3352 /mnt/debinst http://http.us.debian.org/debian
170    
171     </screen></informalexample>
172    
173     </para>
174    
175     </sect2>
176    
177     <sect2>
178     <title>Configure The Base System</title>
179    
180     <para>
181    
182     Now you've got a real Debian system, though rather lean, on disk.
183     <command>Chroot</command> into it:
184    
185     <informalexample><screen>
186    
187     $ chroot /mnt/debinst /bin/bash
188    
189     </screen></informalexample>
190     </para>
191    
192     <sect3>
193     <title>Mount Partitions</title>
194     <para>
195    
196     You need to create <filename>/etc/fstab</filename>.
197    
198     <informalexample><screen>
199    
200     # editor /etc/fstab
201    
202     </screen></informalexample>
203    
204     </para><para>
205    
206     Here is a sample you can modify to suit:
207    
208     <informalexample><screen>
209    
210     # /etc/fstab: static file system information.
211     #
212     # file system mount point type options dump pass
213     /dev/XXX / ext2 defaults 0 0
214     /dev/XXX /boot ext2 ro,nosuid,nodev 0 2
215    
216     /dev/XXX none swap sw 0 0
217     proc /proc proc defaults 0 0
218    
219     /dev/fd0 /mnt/floppy auto noauto,rw,sync,user,exec 0 0
220     /dev/cdrom /mnt/cdrom iso9660 noauto,ro,user,exec 0 0
221    
222     /dev/XXX /tmp ext2 rw,nosuid,nodev 0 2
223     /dev/XXX /var ext2 rw,nosuid,nodev 0 2
224     /dev/XXX /usr ext2 rw,nodev 0 2
225     /dev/XXX /home ext2 rw,nosuid,nodev 0 2
226    
227     </screen></informalexample>
228    
229     </para><para>
230    
231     Use <userinput>mount -a</userinput> to mount all the file systems you
232     have specified in your <filename>/etc/fstab</filename>, or to mount
233     file systems individually use:
234    
235     <informalexample><screen>
236    
237     # mount /path # e.g.: mount /usr
238    
239     </screen></informalexample>
240    
241     </para><para>
242    
243     You can mount the proc file system multiple times and to arbitrary
244     locations, though /proc is customary. If you didn't use
245     <userinput>mount -a</userinput>, be sure to mount proc before
246     continuing:
247    
248     <informalexample><screen>
249    
250     # mount -t proc proc /proc
251    
252     </screen></informalexample>
253    
254     </para>
255 toff 5236
256 toff 3352 </sect3>
257    
258     <sect3>
259     <title>Configure Keyboard</title>
260    
261     <para>
262    
263     To configure your keyboard:
264    
265     <informalexample><screen>
266    
267     # dpkg-reconfigure console-data
268    
269     </screen></informalexample>
270    
271     </para>
272     </sect3>
273    
274     <sect3>
275     <title>Configure Networking</title>
276     <para>
277    
278     To configure networking, edit
279     <filename>/etc/network/interfaces</filename>,
280     <filename>/etc/resolv.conf</filename>, and
281 cjwatson 15442 <filename>/etc/hostname</filename>.
282 toff 3352
283     <informalexample><screen>
284    
285     # editor /etc/network/interfaces
286    
287     </screen></informalexample>
288    
289     </para><para>
290    
291     Here are some simple examples from
292     <filename>/usr/share/doc/ifupdown/examples</filename>:
293    
294     <informalexample><screen>
295     ######################################################################
296     # /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
297     # See the interfaces(5) manpage for information on what options are
298     # available.
299     ######################################################################
300    
301     # We always want the loopback interface.
302     #
303     auto lo
304     iface lo inet loopback
305    
306     # To use dhcp:
307     #
308     # auto eth0
309     # iface eth0 inet dhcp
310    
311     # An example static IP setup: (broadcast and gateway are optional)
312     #
313     # auto eth0
314     # iface eth0 inet static
315     # address 192.168.0.42
316     # network 192.168.0.0
317     # netmask 255.255.255.0
318     # broadcast 192.168.0.255
319     # gateway 192.168.0.1
320     </screen></informalexample>
321    
322     </para><para>
323    
324     Enter your nameserver(s) and search directives in
325     <filename>/etc/resolv.conf</filename>:
326    
327     <informalexample><screen>
328    
329     # editor /etc/resolv.conf
330    
331     </screen></informalexample>
332    
333     </para><para>
334    
335     A simple <filename>/etc/resolv.conf</filename>:
336    
337     <informalexample><screen>
338    
339     # search hqdom.local\000
340     # nameserver 10.1.1.36
341     # nameserver 192.168.9.100
342    
343     </screen></informalexample>
344    
345     </para><para>
346    
347     Enter your system's host name (2 to 63 characters):
348    
349     <informalexample><screen>
350    
351     # echo DebianHostName &#62; /etc/hostname
352    
353     </screen></informalexample>
354    
355     </para><para>
356    
357     If you have multiple network cards, you should arrange the names of
358     driver modules in the <filename>/etc/modules</filename> file into the
359     desired order. Then during boot, each card will be associated with the
360     interface name (eth0, eth1, etc.) that you expect.
361    
362     </para>
363     </sect3>
364    
365     <sect3>
366     <title>Configure Timezone, Users, and APT</title>
367    
368     <para>
369    
370     Set your timezone, add a normal user, and choose your <command>apt</command>
371     sources by running
372    
373     <informalexample><screen>
374    
375 joeyh 18643 # /usr/sbin/base-config new
376 toff 3352
377     </screen></informalexample>
378     </para>
379     </sect3>
380    
381     <sect3>
382     <title>Configure Locales</title>
383     <para>
384    
385     To configure your locale settings to use a language other than
386     English, install the locales support package and configure it:
387    
388     <informalexample><screen>
389    
390     # apt-get install locales
391     # dpkg-reconfigure locales
392    
393     </screen></informalexample>
394    
395     NOTE: Apt must be configured before, ie. during the base-config phase.
396     Before using locales with character sets other than ASCII or latin1,
397     please consult the appropriate localisation HOWTO.
398    
399     </para>
400     </sect3>
401     </sect2>
402    
403     <sect2>
404     <title>Install a Kernel</title>
405    
406     <para>
407    
408     If you intend to boot this system, you probably want a Linux kernel
409     and a boot loader. Identify available pre-packaged kernels with
410    
411     <informalexample><screen>
412    
413     # apt-cache search kernel-image
414    
415     </screen></informalexample>
416    
417     </para><para>
418    
419     Then install your choice using its package name.
420    
421     <informalexample><screen>
422    
423     # apt-get install kernel-image-2.X.X-arch-etc
424    
425     </screen></informalexample>
426    
427     </para>
428     </sect2>
429    
430     <sect2>
431     <title>Set up the Boot Loader</title>
432     <para>
433    
434 fjpop-guest 12756 To make your &debian; system bootable, set up your boot loader to load
435 joeyh 18643 the installed kernel with your new root partition. Note that debootstrap
436     does not install a boot loader, though you can use apt-get inside your
437     Debian chroot to do so.
438 toff 3352
439 toff 4119 </para><para arch="i386">
440 toff 3352
441 joeyh 18643 Check <userinput>info grub</userinput> or <userinput>man
442     lilo.conf</userinput> for instructions on setting up the
443     bootloader. If you are keeping the system you used to install Debian, just
444 mck-guest 18767 add an entry for the Debian install to your existing grub
445     <filename>menu.lst</filename> or <filename>lilo.confi</filename>. For
446     <filename>lilo.conf</filename>, you could also copy it to the new system and
447 joeyh 18643 edit it there. After you are done editing, call lilo (remember it will use
448 mck-guest 18767 <filename>lilo.conf</filename> relative to the system you call it from).
449 toff 3352
450 toff 4119 </para><para arch="i386">
451 toff 3352
452 mck-guest 18767 Here is a basic <filename>/etc/lilo.conf</filename> as an example:
453 toff 3352
454     <informalexample><screen>
455    
456     boot=/dev/hda6
457     root=/dev/hda6
458     install=/boot/boot-menu.b
459     delay=20
460     lba32
461     image=/vmlinuz
462     label=Debian
463    
464     </screen></informalexample>
465    
466 toff 4119 </para><para arch="powerpc">
467 toff 3352
468     Check <userinput>man yaboot.conf</userinput> for instructions on
469     setting up the bootloader. If you are keeping the system you used to
470     install Debian, just add an entry for the Debian install to your
471 mck-guest 18767 existing <filename>yaboot.conf</filename>. You could also copy it to
472     the new system and
473 toff 3352 edit it there. After you are done editing, call ybin (remember it will
474 mck-guest 18767 use <filename>yaboot.conf</filename> relative to the system you call it from).
475 toff 3352
476 toff 4119 </para><para arch="powerpc">
477 toff 3352
478 mck-guest 18767 Here is a basic <filename>/etc/yaboot.conf</filename> as an example:
479 toff 3352
480     <informalexample><screen>
481    
482     boot=/dev/hda2
483     device=hd:
484     partition=6
485     root=/dev/hda6
486     magicboot=/usr/lib/yaboot/ofboot
487     timeout=50
488     image=/vmlinux
489     label=Debian
490    
491     </screen></informalexample>
492    
493     On some machines, you may need to use <userinput>ide0:</userinput>
494     instead of <userinput>hd:</userinput>.
495    
496     </para>
497     </sect2>
498     </sect1>

Properties

Name Value
svn:keywords Id

  ViewVC Help
Powered by ViewVC 1.1.5