Linux 系统学习 之 fdisk命令

本文介绍了Linux系统中磁盘分区的重要性和常见的分区方案。详细解释了fdisk、cfdisk和parted等磁盘管理工具的使用方法,并讨论了BIOS对硬盘访问的限制以及如何合理规划分区。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

http://fedora.linuxsir.org/main/?q=node/41
df 是来自于coreutils 软件包,系统安装时,就自带的;我们通过这个命令可以查看磁盘的使用情况以及文件系统被挂载的位置
fdisk 是一款强大的磁盘操作工具,来自util-linux软件包,我们在这里只说他如何查看磁盘分区表及分区结构;参数 -l ,通过-l 参数,能获得机器中所有的硬盘的分区情况
我们也可以指定fdisk -l 来查看其中一个硬盘的分区情况
还有 cfdisk、parted也是磁盘操作工具
查看目前机器中的所有磁盘及分区情况 cat /proc/partitions

--------------------------------------------------------------------------
fdisk手册:

Linux needs at least one partition, namely for its root file system.  It can use swap files  and/or  swap partitions,  but  the latter are more efficient. So, usually one will want a second Linux partition dedicated as swap partition.  On Intel compatible hardware, the BIOS that boots the  system  can  often  only access  the  first  1024  cylinders  of the disk.  For this reason people with large disks often create a third partition, just a few MB large, typically mounted on /boot, to store the kernel  image  and  few auxiliary files needed at boot time, so as to make sure that this stuff is accessible to the BIOS.  There may be reasons of security, ease of administration and backup, or testing, to use more than  the  minimum number of partitions.
(linux需要至少一个分区,即root文件系统。可以使用交换文件或者交换分区,但是后者的效率更好。所以经常需要另外一个分区,即交换分区。在intel的硬件上,BIOS通常只能读写硬盘的前1024柱面,所以,拥有大硬盘的人,经常创建第三个分区,挂载在boot上,用来存放内核映像和其他一些辅助启动的文件。为了安全、便于管理与备份、测试,人们经常使用多个分区。)

The device is usually one of the following:
              /dev/hda
              /dev/hdb
              /dev/sda
              /dev/sdb
(/dev/hd[a-h] for IDE disks, /dev/sda for SCSI disks, /dev/ed[a-d] for ESDI disks, /dev/xd[ab] for XT disks).  A device name refers to the entire disk.

-----------------------------------------------------------------
fdisk实践:

为了练习,先在u盘上进行操作。root用户。
cd /sbin
./fdisk -l


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值