/[gentoo]/xml/htdocs/doc/en/liveusb.xml
Gentoo

Contents of /xml/htdocs/doc/en/liveusb.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.17 - (hide annotations) (download) (as text)
Mon Jan 26 16:56:00 2009 UTC (5 years, 7 months ago) by neysx
Branch: MAIN
Changes since 1.16: +11 -6 lines
File MIME type: application/xml
Added note about unetbootin

1 rane 1.1 <?xml version='1.0' encoding="UTF-8"?>
2     <!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
3 neysx 1.17 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/liveusb.xml,v 1.16 2009/01/26 07:15:58 nightmorph Exp $ -->
4 rane 1.1
5 neysx 1.17 <guide>
6 rane 1.1 <title>Gentoo Linux LiveUSB HOWTO</title>
7    
8     <author title="Author">
9 neysx 1.17 <mail link="brix"/>
10 rane 1.1 </author>
11 neysx 1.13 <author title="Editor">
12 neysx 1.17 <mail link="neys"/>
13 neysx 1.13 </author>
14 rane 1.1
15     <abstract>
16     This HOWTO explains how to create a Gentoo Linux LiveUSB or, in other words,
17 neysx 1.13 how to emulate an x86 or AMD64 Gentoo Linux LiveCD using a USB flash drive.
18 rane 1.1 </abstract>
19    
20     <!-- The content of this document is licensed under the CC-BY-SA license -->
21     <!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
22     <license/>
23    
24 neysx 1.17 <version>6</version>
25     <date>2009-01-26</date>
26 rane 1.1
27     <chapter>
28     <title>Introduction</title>
29     <section>
30     <title>The LiveUSB</title>
31     <body>
32    
33     <p>
34     This HOWTO explains how to create a <e>Gentoo Linux LiveUSB</e> or, in other
35 neysx 1.13 words, how to emulate an x86 or AMD64 Gentoo Linux LiveCD using a USB flash
36     drive. This is particularly useful for installing Gentoo Linux on a modern
37     laptop with no CD-ROM drive.
38 rane 1.1 </p>
39    
40 neysx 1.17 <note>
41     The <c>sys-boot/unetbootin</c> package provides a much easier alternative to
42     create a bootable USB stick from any bootable CD image.
43     </note>
44    
45 rane 1.1 <p>
46 vanquirius 1.4 Although the instructions found in this document aim at emulating a Gentoo
47 neysx 1.13 Linux LiveCD using a USB flash drive, they should work for any arbitrary block
48     device as long as you adjust the device names accordingly.
49 rane 1.1 </p>
50    
51     </body>
52     </section>
53     <section>
54     <title>Prerequisites</title>
55     <body>
56    
57     <p>
58     In order to use a Gentoo Linux LiveUSB you need the following:
59     </p>
60    
61     <ul>
62 neysx 1.13 <li>Bootable USB flash drive with at least 1GB</li>
63     <li>i686 or x86_64 computer with support for booting from USB</li>
64 rane 1.1 </ul>
65    
66     <p>
67     You will also need access to the following for creating the LiveUSB:
68     </p>
69    
70     <ul>
71     <li>
72     A computer running Gentoo Linux (or alternatively another Linux
73     distribution)
74     </li>
75     </ul>
76    
77 neysx 1.13 <note>
78     If you want to use the minimal CD on a smaller key or boot a &lt;i686 system,
79     you need to follow the procedure described in this document with a
80     <b>2006.0</b> minimal CD image because of a <uri
81     link="http://bugs.gentoo.org/show_bug.cgi?id=173117">bug</uri> in more recent
82     releases.
83     </note>
84    
85 rane 1.1 </body>
86     </section>
87     </chapter>
88     <chapter>
89     <title>Preparing the USB flash drive</title>
90     <section>
91     <title>Partitioning the drive</title>
92     <body>
93    
94     <warn>
95     These instructions will erase all data from the USB flash drive. Make sure to
96     backup your data first.
97     </warn>
98    
99     <impo>
100 neysx 1.13 This HOWTO assumes that the <path>/dev/sdc</path> device node corresponds to
101 rane 1.1 your USB flash drive. If you have other SCSI-like devices make sure to use the
102     correct device node.
103     </impo>
104    
105     <p>
106 neysx 1.13 Create a FAT16 partition on your USB flash drive and mark it bootable using
107 rane 1.1 <c>fdisk</c>. An example partitioning scheme can be seen below:
108     </p>
109    
110 neysx 1.13 <note>
111     If your key is 4GB or larger, use partition type <c>b</c> (W95 FAT32).
112     </note>
113    
114 rane 1.1 <pre caption="Example partitioning scheme">
115 neysx 1.13 # <i>fdisk -l /dev/sdc</i>
116 rane 1.1
117 neysx 1.13 Disk /dev/sdc: 2063 MB, 2063597056 bytes
118     255 heads, 63 sectors/track, 250 cylinders
119     Units = cylinders of 16065 * 512 = 8225280 bytes
120 rane 1.1
121     Device Boot Start End Blocks Id System
122 neysx 1.13 /dev/sdc1 * 1 250 2008124+ 6 FAT16
123 rane 1.1 </pre>
124    
125     </body>
126     </section>
127     <section>
128     <title>Creating the filesystem</title>
129     <body>
130    
131     <p>
132 neysx 1.13 Create a FAT16 filesystem on the USB flash drive using <c>mkdosfs</c>:
133 rane 1.1 </p>
134    
135 neysx 1.13 <note>
136     If your key is 4GB or larger, use <c>-F 32</c> to create a FAT32 filesystem.
137     </note>
138    
139 rane 1.1 <pre caption="Running mkdosfs">
140     <comment>(Make sure you have sys-fs/dosfstools installed)</comment>
141     # <i>emerge -av sys-fs/dosfstools</i>
142 neysx 1.13 # <i>mkdosfs -F 16 /dev/sdc1</i>
143 rane 1.1 mkdosfs 2.11 (12 Mar 2005)
144     </pre>
145    
146     </body>
147     </section>
148     <section>
149     <title>Installing a Master Boot Record</title>
150     <body>
151    
152     <p>
153     Install the precompiled Master Boot Record (MBR) from <c>syslinux</c> on the
154     USB flash drive:
155     </p>
156    
157     <pre caption="Installing a master boot record">
158     <comment>(Make sure you have sys-boot/syslinux-3.00 or later installed)</comment>
159 nightmorph 1.12 # <i>emerge -av '>sys-boot/syslinux-3'</i>
160 nightmorph 1.16 # <i>dd if=/usr/share/syslinux/mbr.bin of=/dev/sdc</i>
161 rane 1.1 0+1 records in
162     0+1 records out
163 neysx 1.13 304 bytes (304 B) copied, 0.0162317 s, 18.7 kB/s
164 rane 1.1 </pre>
165    
166     </body>
167     </section>
168     </chapter>
169 neysx 1.13
170 rane 1.1 <chapter>
171 neysx 1.13 <title>Copying the files to your key</title>
172 rane 1.1 <section>
173     <title>Mounting the Gentoo Linux Installation CD</title>
174     <body>
175    
176     <p>
177 neysx 1.13 Download either <path>livecd-i686-installer-2007.0.iso</path> or
178     <path>livecd-amd64-installer-2007.0.iso</path> from your local Gentoo Linux
179     <uri link="/main/en/where.xml">mirror</uri> site and mount the ISO image on
180     <path>/mnt/cdrom</path> as shown below:
181 rane 1.1 </p>
182    
183     <pre caption="Mounting the Gentoo Linux Installation CD ISO image">
184 neysx 1.13 <comment>(Create the /mnt/cdrom mount point if needed)</comment>
185 rane 1.1 # <i>mkdir -p /mnt/cdrom</i>
186 neysx 1.13 # <i>mount -o loop,ro -t iso9660 livecd-i686-installer-2007.0.iso /mnt/cdrom</i>
187 rane 1.1 </pre>
188    
189 neysx 1.7 <note>
190     If you receive a <e>Could not find any loop device</e> error message when
191     mounting the iso, you need to enable the <c>Loopback device support</c> option
192     in your kernel configuration.
193     </note>
194    
195 rane 1.1 </body>
196     </section>
197     <section>
198     <title>Mounting the LiveUSB</title>
199     <body>
200    
201     <p>
202 neysx 1.13 Mount the newly formatted USB flash drive on <path>/mnt/usb</path> as shown
203 rane 1.1 below:
204     </p>
205    
206     <pre caption="Mounting the USB flash drive">
207 neysx 1.13 <comment>(Create the /mnt/usb mount point if needed)</comment>
208 rane 1.1 # <i>mkdir -p /mnt/usb</i>
209 neysx 1.13 # <i>mount -t vfat /dev/sdc1 /mnt/usb</i>
210 rane 1.1 </pre>
211    
212     </body>
213     </section>
214     <section>
215     <title>Copying the files</title>
216     <body>
217    
218     <p>
219     Copy the files from the Gentoo Linux Installation CD to the LiveUSB. The files
220 rane 1.3 need to be reordered a bit as we will be using the <c>syslinux</c> bootloader
221 rane 1.1 instead of <c>isolinux</c>:
222     </p>
223    
224     <pre caption="Copying the files">
225 neysx 1.13 # <i>cp -r /mnt/cdrom/* /mnt/usb</i>
226     # <i>mv /mnt/usb/isolinux/* /mnt/usb</i>
227 rane 1.1 # <i>mv /mnt/usb/isolinux.cfg /mnt/usb/syslinux.cfg</i>
228     # <i>rm -rf /mnt/usb/isolinux*</i>
229    
230     <comment>(The memtest86 kernel needs to be renamed for loading it via syslinux)</comment>
231     # <i>mv /mnt/usb/memtest86 /mnt/usb/memtest</i>
232     </pre>
233    
234     <p>
235     You can now unmount the ISO image:
236     </p>
237    
238     <pre caption="Unmounting the ISO image">
239 neysx 1.13 # <i>umount /mnt/cdrom</i>
240 rane 1.1 </pre>
241    
242     </body>
243     </section>
244     <section>
245     <title>Adjusting the bootloader configuration</title>
246     <body>
247    
248     <p>
249     Adjust the syslinux configuration file using <c>sed</c> as shown below. The
250 neysx 1.13 <c>slowusb</c> parameter will introduce some extra delays before attempting to
251     mount the filesystem. This is needed to allow the USB flash drive to settle
252     upon detection.
253 rane 1.1 </p>
254    
255     <pre caption="Adjusting the boot parameters">
256     # <i>sed -i \
257 neysx 1.13 -e "s:cdroot:cdroot slowusb:" \
258 rane 1.1 -e "s:kernel memtest86:kernel memtest:" \
259     /mnt/usb/syslinux.cfg</i>
260     </pre>
261    
262     </body>
263     </section>
264     </chapter>
265 neysx 1.13
266 rane 1.1 <chapter>
267     <title>Installing a bootloader</title>
268     <section>
269     <title>Unmounting the drive</title>
270     <body>
271    
272     <p>
273 rane 1.2 Make sure you unmount the USB flash drive before installing the bootloader:
274 rane 1.1 </p>
275    
276     <pre caption="Unmounting the USB flash drive">
277 neysx 1.13 # <i>umount /mnt/usb</i>
278 rane 1.1 </pre>
279    
280     </body>
281     </section>
282     <section>
283     <title>Installing syslinux</title>
284     <body>
285    
286     <p>
287     Finally install the <c>syslinux</c> bootloader on the USB flash drive:
288     </p>
289    
290     <pre caption="Running syslinux">
291 neysx 1.13 # <i>syslinux /dev/sdc1</i>
292 rane 1.1 </pre>
293    
294     <impo>
295 neysx 1.13 You will need to rerun <c>syslinux /dev/sdc1</c> each time you modify the
296 rane 1.1 <path>syslinux.cfg</path> file for the configuration changes to take affect.
297     </impo>
298    
299     </body>
300     </section>
301     </chapter>
302     <chapter>
303     <title>Using the LiveUSB</title>
304     <section>
305     <title>Booting</title>
306     <body>
307    
308     <p>
309     Insert the USB flash drive and turn on the computer, making sure the BIOS is
310     set to boot from USB. If all goes well you should be presented with a standard
311     syslinux prompt.
312     </p>
313    
314     <p>
315     You should be able to follow the generic installation instructions found in the
316     <uri link="/doc/en/handbook/">Gentoo Handbook</uri> from here on.
317     </p>
318    
319     </body>
320     </section>
321     </chapter>
322     </guide>

  ViewVC Help
Powered by ViewVC 1.1.20