Linuxfdisk命令使用教程与实例详解
时间:2025-06-30
浏览:406
作者:佚名
本篇文章给大家分享《Linux磁盘分区表操作:fdisk命令详解与实例》,覆盖了文章的常见基础知识,其实一个语言的全部知识点一篇文章是不可能说完的,但希望通过这些问题,让读者对自己的掌握程度有一定的认识(B 数),从而弥补自己的不足,更好的掌握它。

Linux fdisk 工具
fdisk 是 Linux 系统中用于创建和管理分区表的实用程序,支持 DOS 类型的分区表、BSD 或 SUN 类型的磁盘列表。
语法格式
fdisk [必需参数][可选参数]必需参数:
- -l 列出所有分区信息
- -u 搭配 -l 使用,显示分区数量
可选参数:
- -s 指定具体分区
- -v 显示版本信息
交互菜单功能说明
- m :查看菜单及帮助内容
- a :激活或取消引导分区
- d :删除已有分区
- l :列出可用的分区类型
- n :新建一个分区
- p :打印当前分区详情
- q :退出且不保存更改
- t :修改分区标识
- v :验证分区表完整性
- w :保存并写入更改
- x :扩展功能选项,适用于高级操作
示例演示
查看当前系统分区状态:
# fdisk -l
Disk /dev/sda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 1305 10377990 8e Linux LVM
Disk /dev/sdb: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk /dev/sdb doesn't contain a valid partition table
展示 SCSI 磁盘各分区详细信息:
# fdisk -lu Disk /dev/sda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders, total 20971520 sectors
Units = sectors of 1 * 512 = 512 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 63 208844 104391 83 Linux
/dev/sda2 208845 20964824 10377990 8e Linux LVM
Disk /dev/sdb: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 cylinders, total 10485760 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk /dev/sdb doesn't contain a valid partition table
理论要掌握,实操不能落!以上关于《Linuxfdisk命令使用教程与实例详解》的详细介绍,大家都掌握了吧!如果想要继续提升自己的能力,那么就来关注golang学习网公众号吧!
本文内容来源于互联网,如有侵权请联系删除。
近期热门
站内热门
最新文章
热门专题
