/[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.10 - (show annotations) (download) (as text)
Mon Sep 18 10:51:48 2006 UTC (8 years, 3 months ago) by nightmorph
Branch: MAIN
Changes since 1.9: +8 -3 lines
File MIME type: application/xml
more explicit 2006.0 only warning to liveusb guide, as well as updated 2006.1 gli handbook for a changed boot parameter we weren't originally notified about

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

  ViewVC Help
Powered by ViewVC 1.1.20