编程问答
fdisk 磁盘分区命令 -凯发ag旗舰厅登录网址下载
实例一、查看整块磁盘分区状况
[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
实例二、查看指定分区使用状况
[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
================以下对磁盘进行分区操作=======================
一、对磁盘/dev/hdc分区
[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 # 删除一个分区
l list known partition types # 列出支持的分区格式
m print this menu # 帮助菜单
n add a new partition # 增加一个新的分区
o create a new empty dos partition table
p print the partition table # 列出分区表
q quit without saving changes # 退出不保存
s create a new empty sun disklabel
t change a partition's system id # 更改分区id
u change display/entry units
v verify the partition table
w write table to disk and exit # 保存分区操作
x extra functionality (experts only)
三、开始分区
[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
扩展分区
p primary partition (1-4)
主分区
partition number (1-4):
分区号,1-4
first cylinder (1-130, default 1):
起始柱
last cylinder, cylinders or size{k,m,g} (1-130, default 130):
分区大小
五、分区完成后会返回命令提示符
command (m for help):
此时键入m即进入帮助菜单
键入w即保存分区操作,如不保存分区操作直接q退出,则视为放弃当前分区操作
转载于:https://blog.51cto.com/hhx012/1726077
总结
以上是凯发ag旗舰厅登录网址下载为你收集整理的fdisk 磁盘分区命令的全部内容,希望文章能够帮你解决所遇到的问题。
如果觉得凯发ag旗舰厅登录网址下载网站内容还不错,欢迎将凯发ag旗舰厅登录网址下载推荐给好友。
- 上一篇:
- 下一篇: php sqlserver 中文汉字乱码