Gentoo Archives: gentoo-commits

From: "Le Zhang (r0bertz)" <r0bertz@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo commit in xml/htdocs/doc/zh_cn: liveusb.xml metadoc.xml
Date: Sat, 03 Nov 2007 17:06:39
Message-Id: E1IoMSA-0007lU-2H@stork.gentoo.org
1 r0bertz 07/11/03 17:06:34
2
3 Modified: metadoc.xml
4 Added: liveusb.xml
5 Log:
6 * added liveusb.xml
7
8 Revision Changes Path
9 1.19 xml/htdocs/doc/zh_cn/metadoc.xml
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/zh_cn/metadoc.xml?rev=1.19&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/zh_cn/metadoc.xml?rev=1.19&content-type=text/plain
13 diff : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/zh_cn/metadoc.xml?r1=1.18&r2=1.19
14
15 Index: metadoc.xml
16 ===================================================================
17 RCS file: /var/cvsroot/gentoo/xml/htdocs/doc/zh_cn/metadoc.xml,v
18 retrieving revision 1.18
19 retrieving revision 1.19
20 diff -u -r1.18 -r1.19
21 --- metadoc.xml 23 Oct 2007 13:50:33 -0000 1.18
22 +++ metadoc.xml 3 Nov 2007 17:06:33 -0000 1.19
23 @@ -1,6 +1,6 @@
24 <?xml version="1.0" encoding="UTF-8"?>
25 <!DOCTYPE metadoc SYSTEM "/dtd/metadoc.dtd">
26 -<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/zh_cn/metadoc.xml,v 1.18 2007/10/23 13:50:33 r0bertz Exp $ -->
27 +<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/zh_cn/metadoc.xml,v 1.19 2007/11/03 17:06:33 r0bertz Exp $ -->
28 <!-- English CVS version: 1.192 -->
29
30 <metadoc lang="zh_cn" parent="/doc/en/metadoc.xml">
31 @@ -345,7 +345,7 @@
32 <file id="kde-split-ebuilds">/doc/en/kde-split-ebuilds.xml</file>
33 <file id="grub-error-guide">/doc/zh_cn/grub-error-guide.xml</file>
34 <file id="usb-guide">/doc/zh_cn/usb-guide.xml</file>
35 - <file id="liveusb">/doc/en/liveusb.xml</file>
36 + <file id="liveusb">/doc/zh_cn/liveusb.xml</file>
37 <file id="fluxbox-config">/doc/en/fluxbox-config.xml</file>
38 <file id="vserver-howto">/proj/en/vps/vserver-howto.xml</file>
39 <file id="security-handbook-index">/doc/en/security/index.xml</file>
40
41
42
43 1.1 xml/htdocs/doc/zh_cn/liveusb.xml
44
45 file : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/zh_cn/liveusb.xml?rev=1.1&view=markup
46 plain: http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/zh_cn/liveusb.xml?rev=1.1&content-type=text/plain
47
48 Index: liveusb.xml
49 ===================================================================
50 <?xml version='1.0' encoding="UTF-8"?>
51 <!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
52
53 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/zh_cn/liveusb.xml,v 1.1 2007/11/03 17:06:33 r0bertz Exp $ -->
54 <!-- English CVS version:1.13 -->
55
56 <guide link="/doc/en/liveusb.xml">
57 <title>Gentoo Linux LiveUSB HOWTO</title>
58
59 <author title="Author">
60 <mail link="henrik@××××××××××××.dk">Henrik Brix Andersen</mail>
61 </author>
62 <author title="Editor">
63 <mail link="neysx@g.o">Xavier Neys</mail>
64 </author>
65 <author title="译者">
66 <mail link="lyanry@×××××.com">李延瑞</mail>
67 </author>
68
69 <abstract>
70 这份指南讲述了如何制作一份Gentoo Linux LiveUSB,或者换句话说就是如何使用一个U盘来模拟一张可运行于x86或AMD64平台的Gentoo Linux LiveCD。
71 </abstract>
72
73 <!-- The content of this document is licensed under the CC-BY-SA license -->
74 <!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
75 <license/>
76
77 <version>2</version>
78 <date>2007-05-10</date>
79
80 <chapter>
81 <title>简介</title>
82 <section>
83 <title>关于LiveUSB</title>
84 <body>
85
86 <p>
87 这份指南讲述了如何制作一份Gentoo Linux LiveUSB,或者换句话说就是如何使用一个U盘来模拟一张可运行于x86或AMD64平台的Gentoo Linux LiveCD。这在一些没有光驱而且又比较时新的笔记本(译者注:要支持USB设备启动)上安装Gentoo Linux时特别有用。
88 </p>
89
90 <p>
91 虽然本指南专注于使用U盘来模拟Gentoo Linux LiveCD,你也可以把这种方法用在其它任意的块存储设备 (block device) 上,只需要将本文的一些指令中的设备名称相应地调整一下即可。
92 </p>
93
94 </body>
95 </section>
96 <section>
97 <title>硬件需求</title>
98 <body>
99
100 <p>
101 要使用Gentoo Linux LiveUSB,你应具备:
102 </p>
103
104 <ul>
105 <li>至少1GB容量的U盘,用作启动盘</li>
106 <li>支持USB启动的i686 或 x86_64 架构的计算机</li>
107 </ul>
108
109 <p>
110 要制作一个LiveUSB,你还应当具备:
111 </p>
112
113 <ul>
114 <li>
115 一台运行Gentoo Linux系统的计算机(其它Linux发行版也可以)
116 </li>
117 </ul>
118
119 <note>
120 如果要制作一个minimal CD的LiveUSB或者要启动一个&lt;i686的系统,应当使用<b>2006.0</b> minimal CD镜像文件,因为更新的版本中存在一个<uri link="http://bugs.gentoo.org/show_bug.cgi?id=173117">bug</uri>。
121 </note>
122
123 </body>
124 </section>
125 </chapter>
126 <chapter>
127 <title>准备你的U盘</title>
128 <section>
129 <title>对U盘进行分区</title>
130 <body>
131
132 <warn>
133 下面的操作将会擦除你所用的这个U盘上所有的数据,因此首先要确认你已经对其中的数据进行了备份。
134 </warn>
135
136 <impo>
137 本指南假定所用的U盘设备路径是<path>/dev/sdc</path>,如果系统中还存在其它SCSI设备,请确认所用U盘的设备路径是正确的。
138 </impo>
139
140 <p>
141 首先要使用<c>fdisk</c>在所用的U盘上创建一个FAT16格式的分区,而且要将其标记为可启动的。下面给出一个分区模式的示例:
142 </p>
143
144 <note>
145 如果所用的U盘是4GB或更大容量的,使用分区类型(Id)<c>b</c> (W95 FAT32)。
146 </note>
147
148 <pre caption="分区模式的示例">
149 # <i>fdisk -l /dev/sdc</i>
150
151 Disk /dev/sdc: 2063 MB, 2063597056 bytes
152 255 heads, 63 sectors/track, 250 cylinders
153 Units = cylinders of 16065 * 512 = 8225280 bytes
154
155 Device Boot Start End Blocks Id System
156 /dev/sdc1 * 1 250 2008124+ 6 FAT16
157 </pre>
158
159 </body>
160 </section>
161 <section>
162 <title>创建文件系统</title>
163 <body>
164
165 <p>
166 使用<c>mkdosfs</c>在所用U盘上创建一个FAT16格式的文件系统:
167 </p>
168
169 <note>
170 如果所用U盘的容量为4GB或更大容量,使用<c>-F 32</c>来创建一个FAT32格式的文件系统。
171 </note>
172
173 <pre caption="使用mkdosfs创建文件系统">
174 <comment>(确认系统已经安装了sys-fs/dosfstools)</comment>
175 # <i>emerge -av sys-fs/dosfstools</i>
176 # <i>mkdosfs -F 16 /dev/sdc1</i>
177 mkdosfs 2.11 (12 Mar 2005)
178 </pre>
179
180 </body>
181 </section>
182 <section>
183 <title>安装主引导记录</title>
184 <body>
185
186 <p>
187 从<c>syslinux</c>中将预先编译好主引导记录 (MBR) 安装到U盘上:
188 </p>
189
190 <pre caption="安装主引导记录">
191 <comment>(确认系统已经安装了sys-boot/syslinux-3.00或更新的版本)</comment>
192 # <i>emerge -av '>sys-boot/syslinux-3'</i>
193 # <i>dd if=/usr/lib/syslinux/mbr.bin of=/dev/sdc</i>
194 0+1 records in
195 0+1 records out
196 304 bytes (304 B) copied, 0.0162317 s, 18.7 kB/s
197 </pre>
198
199 </body>
200 </section>
201 </chapter>
202
203 <chapter>
204 <title>将LiveCD中的文件复制到U盘中</title>
205 <section>
206 <title>挂载Gentoo Linux安装光盘镜像文件</title>
207 <body>
208
209 <p>
210 在距离你最近的Gentoo Linux<uri link="/main/en/where.xml">镜像</uri>站点,根据你的系统架构选择下载<path>liveced-i686-installer-2007.0.iso</path>或<path>livecd-amd64-installer-2007.0.iso</path>,然后将其挂载至<path>/mnt/cdrom</path>,操作如下:
211 </p>
212
213 <pre caption="挂载Gentoo Linux安装光盘镜像文件">
214 <comment>(如果/mnt/cdrom目录不存在就创建之)</comment>
215 # <i>mkdir -p /mnt/cdrom</i>
216 # <i>mount -o loop,ro -t iso9660 livecd-i686-installer-2007.0.iso /mnt/cdrom</i>
217 </pre>
218
219 <note>
220 如果在挂在光盘镜像文件时碰到诸如<e>Could not find any loop device</e>一类的错误信息,应当在内核配置中启用<c>Loopback device support</c>,然后重新编译并安装内核。
221 </note>
222
223 </body>
224 </section>
225 <section>
226 <title>挂在LiveUSB</title>
227 <body>
228
229 <p>
230 将已经格式化完毕的U盘挂载至<path>/mnt/usb</path>,操作如下:
231 </p>
232
233 <pre caption="挂载U盘">
234 <comment>(如果没有/mnt/usb目录,请自行建立)</comment>
235 # <i>mkdir -p /mnt/usb</i>
236 # <i>mount -t vfat /dev/sdc1 /mnt/usb</i>
237 </pre>
238
239 </body>
240 </section>
241 <section>
242 <title>复制文件</title>
243 <body>
244
245 <p>
246 下面要将Gentoo Linux安装光盘镜像文件中的一些文件复制到LiveUSB中。在复制这些文件时,需要做一些小改动,我们要使用<c>syslinux</c>启动装载程序来替换<c>isolinux</c>程序。
247 </p>
248
249 <pre caption="复制文件">
250 # <i>cp -r /mnt/cdrom/* /mnt/usb</i>
251 # <i>mv /mnt/usb/isolinux/* /mnt/usb</i>
252 # <i>mv /mnt/usb/isolinux.cfg /mnt/usb/syslinux.cfg</i>
253 # <i>rm -rf /mnt/usb/isolinux*</i>
254
255 <comment>(为了让系统由syslinux启动,需要对memtest86内核重命名)</comment>
256 # <i>mv /mnt/usb/memtest86 /mnt/usb/memtest</i>
257 </pre>
258
259 <p>
260 现在可以取消Gentoo Linux安装光盘镜像文件的挂载:
261 </p>
262
263 <pre caption="取消安装光盘镜像文件的挂载">
264 # <i>umount /mnt/cdrom</i>
265 </pre>
266
267 </body>
268 </section>
269 <section>
270 <title>调整系统启动配置</title>
271 <body>
272
273 <p>
274 下面使用<c>sed</c>调整syslinux配置文件,在配置文件中要添加<c>slowusb</c>参数,主要作用是在系统启动时挂载文件系统之前产生一小段时间的延迟,让系统装载程序可以检测到U盘设备。
275 </p>
276
277 <pre caption="调整启动参数">
278 # <i>sed -i \
279 -e "s:cdroot:cdroot slowusb:" \
280 -e "s:kernel memtest86:kernel memtest:" \
281 /mnt/usb/syslinux.cfg</i>
282 </pre>
283
284 </body>
285 </section>
286 </chapter>
287
288 <chapter>
289 <title>安装系统装载程序</title>
290 <section>
291 <title>卸载U盘</title>
292 <body>
293
294 <p>
295 在安装系统装载程序之前要确认已经卸载了U盘。
296 </p>
297
298 <pre caption="卸载U盘">
299 # <i>umount /mnt/usb</i>
300 </pre>
301
302 </body>
303 </section>
304 <section>
305 <title>安装syslinux</title>
306 <body>
307
308 <p>
309 最后一步要将<c>syslinux</c>程序安装到U盘上:
310 </p>
311
312 <pre caption="执行syslinux">
313 # <i>syslinux /dev/sdc1</i>
314 </pre>
315
316 <impo>
317 在每一次修改<path>syslinux.cfg</path>文件之后都需要重新执行<c>syslinux /dev/sdc1</c>。
318 </impo>
319
320 </body>
321 </section>
322 </chapter>
323 <chapter>
324 <title>使用LiveUSB</title>
325 <section>
326 <title>启动</title>
327 <body>
328
329 <p>
330 插入U盘并打开计算机,确认BIOS已经设成自USB启动模式。如果一切都准备就绪,那么你应当可以看到标准的syslinux提示。
331 syslinux prompt.
332 </p>
333
334 <p>
335 现在你可以根据<uri link="/doc/zh_cn/handbook">Gentoo Handbook</uri>中讲述的安装步骤来安装Gentoo Linux了。
336 </p>
337
338 </body>
339 </section>
340 </chapter>
341 </guide>
342
343
344
345 --
346 gentoo-commits@g.o mailing list