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