/[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.20 - (show annotations) (download) (as text)
Sun Aug 18 13:00:35 2013 UTC (14 months, 1 week ago) by swift
Branch: MAIN
CVS Tags: HEAD
Changes since 1.19: +2 -2 lines
File MIME type: application/xml
LiveUSB guide moved to https://wiki.gentoo.org/wiki/LiveUSB/HOWTO

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.19 2009/11/20 13:12:51 nightmorph Exp $ -->
4
5 <guide disclaimer="obsolete" redirect="https://wiki.gentoo.org/wiki/LiveUSB/HOWTO">
6 <title>Gentoo Linux LiveUSB HOWTO</title>
7
8 <author title="Author">
9 <mail link="brix"/>
10 </author>
11 <author title="Editor">
12 <mail link="neysx"/>
13 </author>
14
15 <abstract>
16 This HOWTO explains how to create a Gentoo Linux LiveUSB or, in other words,
17 how to emulate an x86 or AMD64 Gentoo Linux LiveCD using a USB flash drive.
18 </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 <version>7</version>
25 <date>2009-11-20</date>
26
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 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 </p>
39
40 <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 <p>
46 Although the instructions found in this document aim at emulating a Gentoo
47 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 </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 <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 </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 </body>
78 </section>
79 </chapter>
80 <chapter>
81 <title>Preparing the USB flash drive</title>
82 <section>
83 <title>Partitioning the drive</title>
84 <body>
85
86 <warn>
87 These instructions will erase all data from the USB flash drive. Make sure to
88 backup your data first.
89 </warn>
90
91 <impo>
92 This HOWTO assumes that the <path>/dev/sdc</path> device node corresponds to
93 your USB flash drive. If you have other SCSI-like devices make sure to use the
94 correct device node.
95 </impo>
96
97 <p>
98 Create a FAT16 partition on your USB flash drive and mark it bootable using
99 <c>fdisk</c>. An example partitioning scheme can be seen below:
100 </p>
101
102 <note>
103 If your key is 4GB or larger, use partition type <c>b</c> (W95 FAT32).
104 </note>
105
106 <pre caption="Example partitioning scheme">
107 # <i>fdisk -l /dev/sdc</i>
108
109 Disk /dev/sdc: 2063 MB, 2063597056 bytes
110 255 heads, 63 sectors/track, 250 cylinders
111 Units = cylinders of 16065 * 512 = 8225280 bytes
112
113 Device Boot Start End Blocks Id System
114 /dev/sdc1 * 1 250 2008124+ 6 FAT16
115 </pre>
116
117 </body>
118 </section>
119 <section>
120 <title>Creating the filesystem</title>
121 <body>
122
123 <p>
124 Create a FAT16 filesystem on the USB flash drive using <c>mkdosfs</c>:
125 </p>
126
127 <note>
128 If your key is 4GB or larger, use <c>-F 32</c> to create a FAT32 filesystem.
129 </note>
130
131 <pre caption="Running mkdosfs">
132 <comment>(Make sure you have sys-fs/dosfstools installed)</comment>
133 # <i>emerge -av sys-fs/dosfstools</i>
134 # <i>mkdosfs -F 16 /dev/sdc1</i>
135 mkdosfs 2.11 (12 Mar 2005)
136 </pre>
137
138 </body>
139 </section>
140 <section>
141 <title>Installing a Master Boot Record</title>
142 <body>
143
144 <p>
145 Install the precompiled Master Boot Record (MBR) from <c>syslinux</c> on the
146 USB flash drive:
147 </p>
148
149 <pre caption="Installing a master boot record">
150 <comment>(Make sure you have sys-boot/syslinux-3.00 or later installed)</comment>
151 # <i>emerge -av '>sys-boot/syslinux-3'</i>
152 # <i>dd if=/usr/share/syslinux/mbr.bin of=/dev/sdc</i>
153 0+1 records in
154 0+1 records out
155 304 bytes (304 B) copied, 0.0162317 s, 18.7 kB/s
156 </pre>
157
158 </body>
159 </section>
160 </chapter>
161
162 <chapter>
163 <title>Copying the files to your key</title>
164 <section>
165 <title>Mounting the Gentoo Linux Installation CD</title>
166 <body>
167
168 <p>
169 Download the Gentoo Weekly Minimal Install CD for your architecture from your
170 local Gentoo Linux <uri link="/main/en/where.xml">mirror</uri> site and mount
171 the ISO image on <path>/mnt/cdrom</path> as shown below:
172 </p>
173
174 <pre caption="Mounting the Gentoo Linux Installation CD ISO image">
175 <comment>(Create the /mnt/cdrom mount point if needed)</comment>
176 # <i>mkdir -p /mnt/cdrom</i>
177 # <i>mount -o loop,ro -t iso9660 /path/to/iso.iso /mnt/cdrom</i>
178 </pre>
179
180 <note>
181 If you receive a <e>Could not find any loop device</e> error message when
182 mounting the iso, you need to enable the <c>Loopback device support</c> option
183 in your kernel configuration.
184 </note>
185
186 </body>
187 </section>
188 <section>
189 <title>Mounting the LiveUSB</title>
190 <body>
191
192 <p>
193 Mount the newly formatted USB flash drive on <path>/mnt/usb</path> as shown
194 below:
195 </p>
196
197 <pre caption="Mounting the USB flash drive">
198 <comment>(Create the /mnt/usb mount point if needed)</comment>
199 # <i>mkdir -p /mnt/usb</i>
200 # <i>mount -t vfat /dev/sdc1 /mnt/usb</i>
201 </pre>
202
203 </body>
204 </section>
205 <section>
206 <title>Copying the files</title>
207 <body>
208
209 <p>
210 Copy the files from the Gentoo Linux Installation CD to the LiveUSB. The files
211 need to be reordered a bit as we will be using the <c>syslinux</c> bootloader
212 instead of <c>isolinux</c>:
213 </p>
214
215 <pre caption="Copying the files">
216 # <i>cp -r /mnt/cdrom/* /mnt/usb</i>
217 # <i>mv /mnt/usb/isolinux/* /mnt/usb</i>
218 # <i>mv /mnt/usb/isolinux.cfg /mnt/usb/syslinux.cfg</i>
219 # <i>rm -rf /mnt/usb/isolinux*</i>
220
221 <comment>(The memtest86 kernel needs to be renamed for loading it via syslinux)</comment>
222 # <i>mv /mnt/usb/memtest86 /mnt/usb/memtest</i>
223 </pre>
224
225 <p>
226 You can now unmount the ISO image:
227 </p>
228
229 <pre caption="Unmounting the ISO image">
230 # <i>umount /mnt/cdrom</i>
231 </pre>
232
233 </body>
234 </section>
235 <section>
236 <title>Adjusting the bootloader configuration</title>
237 <body>
238
239 <p>
240 Adjust the syslinux configuration file using <c>sed</c> as shown below. The
241 <c>slowusb</c> parameter will introduce some extra delays before attempting to
242 mount the filesystem. This is needed to allow the USB flash drive to settle
243 upon detection.
244 </p>
245
246 <pre caption="Adjusting the boot parameters">
247 # <i>sed -i \
248 -e "s:cdroot:cdroot slowusb:" \
249 -e "s:kernel memtest86:kernel memtest:" \
250 /mnt/usb/syslinux.cfg</i>
251 </pre>
252
253 </body>
254 </section>
255 </chapter>
256
257 <chapter>
258 <title>Installing a bootloader</title>
259 <section>
260 <title>Unmounting the drive</title>
261 <body>
262
263 <p>
264 Make sure you unmount the USB flash drive before installing the bootloader:
265 </p>
266
267 <pre caption="Unmounting the USB flash drive">
268 # <i>umount /mnt/usb</i>
269 </pre>
270
271 </body>
272 </section>
273 <section>
274 <title>Installing syslinux</title>
275 <body>
276
277 <p>
278 Finally install the <c>syslinux</c> bootloader on the USB flash drive:
279 </p>
280
281 <pre caption="Running syslinux">
282 # <i>syslinux /dev/sdc1</i>
283 </pre>
284
285 <impo>
286 You will need to rerun <c>syslinux /dev/sdc1</c> each time you modify the
287 <path>syslinux.cfg</path> file for the configuration changes to take affect.
288 </impo>
289 <note>
290 If this is the first time you have used syslinux, you will need to edit
291 <path>/etc/mtools/mtools.conf</path> on your host. Simply commenting out
292 <c>SAMPLE FILE</c> will suffice for the purpose of this guide.
293 </note>
294
295 </body>
296 </section>
297 </chapter>
298 <chapter>
299 <title>Using the LiveUSB</title>
300 <section>
301 <title>Booting</title>
302 <body>
303
304 <p>
305 Insert the USB flash drive and turn on the computer, making sure the BIOS is
306 set to boot from USB. If all goes well you should be presented with a standard
307 syslinux prompt.
308 </p>
309
310 <p>
311 You should be able to follow the generic installation instructions found in the
312 <uri link="/doc/en/handbook/">Gentoo Handbook</uri> from here on.
313 </p>
314
315 </body>
316 </section>
317 </chapter>
318 </guide>

  ViewVC Help
Powered by ViewVC 1.1.20