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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 25819 - (hide annotations) (download) (as text)
Sun Feb 20 00:21:03 2005 UTC (8 years, 3 months ago) by guillem
File MIME type: text/xml
File size: 12417 byte(s)
Sync untranslated files with english originals.
1 toff 3352 <!-- retain these comments for translator revision tracking -->
2 guillem 25819 <!-- original version: 25594 untranslated -->
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 guillem 25819 Red Hat, Mandrake, and SUSE. In this section some familiarity with
14 toff 3352 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 guillem 24849 # mke2fs -j /dev/hda6
47 toff 3352 </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 guillem 24849 # mkswap /dev/hda5
58     # sync; sync; sync
59     # swapon /dev/hda5
60 toff 3352 </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 guillem 24849 # mkdir /mnt/debinst
69     # mount /dev/hda6 /mnt/debinst
70 toff 3352 </screen></informalexample>
71    
72     </para>
73     </sect2>
74    
75     <sect2>
76     <title>Install <command>debootstrap</command></title>
77     <para>
78    
79     The tool that the Debian installer uses, which is recognized as the
80     official way to install a Debian base system, is
81 guillem 25819 <command>debootstrap</command>. It uses <command>wget</command> and
82     <command>ar</command>, but otherwise depends only on
83     <classname>/bin/sh</classname>. Install <command>wget</command> and
84     <command>ar</command> if they aren't already on your current system,
85 toff 3352 then download and install <command>debootstrap</command>.
86    
87     </para><para>
88    
89     If you have an rpm-based system, you can use alien to convert the
90     .deb into .rpm, or download an rpm-ized version at
91     <ulink url="http://people.debian.org/~blade/install/debootstrap"></ulink>
92    
93     </para><para>
94    
95     Or, you can use the following procedure to install it
96     manually. Make a work folder for extracting the .deb into:
97    
98     <informalexample><screen>
99 guillem 24849 # mkdir work
100     # cd work
101 toff 3352 </screen></informalexample>
102    
103     The <command>debootstrap</command> binary is located in the Debian
104     archive (be sure to select the proper file for your
105     architecture). Download the <command>debootstrap</command> .deb from
106     the <ulink url="http://ftp.debian.org/debian/pool/main/d/debootstrap/">
107     pool</ulink>, copy the package to the work folder, and extract the
108     binary files from it. You will need to have root privileges to install
109     the binaries.
110    
111     <informalexample><screen>
112 guillem 24849 # tar -xf debootstrap_0.X.X_arch.deb
113     # cd /
114     # zcat /full-path-to-work/work/data.tar.gz | tar xv
115 toff 3352 </screen></informalexample>
116    
117     </para>
118     </sect2>
119    
120     <sect2>
121 joeyh 18643 <title>Run <command>debootstrap</command></title>
122 toff 3352 <para>
123    
124     <command>debootstrap</command> can download the needed files directly
125     from the archive when you run it. You can substitute any Debian
126     archive mirror for <userinput>http.us.debian.org/debian</userinput> in
127     the command example below, preferably a mirror close to you
128     network-wise. Mirrors are listed at
129     <ulink url="http://www.debian.org/misc/README.mirrors"></ulink>.
130    
131     </para><para>
132    
133 joeyh 18643 If you have a &releasename; &debian; CD mounted at
134 toff 3352 <filename>/cdrom</filename>, you could substitute a file URL instead
135     of the http URL: <userinput>file:/cdrom/debian/</userinput>
136    
137     </para><para>
138    
139     Substitute one of the following for <replaceable>ARCH</replaceable>
140     in the <command>debootstrap</command> command:
141    
142     <userinput>alpha</userinput>,
143     <userinput>arm</userinput>,
144     <userinput>hppa</userinput>,
145     <userinput>i386</userinput>,
146     <userinput>ia64</userinput>,
147     <userinput>m68k</userinput>,
148     <userinput>mips</userinput>,
149     <userinput>mipsel</userinput>,
150     <userinput>powerpc</userinput>,
151     <userinput>s390</userinput>, or
152     <userinput>sparc</userinput>.
153    
154     <informalexample><screen>
155 guillem 24849 # /usr/sbin/debootstrap --arch ARCH &releasename; \
156 toff 3352 /mnt/debinst http://http.us.debian.org/debian
157     </screen></informalexample>
158    
159     </para>
160     </sect2>
161    
162     <sect2>
163     <title>Configure The Base System</title>
164     <para>
165    
166     Now you've got a real Debian system, though rather lean, on disk.
167     <command>Chroot</command> into it:
168    
169     <informalexample><screen>
170 guillem 24849 # chroot /mnt/debinst /bin/bash
171 toff 3352 </screen></informalexample>
172 guillem 24849
173 toff 3352 </para>
174    
175     <sect3>
176     <title>Mount Partitions</title>
177     <para>
178    
179     You need to create <filename>/etc/fstab</filename>.
180    
181     <informalexample><screen>
182 guillem 24849 # editor /etc/fstab
183 toff 3352 </screen></informalexample>
184    
185     Here is a sample you can modify to suit:
186    
187     <informalexample><screen>
188     # /etc/fstab: static file system information.
189     #
190     # file system mount point type options dump pass
191     /dev/XXX / ext2 defaults 0 0
192     /dev/XXX /boot ext2 ro,nosuid,nodev 0 2
193    
194     /dev/XXX none swap sw 0 0
195     proc /proc proc defaults 0 0
196    
197     /dev/fd0 /mnt/floppy auto noauto,rw,sync,user,exec 0 0
198     /dev/cdrom /mnt/cdrom iso9660 noauto,ro,user,exec 0 0
199    
200     /dev/XXX /tmp ext2 rw,nosuid,nodev 0 2
201     /dev/XXX /var ext2 rw,nosuid,nodev 0 2
202     /dev/XXX /usr ext2 rw,nodev 0 2
203     /dev/XXX /home ext2 rw,nosuid,nodev 0 2
204     </screen></informalexample>
205    
206     Use <userinput>mount -a</userinput> to mount all the file systems you
207     have specified in your <filename>/etc/fstab</filename>, or to mount
208     file systems individually use:
209    
210     <informalexample><screen>
211 guillem 24849 # mount /path # e.g.: mount /usr
212 toff 3352 </screen></informalexample>
213    
214     You can mount the proc file system multiple times and to arbitrary
215     locations, though /proc is customary. If you didn't use
216     <userinput>mount -a</userinput>, be sure to mount proc before
217     continuing:
218    
219     <informalexample><screen>
220 guillem 24849 # mount -t proc proc /proc
221 toff 3352 </screen></informalexample>
222    
223     </para>
224     </sect3>
225    
226     <sect3>
227     <title>Configure Keyboard</title>
228     <para>
229    
230     To configure your keyboard:
231    
232     <informalexample><screen>
233 guillem 24849 # dpkg-reconfigure console-data
234 toff 3352 </screen></informalexample>
235    
236     </para>
237     </sect3>
238    
239     <sect3>
240     <title>Configure Networking</title>
241     <para>
242    
243     To configure networking, edit
244     <filename>/etc/network/interfaces</filename>,
245     <filename>/etc/resolv.conf</filename>, and
246 cjwatson 15442 <filename>/etc/hostname</filename>.
247 toff 3352
248     <informalexample><screen>
249 guillem 24849 # editor /etc/network/interfaces
250 toff 3352 </screen></informalexample>
251    
252     Here are some simple examples from
253     <filename>/usr/share/doc/ifupdown/examples</filename>:
254    
255     <informalexample><screen>
256     ######################################################################
257     # /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
258     # See the interfaces(5) manpage for information on what options are
259     # available.
260     ######################################################################
261    
262     # We always want the loopback interface.
263     #
264     auto lo
265     iface lo inet loopback
266    
267     # To use dhcp:
268     #
269     # auto eth0
270     # iface eth0 inet dhcp
271    
272     # An example static IP setup: (broadcast and gateway are optional)
273     #
274     # auto eth0
275     # iface eth0 inet static
276     # address 192.168.0.42
277     # network 192.168.0.0
278     # netmask 255.255.255.0
279     # broadcast 192.168.0.255
280     # gateway 192.168.0.1
281     </screen></informalexample>
282    
283     Enter your nameserver(s) and search directives in
284     <filename>/etc/resolv.conf</filename>:
285    
286     <informalexample><screen>
287 guillem 24849 # editor /etc/resolv.conf
288 toff 3352 </screen></informalexample>
289    
290     A simple <filename>/etc/resolv.conf</filename>:
291    
292     <informalexample><screen>
293 guillem 24849 search hqdom.local\000
294     nameserver 10.1.1.36
295     nameserver 192.168.9.100
296 toff 3352 </screen></informalexample>
297    
298     Enter your system's host name (2 to 63 characters):
299    
300     <informalexample><screen>
301 guillem 24849 # echo DebianHostName &gt; /etc/hostname
302 toff 3352 </screen></informalexample>
303    
304     If you have multiple network cards, you should arrange the names of
305     driver modules in the <filename>/etc/modules</filename> file into the
306     desired order. Then during boot, each card will be associated with the
307     interface name (eth0, eth1, etc.) that you expect.
308    
309     </para>
310     </sect3>
311    
312     <sect3>
313     <title>Configure Timezone, Users, and APT</title>
314     <para>
315    
316     Set your timezone, add a normal user, and choose your <command>apt</command>
317     sources by running
318    
319     <informalexample><screen>
320 guillem 24849 # /usr/sbin/base-config new
321 toff 3352 </screen></informalexample>
322 guillem 24849
323 toff 3352 </para>
324     </sect3>
325    
326     <sect3>
327     <title>Configure Locales</title>
328     <para>
329    
330     To configure your locale settings to use a language other than
331     English, install the locales support package and configure it:
332    
333     <informalexample><screen>
334 guillem 24849 # apt-get install locales
335     # dpkg-reconfigure locales
336 toff 3352 </screen></informalexample>
337    
338     NOTE: Apt must be configured before, ie. during the base-config phase.
339     Before using locales with character sets other than ASCII or latin1,
340 guillem 23826 please consult the appropriate localization HOWTO.
341 toff 3352
342     </para>
343     </sect3>
344     </sect2>
345    
346     <sect2>
347     <title>Install a Kernel</title>
348     <para>
349    
350     If you intend to boot this system, you probably want a Linux kernel
351     and a boot loader. Identify available pre-packaged kernels with
352    
353     <informalexample><screen>
354 guillem 24849 # apt-cache search kernel-image
355 toff 3352 </screen></informalexample>
356    
357     Then install your choice using its package name.
358    
359     <informalexample><screen>
360 guillem 24849 # apt-get install kernel-image-<replaceable>2.X.X-arch-etc</replaceable>
361 toff 3352 </screen></informalexample>
362    
363     </para>
364     </sect2>
365    
366     <sect2>
367     <title>Set up the Boot Loader</title>
368     <para>
369    
370 fjpop-guest 12756 To make your &debian; system bootable, set up your boot loader to load
371 joeyh 18643 the installed kernel with your new root partition. Note that debootstrap
372     does not install a boot loader, though you can use apt-get inside your
373     Debian chroot to do so.
374 toff 3352
375 toff 4119 </para><para arch="i386">
376 toff 3352
377 joeyh 18643 Check <userinput>info grub</userinput> or <userinput>man
378     lilo.conf</userinput> for instructions on setting up the
379     bootloader. If you are keeping the system you used to install Debian, just
380 mck-guest 18767 add an entry for the Debian install to your existing grub
381 joeyh 18773 <filename>menu.lst</filename> or <filename>lilo.conf</filename>. For
382 mck-guest 18767 <filename>lilo.conf</filename>, you could also copy it to the new system and
383 joeyh 18643 edit it there. After you are done editing, call lilo (remember it will use
384 mck-guest 18767 <filename>lilo.conf</filename> relative to the system you call it from).
385 toff 3352
386 toff 4119 </para><para arch="i386">
387 toff 3352
388 mck-guest 18767 Here is a basic <filename>/etc/lilo.conf</filename> as an example:
389 toff 3352
390     <informalexample><screen>
391     boot=/dev/hda6
392     root=/dev/hda6
393     install=/boot/boot-menu.b
394     delay=20
395     lba32
396     image=/vmlinuz
397     label=Debian
398     </screen></informalexample>
399    
400 toff 4119 </para><para arch="powerpc">
401 toff 3352
402     Check <userinput>man yaboot.conf</userinput> for instructions on
403     setting up the bootloader. If you are keeping the system you used to
404     install Debian, just add an entry for the Debian install to your
405 mck-guest 18767 existing <filename>yaboot.conf</filename>. You could also copy it to
406     the new system and
407 toff 3352 edit it there. After you are done editing, call ybin (remember it will
408 mck-guest 18767 use <filename>yaboot.conf</filename> relative to the system you call it from).
409 toff 3352
410 toff 4119 </para><para arch="powerpc">
411 toff 3352
412 mck-guest 18767 Here is a basic <filename>/etc/yaboot.conf</filename> as an example:
413 toff 3352
414     <informalexample><screen>
415     boot=/dev/hda2
416     device=hd:
417     partition=6
418     root=/dev/hda6
419     magicboot=/usr/lib/yaboot/ofboot
420     timeout=50
421     image=/vmlinux
422     label=Debian
423     </screen></informalexample>
424    
425     On some machines, you may need to use <userinput>ide0:</userinput>
426     instead of <userinput>hd:</userinput>.
427    
428     </para>
429     </sect2>
430     </sect1>

Properties

Name Value
svn:keywords Id

  ViewVC Help
Powered by ViewVC 1.1.5