fdisk 磁盘分区命令
實例一、查看整塊磁盤分區(qū)狀況
[root@localhost ~]# fdisk -l
Disk /dev/hdc: 40.0 GB, 40020664320 bytes
16 heads, 63 sectors/track, 77545 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
? ?Device Boot ? ? ?Start ? ? ? ? End ? ? ?Blocks ? Id ?System
/dev/hdc1 ? * ? ? ? ? ? 1 ? ? ? ? 203 ? ? ?102280+ ?83 ?Linux
/dev/hdc2 ? ? ? ? ? ? 204 ? ? ? 77545 ? ?38980368 ? 8e ?Linux LVM
實例二、查看指定分區(qū)使用狀況
[root@localhost ~]# fdisk -l /dev/hdc1
Disk /dev/hdc1: 104 MB, 104735232 bytes
16 heads, 63 sectors/track, 202 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Disk /dev/hdc1 doesn't contain a valid partition table
================以下對磁盤進行分區(qū)操作=======================
一、對磁盤/dev/hdc分區(qū)
[root@localhost ~]# fdisk /dev/hdc
The number of cylinders for this disk is set to 77545.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
? ?(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help):
#?Command (m for help): 提示鍵入m獲取幫助菜單
二、fdisk幫助菜單
Command (m for help): m
Command action
? ?a ? toggle a bootable flag
? ?b ? edit bsd disklabel
? ?c ? toggle the dos compatibility flag
? ?d ? delete a partition ?# 刪除一個分區(qū)
? ?l ? list known partition types ?# 列出支持的分區(qū)格式
? ?m ? print this menu ?# 幫助菜單
? ?n ? add a new partition ?# 增加一個新的分區(qū)
? ?o ? create a new empty DOS partition table
? ?p ? print the partition table ?# 列出分區(qū)表
? ?q ? quit without saving changes ?# 退出不保存
? ?s ? create a new empty Sun disklabel ?
? ?t ? change a partition's system id ?# 更改分區(qū)ID
? ?u ? change display/entry units
? ?v ? verify the partition table
? ?w ? write table to disk and exit ?# 保存分區(qū)操作
? ?x ? extra functionality (experts only)
三、開始分區(qū)
[root@localhost ~]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x8c86b73c.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
? ? ? ? ?switch off the mode (command 'c') and change display units to
? ? ? ? ?sectors (command 'u').
Command (m for help): n
Command action
? ?e ? extended
? ?p ? primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-130, default 1): 1
Last cylinder, +cylinders or +size{K,M,G} (1-130, default 130): +100M
Command (m for help):
四、各選項注釋
? ?e ? extended
擴展分區(qū)
? ?p ? primary partition (1-4)
主分區(qū)
Partition number (1-4):?
分區(qū)號,1-4
First cylinder (1-130, default 1):?
起始柱
Last cylinder, +cylinders or +size{K,M,G} (1-130, default 130):?
分區(qū)大小
五、分區(qū)完成后會返回命令提示符
Command (m for help):
此時鍵入m即進入幫助菜單
鍵入w即保存分區(qū)操作,如不保存分區(qū)操作直接q退出,則視為放棄當(dāng)前分區(qū)操作
轉(zhuǎn)載于:https://blog.51cto.com/hhx012/1726077
總結(jié)
以上是生活随笔為你收集整理的fdisk 磁盘分区命令的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Swift版音乐播放器(简化版),swi
- 下一篇: php SqlServer 中文汉字乱码