码迷,mamicode.com
首页 > 系统相关 > 详细

linux使用fdisk添加分区的例子

时间:2015-07-14 20:47:47      阅读:149      评论:0      收藏:0      [点我收藏+]

标签:default   linux   primary   number   

使用fdisk添加分区的例子;

本例中我们会添加两个200M的主分区,其它为扩展分区,在扩展分区中我们添加两个200M大小的逻辑分区

Command (m for help): p 注:列出分区表;
Disk /dev/sda: 1035 MB, 1035730944 bytes
256 heads, 63 sectors/track, 125 cylinders
Units = cylinders of 16128 * 512 = 8257536 bytes
Device Boot Start End Blocks Id System
Command (m for help): n 注:添加分区;
Command action
e extended
p primary partition (1-4)
p 注:添加主分区;

Partition number (1-4): 1 注:添加主分区1;
First cylinder (1-125, default 1): 注:直接回车,主分区1的起始位置;默认为1,默认就好;
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-125, default 125): +200M 注:指定分区大小,用+200M来指定大小为200M
Command (m for help): n 注:添加新分区;
Command action
e extended
p primary partition (1-4)
p 注:添加主分区

Partition number (1-4): 2 注:添加主分区2;
First cylinder (26-125, default 26):
Using default value 26
Last cylinder or +size or +sizeM or +sizeK (26-125, default 125): +200M 注:指定分区大小,用+200M来指定大小为200M
Command (m for help): n
Command action
e extended
p primary partition (1-4)
e 注:添加扩展分区;
Partition number (1-4): 3 注:指定为3 ,因为主分区已经分了两个了,这个也算主分区,从3开始;
First cylinder (51-125, default 51): 注:直接回车;
Using default value 51
Last cylinder or +size or +sizeM or +sizeK (51-125, default 125): 注:直接回车,把其余的所有空间都给扩展分区;
Using default value 125
Command (m for help): p
Disk /dev/sda: 1035 MB, 1035730944 bytes
256 heads, 63 sectors/track, 125 cylinders
Units = cylinders of 16128 * 512 = 8257536 bytes
Device Boot Start End Blocks Id System
/dev/sda1 1 25 201568+ 83 Linux
/dev/sda2 26 50 201600 83 Linux
/dev/sda3 51 125 604800 5 Extended
Command (m for help): n
Command action
l logical (5 or over)
p primary partition (1-4)
l 注:添加逻辑分区;
First cylinder (51-125, default 51):
Using default value 51
Last cylinder or +size or +sizeM or +sizeK (51-125, default 125): +200M 注:添加一个大小为200M大小的分区;
Command (m for help): n
Command action
l logical (5 or over)
p primary partition (1-4)
l 注:添加一个逻辑分区;
First cylinder (76-125, default 76):
Using default value 76
Last cylinder or +size or +sizeM or +sizeK (76-125, default 125): +200M 注:添加一个大小为200M大小的分区;
Command (m for help): p 列出分区表;
Disk /dev/sda: 1035 MB, 1035730944 bytes
256 heads, 63 sectors/track, 125 cylinders
Units = cylinders of 16128 * 512 = 8257536 bytes
Device Boot Start End Blocks Id System


然后我们根据前面所说通过t指令来改变分区类型;

最后不要忘记w保存退出

本文出自 “rain” 博客,请务必保留此出处http://gushiren.blog.51cto.com/3392832/1674050

linux使用fdisk添加分区的例子

标签:default   linux   primary   number   

原文地址:http://gushiren.blog.51cto.com/3392832/1674050

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!