📄 实例解说 fdisk 使用方法 linuxsir_org.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<!-- saved from url=(0039)http://www.linuxsir.org/main/?q=node/81 -->
<HTML lang=zh-hans xml:lang="zh-hans"
xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>实例解说 fdisk 使用方法 | LinuxSir.Org</TITLE>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<STYLE type=text/css media=all>@import url( misc/drupal.css );
</STYLE>
<STYLE type=text/css media=all>@import url( modules/taxonomy_context/taxonomy_context.css );
</STYLE>
<LINK media=screen
href="实例解说 fdisk 使用方法 LinuxSir_Org.files/menuExpandable3.css" type=text/css
rel=stylesheet>
<SCRIPT src="实例解说 fdisk 使用方法 LinuxSir_Org.files/menuExpandable3.js"
type=text/javascript></SCRIPT>
<LINK href="实例解说 fdisk 使用方法 LinuxSir_Org.files/common.css" type=text/css
rel=stylesheet>
<STYLE type=text/css media=all>@import url( themes/chameleon/marvin/style.css );
</STYLE>
<META content="MSHTML 6.00.2900.2180" name=GENERATOR></HEAD>
<BODY>
<DIV id=header><A title=Home href="http://www.linuxsir.org/main/"><IMG alt=Home
src="实例解说 fdisk 使用方法 LinuxSir_Org.files/logo.jpg"></A></DIV>
<DIV class=navlinks>
<DIV class=primary><A href="http://www.linuxsir.org/main/?q"><FONT
color=white>首页</FONT></A> | <A
href="http://www.linuxsir.org/main/?q=taxonomy/term/34"><FONT
color=white>事件</FONT></A> | <A
href="http://www.linuxsir.org/main/?q=taxonomy/term/1/25/"><FONT
color=white>文档</FONT></A> | <A
href="http://www.linuxsir.org/main/?q=taxonomy/term/35/48/"><FONT
color=white>资源</FONT></A> | <A
href="http://www.linuxsir.org/main/?q=search"><FONT color=white>搜索</FONT></A> |
<A href="http://www.linuxsir.org/bbs"><FONT color=white>论坛</FONT></A> | <A
href="http://www.linuxsir.org/main/?q=taxonomy/term/38"><FONT
color=white>贡献者</FONT></A> | <A
href="http://www.linuxsir.org/main/?q=node/3"><FONT color=white>关于</FONT></A> |
<A href="http://www.linuxsir.org/main/?q=user"><FONT
color=white>注册/登录</FONT></A></DIV></DIV>
<TABLE id=content>
<TBODY>
<TR>
<TD id=sidebar-left>
<DIV class="block block-block" id=block-block-1>
<H2 class=title>子站索引</H2>
<DIV class=content>
<UL>
<LI><A href="http://fedora.linuxsir.org/" target?_blank?>Fedora中文</A>
<LI><A href="http://debian.linuxsir.org/" target?_blank?>Debian中文</A>
<LI><A href="http://lfs.linuxsir.org/" target?_blank?>LFS 中文</A>
<LI><A href="http://slack.linuxsir.org/">Slackware</A>
<LI><A href="http://gentoo.linuxsir.org/">Gentoo中文</A>
<LI><A href="http://arch.linuxsir.org/">Arch 中文</A> </LI></UL></DIV></DIV>
<DIV class="block block-block" id=block-block-3>
<H2 class=title>重要资讯</H2>
<DIV class=content>
<UL>
<LI><A href="http://www.linuxsir.org/main/?q=taxonomy/term/36">本站公告</A>
<LI><A href="http://www.linuxsir.org/main/?q=taxonomy/term/34">新闻事件</A>
<LI><A href="http://www.linuxsir.org/bbs" target=_blank>本站论坛</A>
<LI><A href="http://www.linuxsir.org/main/?q=taxonomy/term/38">贡 献 者</A>
</LI></UL></DIV></DIV>
<DIV class="block block-block" id=block-block-7>
<H2 class=title>项目索引</H2>
<DIV class=content>
<UL>
<LI><A href="http://www.fcitx.org/" target=_blank>小企鹅输入法</A>
<LI><A href="http://lumaqq.linuxsir.org/" target=_blank>LumaQQ</A>
<LI><A href="http://openq.linuxsir.org/" target=_blank>OpenQ</A>
<LI><A href="http://www.relaxbsd.org/" target=_blank>RelaxBSD</A>
</LI></UL></DIV></DIV>
<DIV class="block block-user" id=block-user-1>
<H2 class=title>站点导航</H2>
<DIV class=content>
<DIV class=menu>
<UL>
<LI class=leaf><A title=注册/登录
href="http://www.linuxsir.org/main/?q=user">注册/登录</A>
<LI class=collapsed><A
href="http://www.linuxsir.org/main/?q=aggregator">新闻聚合</A>
</LI></UL></DIV></DIV></DIV>
<DIV class="block block-aggregator" id=block-aggregator-feed-2>
<H2 class=title>LinuxSir.Org 论坛</H2>
<DIV class=content>
<DIV class=item-list>
<UL>
<LI><A
href="http://www.linuxsir.org/bbs/showthread.php?t=266922&goto=newpost">如何在FvwmButtons中使用系统托盘?</A>
<LI><A
href="http://www.linuxsir.org/bbs/showthread.php?t=266921&goto=newpost">FC5
root 的垃圾箱被彻底删掉了,怎么恢复?</A>
<LI><A
href="http://www.linuxsir.org/bbs/showthread.php?t=266920&goto=newpost">我想做一个mini
linux 该怎么下手呢~</A>
<LI><A
href="http://www.linuxsir.org/bbs/showthread.php?t=266919&goto=newpost">FC5体验之影音篇</A>
<LI><A
href="http://www.linuxsir.org/bbs/showthread.php?t=266918&goto=newpost">请教高手:FEDORA
4 安装问题</A> </LI></UL></DIV>
<DIV class=more-link><A title=查看此feed的最新消息
href="http://www.linuxsir.org/main/?q=aggregator/sources/2">更多</A></DIV></DIV></DIV>
<DIV class="block block-user" id=block-user-2>
<H2 class=title>最新注册</H2>
<DIV class=content>
<DIV class=item-list>
<UL>
<LI>horiwa
<LI>jiechu
<LI>emiss
<LI>ismart
<LI>mynamewsy</LI></UL></DIV></DIV></DIV>
<DIV class="block block-user" id=block-user-3>
<H2 class=title>当前在线</H2>
<DIV class=content>0 users 和 93 游客 在线</DIV></DIV></TD>
<TD id=main>
<DIV class=breadcrumb><A href="http://www.linuxsir.org/main/?q=">首页</A> »
<A href="http://www.linuxsir.org/main/?q=taxonomy/term/1">Linux</A></DIV>
<H2>实例解说 fdisk 使用方法</H2><!-- begin content -->
<DIV class=node>
<DIV class=content>
<P><B>作者:</B>北南南北<BR><B>来自:</B>LinuxSir.Org<BR><B>提要:</B>fdisk
是一款功能强大的分区工具,也是目前在Unix类操作系统中最流行的工具之一;分区工具老字号;本篇只介绍其最简单的分区操作功能;</P>
<P><FONT size=4><B><BR>一、fdisk 的介绍;<BR></B></FONT></P>
<P><B>fdisk - Partition table manipulator for Linux</B>
,译成中文的意思是磁盘分区表操作工具;本人译的不太好,也没有看中文文档;其实就是分区工具;</P>
<P>fdsik 能划分磁盘成为若干个区,同时也能为每个分区指定分区的文件系统,比如linux 、fat32、 linux 、linux swap
、fat16 以及其实类Unix类操作系统的文件系统等;当然我们用fdisk
对磁盘操作分区时,并不是一个终点,我们还要对分区进行格式化所需要的文件系统;这样一个分区才能使用;这和DOS中的fdisk 是类似的;</P>
<P><FONT
size=4><B><BR>二、合理规划您的硬盘分区;<BR></B></FONT><BR>在操作分区之前,我们要明白硬盘分区一点理论,比如硬盘容量和分区大小的计算;对一个硬盘如何规划分区等,请参考如下文档,谢谢;</P>
<P><A href="http://www.linuxsir.org/main/?q=node/80">《合理规划您的硬盘分区》</A> </P>
<P><FONT size=4><B><BR>三、fdisk -l 查看硬盘及分区信息;<BR></B></FONT></P>
<P>通过<A href="http://www.linuxsir.org/main/?q=node/80">《合理规划您的硬盘分区》</A>
,我们知道主分区(包括扩展分区)的总个数不能超过四个;也不能把扩展分区包围在主分区之间;根据这个原则,我们划分硬盘分区就比较容易的多;也能为以后减少不必要的麻烦;</P>
<P><FONT size=3><B><BR>1、通过fdisk -l 查看机器所挂硬盘个数及分区情况;<BR></B></FONT></P>
<P>
<DIV class=codeblock><CODE>[root@localhost beinan]# fdisk -l<BR>Disk
/dev/hda: 80.0 GB, 80026361856 bytes<BR>255 heads, 63 sectors/track, 9729
cylinders<BR>Units = cylinders of 16065 * 512 = 8225280
bytes<BR> Device Boot Start End Blocks Id
System<BR>/dev/hda1 * 1 765 6144831 7 HPFS/NTFS<BR>/dev/hda2 766 2805
16386300 c W95 FAT32 (LBA)<BR>/dev/hda3 2806 9729 55617030 5
Extended<BR>/dev/hda5 2806 3825 8193118+ 83 Linux<BR>/dev/hda6 3826 5100
10241406 83 Linux<BR>/dev/hda7 5101 5198 787153+ 82 Linux swap /
Solaris<BR>/dev/hda8 5199 6657 11719386 83 Linux<BR>/dev/hda9 6658 7751
8787523+ 83 Linux<BR>/dev/hda10 7752 9729 15888253+ 83 Linux<BR>Disk
/dev/sda: 1035 MB, 1035730944 bytes<BR>256 heads, 63 sectors/track, 125
cylinders<BR>Units = cylinders of 16128 * 512 = 8257536
bytes<BR> Device Boot Start End Blocks Id
System<BR>/dev/sda1 1 25 201568+ c W95 FAT32 (LBA)<BR>/dev/sda2 26 125
806400 5 Extended<BR>/dev/sda5 26 50 201568+ 83 Linux<BR>/dev/sda6 51 76
200781 83
Linux</CODE></DIV><BR><BR><BR>通过上面的信息,我们知道此机器中挂载两个硬盘(或移动硬盘),其中一个是hda
另一个是sda ;如果我们想查看单个硬盘情况,可以通过 fdisk -l /dev/hda1 或者fdisk -l /dev/sda1
来操作;以fdisk -l 输出的硬盘标识为准;
<P></P>
<P>其中 hda有三个主分区(包括扩展分区),分别是主分区 hda1 hda2 和hda3(扩展分区) ;逻辑分区是
hda5到hda10;<BR>其中 sda 有两个主分区(包括扩展分区),分别是 hda1 和hda2 (扩展分区);逻辑分区是 sda5 hda6
;</P>
<P>硬盘总容量=主分区(包括扩展分区)总容量<BR>扩展分区容量=逻辑分区总容量</P>
<P>通过上面的例子,我们可以得知 hda=hda1+hda2+hda3,其中hda3=hda5+hda6+hda7+hda8+hda9+hda10
... ...<BR><FONT size=3><B><BR>2、关于fdisk -l
一些数值的说明;<BR></B></FONT><BR><BR><BR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -