/[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.9 - (show annotations) (download) (as text)
Sat Sep 9 10:00:13 2006 UTC (8 years ago) by nightmorph
Branch: MAIN
Changes since 1.8: +5 -5 lines
File MIME type: application/xml
reverting to a 2006.0 stage per email received from brix. looks like the 2006.1 tarballs are fundamentally incompatible with the steps in this guide

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.8 2006/09/04 20:35:41 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.5</version>
22 <date>2006-09-09</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 <p>
153 Download the <path>install-x86-minimal-2006.0.iso</path> file from your
154 local Gentoo Linux <uri link="/main/en/where.xml">mirror</uri> site and mount
155 the ISO image on <path>/mnt/cdrom/</path> as shown below:
156 </p>
157
158 <pre caption="Mounting the Gentoo Linux Installation CD ISO image">
159 <comment>(Create the /mnt/cdrom/ mount point if needed)</comment>
160 # <i>mkdir -p /mnt/cdrom</i>
161 # <i>mount -o loop,ro -t iso9660 install-x86-minimal-2006.0.iso /mnt/cdrom/</i>
162 </pre>
163
164 <note>
165 If you receive a <e>Could not find any loop device</e> error message when
166 mounting the iso, you need to enable the <c>Loopback device support</c> option
167 in your kernel configuration.
168 </note>
169
170 </body>
171 </section>
172 <section>
173 <title>Mounting the LiveUSB</title>
174 <body>
175
176 <p>
177 Mount the newly formatted USB flash drive on <path>/mnt/usb/</path> as shown
178 below:
179 </p>
180
181 <pre caption="Mounting the USB flash drive">
182 <comment>(Create the /mnt/usb/ mount point if needed)</comment>
183 # <i>mkdir -p /mnt/usb</i>
184 # <i>mount -t vfat /dev/sda1 /mnt/usb/</i>
185 </pre>
186
187 </body>
188 </section>
189 <section>
190 <title>Copying the files</title>
191 <body>
192
193 <p>
194 Copy the files from the Gentoo Linux Installation CD to the LiveUSB. The files
195 need to be reordered a bit as we will be using the <c>syslinux</c> bootloader
196 instead of <c>isolinux</c>:
197 </p>
198
199 <pre caption="Copying the files">
200 # <i>cp -r /mnt/cdrom/* /mnt/usb/</i>
201 # <i>mv /mnt/usb/isolinux/* /mnt/usb/</i>
202 # <i>mv /mnt/usb/isolinux.cfg /mnt/usb/syslinux.cfg</i>
203 # <i>rm -rf /mnt/usb/isolinux*</i>
204
205 <comment>(The memtest86 kernel needs to be renamed for loading it via syslinux)</comment>
206 # <i>mv /mnt/usb/memtest86 /mnt/usb/memtest</i>
207 </pre>
208
209 <p>
210 You can now unmount the ISO image:
211 </p>
212
213 <pre caption="Unmounting the ISO image">
214 # <i>umount /mnt/cdrom/</i>
215 </pre>
216
217 </body>
218 </section>
219 <section>
220 <title>Adjusting the bootloader configuration</title>
221 <body>
222
223 <p>
224 Adjust the syslinux configuration file using <c>sed</c> as shown below. The
225 <c>dobladecenter</c> parameter will introduce some extra delays before
226 attempting to mount the filesystem. This is needed to allow the USB
227 flash drive to settle upon detection.
228 </p>
229
230 <pre caption="Adjusting the boot parameters">
231 # <i>sed -i \
232 -e "s:cdroot:cdroot dobladecenter:" \
233 -e "s:kernel memtest86:kernel memtest:" \
234 /mnt/usb/syslinux.cfg</i>
235 </pre>
236
237 <note>
238 Consider adding <c>docache</c> to the boot parameters. This will allow running
239 <c>umount /mnt/cdrom/</c> after booting so that you can unplug the USB flash
240 drive. Do not enable this unless the target computer has at least 128MB RAM.
241 </note>
242
243 </body>
244 </section>
245 </chapter>
246 <chapter>
247 <title>Installing a bootloader</title>
248 <section>
249 <title>Unmounting the drive</title>
250 <body>
251
252 <p>
253 Make sure you unmount the USB flash drive before installing the bootloader:
254 </p>
255
256 <pre caption="Unmounting the USB flash drive">
257 # <i>umount /mnt/usb/</i>
258 </pre>
259
260 </body>
261 </section>
262 <section>
263 <title>Installing syslinux</title>
264 <body>
265
266 <p>
267 Finally install the <c>syslinux</c> bootloader on the USB flash drive:
268 </p>
269
270 <pre caption="Running syslinux">
271 # <i>syslinux /dev/sda1</i>
272 </pre>
273
274 <impo>
275 You will need to rerun <c>syslinux /dev/sda1</c> each time you modify the
276 <path>syslinux.cfg</path> file for the configuration changes to take affect.
277 </impo>
278
279 </body>
280 </section>
281 </chapter>
282 <chapter>
283 <title>Using the LiveUSB</title>
284 <section>
285 <title>Booting</title>
286 <body>
287
288 <p>
289 Insert the USB flash drive and turn on the computer, making sure the BIOS is
290 set to boot from USB. If all goes well you should be presented with a standard
291 syslinux prompt.
292 </p>
293
294 <p>
295 You should be able to follow the generic installation instructions found in the
296 <uri link="/doc/en/handbook/">Gentoo Handbook</uri> from here on.
297 </p>
298
299 </body>
300 </section>
301 </chapter>
302 </guide>

  ViewVC Help
Powered by ViewVC 1.1.20