e2fsprogs.xml 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  4. <!ENTITY % general-entities SYSTEM "../general.ent">
  5. %general-entities;
  6. ]>
  7. <sect1 id="ch-system-e2fsprogs" role="wrap">
  8. <?dbhtml filename="e2fsprogs.html"?>
  9. <sect1info condition="script">
  10. <productname>e2fsprogs</productname>
  11. <productnumber>&e2fsprogs-version;</productnumber>
  12. <address>&e2fsprogs-url;</address>
  13. </sect1info>
  14. <title>E2fsprogs-&e2fsprogs-version;</title>
  15. <indexterm zone="ch-system-e2fsprogs">
  16. <primary sortas="a-E2fsprogs">E2fsprogs</primary>
  17. </indexterm>
  18. <sect2 role="package">
  19. <title/>
  20. <para>E2fsprogs 软件包包含处理
  21. <systemitem class="filesystem">ext2</systemitem> 文件系统的工具。
  22. 此外它也支持 <systemitem class="filesystem">ext3</systemitem> 和
  23. <systemitem class="filesystem">ext4</systemitem> 日志文件系统。</para>
  24. <segmentedlist>
  25. <segtitle>&buildtime;</segtitle>
  26. <segtitle>&diskspace;</segtitle>
  27. <seglistitem>
  28. <seg>&e2fsprogs-ch6-sbu;</seg>
  29. <seg>&e2fsprogs-ch6-du;</seg>
  30. </seglistitem>
  31. </segmentedlist>
  32. </sect2>
  33. <sect2 role="installation">
  34. <title>安装 E2fsprogs</title>
  35. <para>E2fsprogs 文档推荐在源代码目录树中的一个子目录中构建该软件包:
  36. </para>
  37. <screen><userinput remap="pre">mkdir -v build
  38. cd build</userinput></screen>
  39. <para>准备安装 E2fsprogs:</para>
  40. <!--<screen><userinput remap="configure">LIBS=-L/tools/lib \
  41. CFLAGS=-I/tools/include \
  42. CFLAGS=-I/tools/include \
  43. PKG_CONFIG_PATH=/tools/lib/pkgconfig \
  44. ../configure - -prefix=/usr \-->
  45. <screen><userinput remap="configure">../configure --prefix=/usr \
  46. --bindir=/bin \
  47. --with-root-prefix="" \
  48. --enable-elf-shlibs \
  49. --disable-libblkid \
  50. --disable-libuuid \
  51. --disable-uuidd \
  52. --disable-fsck</userinput></screen>
  53. <variablelist>
  54. <title>环境变量和配置选项的含义:</title>
  55. <!--
  56. <varlistentry>
  57. <term><parameter>PKG_CONFIG_PATH, LIBS, CFLAGS</parameter></term>
  58. <listitem>
  59. <para>这些变量使得 e2fsprog 在构建时使用之前构建的
  60. <xref linkend="ch-tools-util-linux"/> 软件包。</para>
  61. </listitem>
  62. </varlistentry>
  63. -->
  64. <varlistentry>
  65. <term><parameter>--with-root-prefix=""</parameter> 和
  66. <parameter>--bindir=/bin</parameter></term>
  67. <listitem>
  68. <para>某些程序(例如 <command>e2fsck</command>
  69. 程序)被认为是关键的。在
  70. <filename class="directory">/usr</filename> 尚未挂载等情况下,
  71. 这些程序仍然必须可用。它们应该放置在
  72. <filename class="directory">/lib</filename> 和 <filename
  73. class="directory">/sbin</filename> 等目录中。如果没有向
  74. e2fsprogs 配置脚本传递该参数,这些程序会被安装到
  75. <filename class="directory">/usr</filename> 目录。</para>
  76. </listitem>
  77. </varlistentry>
  78. <varlistentry>
  79. <term><parameter>--enable-elf-shlibs</parameter></term>
  80. <listitem>
  81. <para>该选项表示创建该软件包中一些程序使用的共享库。</para>
  82. </listitem>
  83. </varlistentry>
  84. <varlistentry>
  85. <term><parameter>--disable-*</parameter></term>
  86. <listitem>
  87. <para>该选项防止 e2fsprogs 构建和安装
  88. <systemitem class="library">libuuid</systemitem> 和
  89. <systemitem class="library">libblkid</systemitem> 库,
  90. <systemitem class="daemon">uuidd</systemitem> 守护程序,以及
  91. <command>fsck</command> 包装器, 因为 Util-linux 会安装更新的版本。
  92. </para>
  93. </listitem>
  94. </varlistentry>
  95. </variablelist>
  96. <para>编译该软件包:</para>
  97. <screen><userinput remap="make">make</userinput></screen>
  98. <!--
  99. <para>To set up and run the test suite we need to first link some
  100. libraries from /tools/lib to a location where the test programs look.
  101. To run the tests, issue:</para>
  102. -->
  103. <para>执行以下命令,以运行测试:</para>
  104. <screen><userinput remap="test">make check</userinput></screen>
  105. <!--ln -sfv /tools/lib/lib{blk,uu}id.so.1 lib -->
  106. <!--make LD_LIBRARY_PATH=/tools/lib check</userinput></screen>-->
  107. <!--para>One of the E2fsprogs tests will attempt to allocate 256 MB of memory.
  108. If you do not have significantly more RAM than this, be sure to enable
  109. sufficient swap space for the test. See <xref
  110. linkend="space-creatingfilesystem"/> and <xref linkend="space-mounting"/>
  111. for details on creating and enabling swap space.</para-->
  112. <para>某个 e2fsprogs 测试会试图分配 256MB 内存。
  113. 如果您的内存刚刚超过或者甚至不足这个大小,
  114. 一定要为测试启用足够的交换空间。
  115. 阅读 <xref linkend="space-creatingfilesystem"/>
  116. 和 <xref linkend="space-mounting"/>
  117. 了解创建和启用交换空间的详细过程。</para>
  118. <para>安装二进制程序、文档和共享库:</para>
  119. <screen><userinput remap="install">make install</userinput></screen>
  120. <para>安装静态库和头文件:</para>
  121. <screen><userinput remap="install">make install-libs</userinput></screen>
  122. <para>将安装好的静态库变为可写的,以便之后移除调试符号:</para>
  123. <screen><userinput remap="install">chmod -v u+w /usr/lib/{libcom_err,libe2p,libext2fs,libss}.a</userinput></screen>
  124. <para>该软件包安装了一个 gzip 压缩的
  125. <filename class="extension">.info</filename> 文件,却没有更新系统的
  126. <filename>dir</filename> 文件。执行以下命令解压该文件,并更新系统
  127. <filename>dir</filename> 文件:</para>
  128. <screen><userinput remap="install">gunzip -v /usr/share/info/libext2fs.info.gz
  129. install-info --dir-file=/usr/share/info/dir /usr/share/info/libext2fs.info</userinput></screen>
  130. <para>如果需要,执行以下命令创建并安装一些额外的文档:</para>
  131. <screen><userinput remap="install">makeinfo -o doc/com_err.info ../lib/et/com_err.texinfo
  132. install -v -m644 doc/com_err.info /usr/share/info
  133. install-info --dir-file=/usr/share/info/dir /usr/share/info/com_err.info</userinput></screen>
  134. </sect2>
  135. <sect2 id="contents-e2fsprogs" role="content">
  136. <title>E2fsprogs 的内容</title>
  137. <segmentedlist>
  138. <segtitle>安装的程序</segtitle>
  139. <segtitle>安装的库</segtitle>
  140. <segtitle>安装的目录</segtitle>
  141. <seglistitem>
  142. <seg>badblocks, chattr, compile_et, debugfs, dumpe2fs,e2freefrag,
  143. e2fsck, e2image, e2label, e2undo, e4defrag, filefrag, fsck.ext2,
  144. fsck.ext3, fsck.ext4, fsck.ext4dev, logsave, lsattr, mk_cmds, mke2fs,
  145. mkfs.ext2, mkfs.ext3, mkfs.ext4, mkfs.ext4dev, mklost+found,
  146. resize2fs, 以及 tune2fs</seg>
  147. <seg>libcom_err.so, libe2p.so, libext2fs.so, 以及 libss.so</seg>
  148. <seg>/usr/include/e2p, /usr/include/et, /usr/include/ext2fs,
  149. /usr/include/ss, /usr/share/et, 以及 /usr/share/ss</seg>
  150. </seglistitem>
  151. </segmentedlist>
  152. <variablelist>
  153. <bridgehead renderas="sect3">简要描述</bridgehead>
  154. <?dbfo list-presentation="list"?>
  155. <?dbhtml list-presentation="table"?>
  156. <varlistentry id="badblocks">
  157. <term><command>badblocks</command></term>
  158. <listitem>
  159. <para>在一个设备(一般是磁盘分区)上搜索坏块</para>
  160. <indexterm zone="ch-system-e2fsprogs badblocks">
  161. <primary sortas="b-badblocks">badblocks</primary>
  162. </indexterm>
  163. </listitem>
  164. </varlistentry>
  165. <varlistentry id="chattr">
  166. <term><command>chattr</command></term>
  167. <listitem>
  168. <para>在 <systemitem class="filesystem">ext2</systemitem>
  169. 文件系统上修改文件属性,也适用于
  170. <systemitem class="filesystem">ext3</systemitem> 文件系统,
  171. 即<systemitem class="filesystem">ext2</systemitem>
  172. 文件系统的日志版本</para>
  173. <indexterm zone="ch-system-e2fsprogs chattr">
  174. <primary sortas="b-chattr">chattr</primary>
  175. </indexterm>
  176. </listitem>
  177. </varlistentry>
  178. <varlistentry id="compile_et">
  179. <term><command>compile_et</command></term>
  180. <listitem>
  181. <para>一个错误表编译器;
  182. 它将包含错误编号名称和消息的表转化成 C 源代码,以和
  183. <filename class="libraryfile">com_err</filename>
  184. 库一起使用</para>
  185. <indexterm zone="ch-system-e2fsprogs compile_et">
  186. <primary sortas="b-compile_et">compile_et</primary>
  187. </indexterm>
  188. </listitem>
  189. </varlistentry>
  190. <varlistentry id="debugfs">
  191. <term><command>debugfs</command></term>
  192. <listitem>
  193. <para>一个文件系统调试器;可以检验并修改
  194. <systemitem class="filesystem">ext2</systemitem>
  195. 文件系统的状态</para>
  196. <indexterm zone="ch-system-e2fsprogs debugfs">
  197. <primary sortas="b-debugfs">debugfs</primary>
  198. </indexterm>
  199. </listitem>
  200. </varlistentry>
  201. <varlistentry id="dumpe2fs">
  202. <term><command>dumpe2fs</command></term>
  203. <listitem>
  204. <para>打印给定设备上文件系统的超级块和块组信息</para>
  205. <indexterm zone="ch-system-e2fsprogs dumpe2fs">
  206. <primary sortas="b-dumpe2fs">dumpe2fs</primary>
  207. </indexterm>
  208. </listitem>
  209. </varlistentry>
  210. <varlistentry id="e2freefrag">
  211. <term><command>e2freefrag</command></term>
  212. <listitem>
  213. <para>报告可用空间碎片信息</para>
  214. <indexterm zone="ch-system-e2fsprogs e2freefrag">
  215. <primary sortas="b-e2freefrag">e2freefrag</primary>
  216. </indexterm>
  217. </listitem>
  218. </varlistentry>
  219. <varlistentry id="e2fsck">
  220. <term><command>e2fsck</command></term>
  221. <listitem>
  222. <para>用于检查或修复 <systemitem
  223. class="filesystem">ext2</systemitem> 文件系统和 <systemitem
  224. class="filesystem">ext3</systemitem> 文件系统</para>
  225. <indexterm zone="ch-system-e2fsprogs e2fsck">
  226. <primary sortas="b-e2fsck">e2fsck</primary>
  227. </indexterm>
  228. </listitem>
  229. </varlistentry>
  230. <varlistentry id="e2image">
  231. <term><command>e2image</command></term>
  232. <listitem>
  233. <para>用于将 <systemitem
  234. class="filesystem">ext2</systemitem> 文件系统关键数据保存到文件
  235. </para>
  236. <indexterm zone="ch-system-e2fsprogs e2image">
  237. <primary sortas="b-e2image">e2image</primary>
  238. </indexterm>
  239. </listitem>
  240. </varlistentry>
  241. <varlistentry id="e2label">
  242. <term><command>e2label</command></term>
  243. <listitem>
  244. <para>显示或修改给定设备上的 <systemitem
  245. class="filesystem">ext2</systemitem> 文件系统标签</para>
  246. <indexterm zone="ch-system-e2fsprogs e2label">
  247. <primary sortas="b-e2label">e2label</primary>
  248. </indexterm>
  249. </listitem>
  250. </varlistentry>
  251. <varlistentry id="e2undo">
  252. <term><command>e2undo</command></term>
  253. <listitem>
  254. <para>重放设备上找到的 ext2/ext3/ext4 文件系统撤销日志 undo_log
  255. [可以用于撤销 e2fsprogs 程序的失败操作。]</para>
  256. <indexterm zone="ch-system-e2fsprogs e2undo">
  257. <primary sortas="b-e2undo">e2undo</primary>
  258. </indexterm>
  259. </listitem>
  260. </varlistentry>
  261. <varlistentry id="e4defrag">
  262. <term><command>e4defrag</command></term>
  263. <listitem>
  264. <para>ext4 文件系统在线碎片整理器</para>
  265. <indexterm zone="ch-system-e2fsprogs e4defrag">
  266. <primary sortas="b-e4defrag">e4defrag</primary>
  267. </indexterm>
  268. </listitem>
  269. </varlistentry>
  270. <varlistentry id="filefrag">
  271. <term><command>filefrag</command></term>
  272. <listitem>
  273. <para>报告特定文件碎片化程度</para>
  274. <indexterm zone="ch-system-e2fsprogs filefrag">
  275. <primary sortas="b-filefrag">filefrag</primary>
  276. </indexterm>
  277. </listitem>
  278. </varlistentry>
  279. <varlistentry id="fsck.ext2">
  280. <term><command>fsck.ext2</command></term>
  281. <listitem>
  282. <para>默认情况下检查
  283. <systemitem class="filesystem">ext2</systemitem> 文件系统,
  284. 是 <command>e2fsck</command> 的硬链接</para>
  285. <indexterm zone="ch-system-e2fsprogs fsck.ext2">
  286. <primary sortas="b-fsck.ext2">fsck.ext2</primary>
  287. </indexterm>
  288. </listitem>
  289. </varlistentry>
  290. <varlistentry id="fsck.ext3">
  291. <term><command>fsck.ext3</command></term>
  292. <listitem>
  293. <para>默认情况下检查
  294. <systemitem class="filesystem">ext3</systemitem> 文件系统,
  295. 是 <command>e2fsck</command> 的硬链接</para>
  296. <indexterm zone="ch-system-e2fsprogs fsck.ext3">
  297. <primary sortas="b-fsck.ext3">fsck.ext3</primary>
  298. </indexterm>
  299. </listitem>
  300. </varlistentry>
  301. <varlistentry id="fsck.ext4">
  302. <term><command>fsck.ext4</command></term>
  303. <listitem>
  304. <para>默认情况下检查
  305. <systemitem class="filesystem">ext4</systemitem> 文件系统,
  306. 是 <command>e2fsck</command> 的硬链接</para>
  307. <indexterm zone="ch-system-e2fsprogs fsck.ext4">
  308. <primary sortas="b-fsck.ext4">fsck.ext4</primary>
  309. </indexterm>
  310. </listitem>
  311. </varlistentry>
  312. <varlistentry id="fsck.ext4dev">
  313. <term><command>fsck.ext4dev</command></term>
  314. <listitem>
  315. <para>默认情况下检查
  316. <systemitem class="filesystem">ext4</systemitem>
  317. 开发版文件系统,是 <command>e2fsck</command> 的硬链接</para>
  318. <indexterm zone="ch-system-e2fsprogs fsck.ext4dev">
  319. <primary sortas="b-fsck.ext4dev">fsck.ext4dev</primary>
  320. </indexterm>
  321. </listitem>
  322. </varlistentry>
  323. <varlistentry id="logsave">
  324. <term><command>logsave</command></term>
  325. <listitem>
  326. <para>将命令输出保存到日志文件</para>
  327. <indexterm zone="ch-system-e2fsprogs logsave">
  328. <primary sortas="b-logsave">logsave</primary>
  329. </indexterm>
  330. </listitem>
  331. </varlistentry>
  332. <varlistentry id="lsattr">
  333. <term><command>lsattr</command></term>
  334. <listitem>
  335. <para>列出 ext2 文件系统上的文件属性</para>
  336. <indexterm zone="ch-system-e2fsprogs lsattr">
  337. <primary sortas="b-lsattr">lsattr</primary>
  338. </indexterm>
  339. </listitem>
  340. </varlistentry>
  341. <varlistentry id="mk_cmds">
  342. <term><command>mk_cmds</command></term>
  343. <listitem>
  344. <para>将包含命令名称和帮助信息的表格转换成 C 源代码文件,以便和
  345. <filename class="libraryfile">libss</filename>
  346. 子系统库一起使用</para>
  347. <indexterm zone="ch-system-e2fsprogs mk_cmds">
  348. <primary sortas="b-mk_cmds">mk_cmds</primary>
  349. </indexterm>
  350. </listitem>
  351. </varlistentry>
  352. <varlistentry id="mke2fs">
  353. <term><command>mke2fs</command></term>
  354. <listitem>
  355. <para>在给定设备上创建
  356. <systemitem class="filesystem">ext2</systemitem> 或
  357. <systemitem class="filesystem">ext3</systemitem> 文件系统
  358. </para>
  359. <indexterm zone="ch-system-e2fsprogs mke2fs">
  360. <primary sortas="b-mke2fs">mke2fs</primary>
  361. </indexterm>
  362. </listitem>
  363. </varlistentry>
  364. <varlistentry id="mkfs.ext2">
  365. <term><command>mkfs.ext2</command></term>
  366. <listitem>
  367. <para>默认情况下创建
  368. <systemitem class="filesystem">ext2</systemitem> 文件系统,
  369. 是 <command>mke2fs</command> 的硬链接</para>
  370. <indexterm zone="ch-system-e2fsprogs mkfs.ext2">
  371. <primary sortas="b-mkfs.ext2">mkfs.ext2</primary>
  372. </indexterm>
  373. </listitem>
  374. </varlistentry>
  375. <varlistentry id="mkfs.ext3">
  376. <term><command>mkfs.ext3</command></term>
  377. <listitem>
  378. <para>默认情况下创建
  379. <systemitem class="filesystem">ext3</systemitem> 文件系统,
  380. 是 <command>mke2fs</command> 的硬链接</para>
  381. <indexterm zone="ch-system-e2fsprogs mkfs.ext3">
  382. <primary sortas="b-mkfs.ext3">mkfs.ext3</primary>
  383. </indexterm>
  384. </listitem>
  385. </varlistentry>
  386. <varlistentry id="mkfs.ext4">
  387. <term><command>mkfs.ext4</command></term>
  388. <listitem>
  389. <para>默认情况下创建
  390. <systemitem class="filesystem">ext4</systemitem> 文件系统,
  391. 是 <command>mke2fs</command> 的硬链接</para>
  392. <indexterm zone="ch-system-e2fsprogs mkfs.ext4">
  393. <primary sortas="b-mkfs.ext4">mkfs.ext4</primary>
  394. </indexterm>
  395. </listitem>
  396. </varlistentry>
  397. <varlistentry id="mkfs.ext4dev">
  398. <term><command>mkfs.ext4dev</command></term>
  399. <listitem>
  400. <para>默认情况下创建
  401. <systemitem class="filesystem">ext4</systemitem>
  402. 开发版文件系统,是 <command>mke2fs</command> 的硬链接</para>
  403. <indexterm zone="ch-system-e2fsprogs mkfs.ext4dev">
  404. <primary sortas="b-mkfs.ext4dev">mkfs.ext4dev</primary>
  405. </indexterm>
  406. </listitem>
  407. </varlistentry>
  408. <varlistentry id="mklost-found">
  409. <term><command>mklost+found</command></term>
  410. <listitem>
  411. <para>用于在 <systemitem class="filesystem">ext2</systemitem>
  412. 文件系统上创建 <filename class="directory">lost+found</filename>
  413. 目录; 它为该目录预先分配磁盘块,以减轻 e2fsck 的负担</para>
  414. <indexterm zone="ch-system-e2fsprogs mklost-found">
  415. <primary sortas="b-mklost+found">mklost+found</primary>
  416. </indexterm>
  417. </listitem>
  418. </varlistentry>
  419. <varlistentry id="resize2fs">
  420. <term><command>resize2fs</command></term>
  421. <listitem>
  422. <para>可以用于扩大或压缩 <systemitem
  423. class="filesystem">ext2</systemitem> 文件系统</para>
  424. <indexterm zone="ch-system-e2fsprogs resize2fs">
  425. <primary sortas="b-resize2fs">resize2fs</primary>
  426. </indexterm>
  427. </listitem>
  428. </varlistentry>
  429. <varlistentry id="tune2fs">
  430. <term><command>tune2fs</command></term>
  431. <listitem>
  432. <para>调整 <systemitem
  433. class="filesystem">ext2</systemitem> 文件系统的可调参数</para>
  434. <indexterm zone="ch-system-e2fsprogs tune2fs">
  435. <primary sortas="b-tune2fs">tune2fs</primary>
  436. </indexterm>
  437. </listitem>
  438. </varlistentry>
  439. <varlistentry id="libcom_err">
  440. <term><filename class="libraryfile">libcom_err</filename></term>
  441. <listitem>
  442. <para>公用错误显示子程序</para>
  443. <indexterm zone="ch-system-e2fsprogs libcom_err">
  444. <primary sortas="c-libcom_err">libcom_err</primary>
  445. </indexterm>
  446. </listitem>
  447. </varlistentry>
  448. <varlistentry id="libe2p">
  449. <term><filename class="libraryfile">libe2p</filename></term>
  450. <listitem>
  451. <para>被 <command>dumpe2fs</command>、<command>chattr</command>,
  452. 和 <command>lsattr</command> 使用</para>
  453. <indexterm zone="ch-system-e2fsprogs libe2p">
  454. <primary sortas="c-libe2p">libe2p</primary>
  455. </indexterm>
  456. </listitem>
  457. </varlistentry>
  458. <varlistentry id="libext2fs">
  459. <term><filename class="libraryfile">libext2fs</filename></term>
  460. <listitem>
  461. <para>包含允许用户级程序操纵
  462. <systemitem class="filesystem">ext2</systemitem>
  463. 文件系统的子程序</para>
  464. <indexterm zone="ch-system-e2fsprogs libext2fs">
  465. <primary sortas="c-libext2fs">libext2fs</primary>
  466. </indexterm>
  467. </listitem>
  468. </varlistentry>
  469. <varlistentry id="libss">
  470. <term><filename class="libraryfile">libss</filename></term>
  471. <listitem>
  472. <para>被 <command>debugfs</command> 使用</para>
  473. <indexterm zone="ch-system-e2fsprogs libss">
  474. <primary sortas="c-libss">libss</primary>
  475. </indexterm>
  476. </listitem>
  477. </varlistentry>
  478. </variablelist>
  479. </sect2>
  480. </sect1>