1.使用fdisk创建6个分区[1P+1E(5L)] //dev/sdb1 /dev/sdb5 /dev/sdb6 /dev/sdb7 /dev/sdb8 /deb/sdb9

--------------------------------------------------------------------
注:如果你对python感兴趣,我这有个学习Python基地,里面有很多学习资料,感兴趣的+Q群:895817687
--------------------------------------------------------------------1 [root@server ~]# fdisk -l2 3 Disk /dev/sda: 8589 MB, 8589934592 bytes4 255 heads, 63 sectors/track, 1044 cylinders5 Units = cylinders of 16065 * 512 = 8225280 bytes6 Sector size (logical/physical): 512 bytes / 512 bytes7 I/O size (minimum/optimal): 512 bytes / 512 bytes8 Disk identifier: 0x000aec729
10    Device Boot      Start         End      Blocks   Id  System
11 /dev/sda1   *           1          26      204800   83  Linux
12 Partition 1 does not end on cylinder boundary.
13 /dev/sda2              26          91      524288   82  Linux swap / Solaris
14 Partition 2 does not end on cylinder boundary.
15 /dev/sda3              91        1045     7658496   83  Linux
16
17 Disk /dev/sdb: 1073 MB, 1073741824 bytes
18 255 heads, 63 sectors/track, 130 cylinders
19 Units = cylinders of 16065 * 512 = 8225280 bytes
20 Sector size (logical/physical): 512 bytes / 512 bytes
21 I/O size (minimum/optimal): 512 bytes / 512 bytes
22 Disk identifier: 0x00000000

2.fdisk -cu /dev/sdb开始分区

1 [root@server ~]# fdisk -cu /dev/sdb   //-c:表示丢弃DOS兼容模式,切换到mode模式; -u:表示从柱面分区改为扇区分区
2 Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
3 Building a new DOS disklabel with disk identifier 0x94c5ab35.
4 Changes will remain in memory only, until you decide to write them.
5 After that, of course, the previous content won't be recoverable.
6
7 Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
8
9 Command (m for help):

3.输入m查看帮助

1 Command (m for help): m2 Command action3    a   toggle a bootable flag4    b   edit bsd disklabel5    c   toggle the dos compatibility flag6    d   delete a partition    //删除创建的分区7    l   list known partition types   //列出分区类型8    m   print this menu   //查看帮助9    n   add a new partition     //创建新分区
10    o   create a new empty DOS partition table
11    p   print the partition table   //打印分区表
12    q   quit without saving changes
13    s   create a new empty Sun disklabel
14    t   change a partition's system id
15    u   change display/entry units
16    v   verify the partition table
17    w   write table to disk and exit   //写入分区表保存
18    x   extra functionality (experts only)
19
20 Command (m for help):

4.分出一个10M的主分区

1 Command (m for help): n2 Command action3    e   extended    //代表扩展分区4    p   primary partition (1-4)   //代表主分区5 p     //选择p 主分区6 Partition number (1-4): 17 First sector (2048-2097151, default 2048):     //默认2048开始8 Using default value 20489 Last sector, +sectors or +size{K,M,G} (2048-2097151, default 2097151): +10M
10
11 Command (m for help): p
12
13 Disk /dev/sdb: 1073 MB, 1073741824 bytes
14 255 heads, 63 sectors/track, 130 cylinders, total 2097152 sectors
15 Units = sectors of 1 * 512 = 512 bytes
16 Sector size (logical/physical): 512 bytes / 512 bytes
17 I/O size (minimum/optimal): 512 bytes / 512 bytes
18 Disk identifier: 0x94c5ab35
19
20    Device Boot      Start         End      Blocks   Id  System
21 /dev/sdb1            2048       22527       10240   83  Linux

5.将剩余的空间全部分配给扩展分区

1 Command (m for help): n2 Command action3    e   extended4    p   primary partition (1-4)5 e6 Partition number (1-4): 2    //分区编号选择为27 First sector (22528-2097151, default 22528):   //默认缺省大小8 Using default value 225289 Last sector, +sectors or +size{K,M,G} (22528-2097151, default 2097151):     //默认缺省大小
10 Using default value 2097151
11
12 Command (m for help): p   //打印
13
14 Disk /dev/sdb: 1073 MB, 1073741824 bytes
15 255 heads, 63 sectors/track, 130 cylinders, total 2097152 sectors
16 Units = sectors of 1 * 512 = 512 bytes
17 Sector size (logical/physical): 512 bytes / 512 bytes
18 I/O size (minimum/optimal): 512 bytes / 512 bytes
19 Disk identifier: 0x94c5ab35
20
21    Device Boot      Start         End      Blocks   Id  System
22 /dev/sdb1            2048       22527       10240   83  Linux
23 /dev/sdb2           22528     2097151     1037312    5  Extended
24
25 Command (m for help): n

6.接着将扩展分区分成5个逻辑分区,首先创建第1个大小为10M的逻辑分区

1 Command (m for help): n2 Command action3    l   logical (5 or over)4    p   primary partition (1-4)5 l   //选择创建逻辑分区6 First sector (24576-2097151, default 24576):    //默认开始直接回车7 Using default value 245768 Last sector, +sectors or +size{K,M,G} (24576-2097151, default 2097151): +10M   //输入分区大小10M9
10 Command (m for help): p   //打印分区
11
12 Disk /dev/sdb: 1073 MB, 1073741824 bytes
13 255 heads, 63 sectors/track, 130 cylinders, total 2097152 sectors
14 Units = sectors of 1 * 512 = 512 bytes
15 Sector size (logical/physical): 512 bytes / 512 bytes
16 I/O size (minimum/optimal): 512 bytes / 512 bytes
17 Disk identifier: 0x94c5ab35
18
19    Device Boot      Start         End      Blocks   Id  System
20 /dev/sdb1            2048       22527       10240   83  Linux
21 /dev/sdb2           22528     2097151     1037312    5  Extended
22 /dev/sdb5           24576       45055       10240   83  Linux   //分区表从5开始,代表逻辑分区

7.接着创建扩展分区中第2个大小为10M的逻辑分区

1 Command (m for help): n2 Command action3    l   logical (5 or over)4    p   primary partition (1-4)5 l6 First sector (47104-2097151, default 47104): 7 Using default value 471048 Last sector, +sectors or +size{K,M,G} (47104-2097151, default 2097151): +10M9
10 Command (m for help): p
11
12 Disk /dev/sdb: 1073 MB, 1073741824 bytes
13 255 heads, 63 sectors/track, 130 cylinders, total 2097152 sectors
14 Units = sectors of 1 * 512 = 512 bytes
15 Sector size (logical/physical): 512 bytes / 512 bytes
16 I/O size (minimum/optimal): 512 bytes / 512 bytes
17 Disk identifier: 0x94c5ab35
18
19    Device Boot      Start         End      Blocks   Id  System
20 /dev/sdb1            2048       22527       10240   83  Linux
21 /dev/sdb2           22528     2097151     1037312    5  Extended
22 /dev/sdb5           24576       45055       10240   83  Linux
23 /dev/sdb6           47104       67583       10240   83  Linux

8.接着创建扩展分区中第3个大小为10M的逻辑分区

1 Command (m for help): n2 Command action3    l   logical (5 or over)4    p   primary partition (1-4)5 l6 First sector (69632-2097151, default 69632): 7 Using default value 696328 Supported: 10^N: KB (KiloByte), MB (MegaByte), GB (GigaByte)9             2^N: K  (KibiByte), M  (MebiByte), G  (GibiByte)
10 Last sector, +sectors or +size{K,M,G} (69632-2097151, default 2097151): =
11 Last sector, +sectors or +size{K,M,G} (69632-2097151, default 2097151): +10M
12
13 Command (m for help): p
14
15 Disk /dev/sdb: 1073 MB, 1073741824 bytes
16 255 heads, 63 sectors/track, 130 cylinders, total 2097152 sectors
17 Units = sectors of 1 * 512 = 512 bytes
18 Sector size (logical/physical): 512 bytes / 512 bytes
19 I/O size (minimum/optimal): 512 bytes / 512 bytes
20 Disk identifier: 0x94c5ab35
21
22    Device Boot      Start         End      Blocks   Id  System
23 /dev/sdb1            2048       22527       10240   83  Linux
24 /dev/sdb2           22528     2097151     1037312    5  Extended
25 /dev/sdb5           24576       45055       10240   83  Linux
26 /dev/sdb6           47104       67583       10240   83  Linux
27 /dev/sdb7           69632       90111       10240   83  Linux

9.接着创建扩展分区中第4个大小为10M的逻辑分区

1 Command (m for help): n2 Command action3    l   logical (5 or over)4    p   primary partition (1-4)5 l6 First sector (92160-2097151, default 92160): 7 Using default value 921608 Last sector, +sectors or +size{K,M,G} (92160-2097151, default 2097151): +10M9
10 Command (m for help): p
11
12 Disk /dev/sdb: 1073 MB, 1073741824 bytes
13 255 heads, 63 sectors/track, 130 cylinders, total 2097152 sectors
14 Units = sectors of 1 * 512 = 512 bytes
15 Sector size (logical/physical): 512 bytes / 512 bytes
16 I/O size (minimum/optimal): 512 bytes / 512 bytes
17 Disk identifier: 0x94c5ab35
18
19    Device Boot      Start         End      Blocks   Id  System
20 /dev/sdb1            2048       22527       10240   83  Linux
21 /dev/sdb2           22528     2097151     1037312    5  Extended
22 /dev/sdb5           24576       45055       10240   83  Linux
23 /dev/sdb6           47104       67583       10240   83  Linux
24 /dev/sdb7           69632       90111       10240   83  Linux
25 /dev/sdb8           92160      112639       10240   83  Linux

10.接着创建扩展分区中第5个逻辑分区,将剩余空间都分配

1 Command (m for help): n2 Command action3    l   logical (5 or over)4    p   primary partition (1-4)5 l6 First sector (114688-2097151, default 114688): 7 Using default value 1146888 Last sector, +sectors or +size{K,M,G} (114688-2097151, default 2097151): 9 Using default value 2097151
10
11 Command (m for help): p
12
13 Disk /dev/sdb: 1073 MB, 1073741824 bytes
14 255 heads, 63 sectors/track, 130 cylinders, total 2097152 sectors
15 Units = sectors of 1 * 512 = 512 bytes
16 Sector size (logical/physical): 512 bytes / 512 bytes
17 I/O size (minimum/optimal): 512 bytes / 512 bytes
18 Disk identifier: 0x94c5ab35
19
20    Device Boot      Start         End      Blocks   Id  System
21 /dev/sdb1            2048       22527       10240   83  Linux
22 /dev/sdb2           22528     2097151     1037312    5  Extended
23 /dev/sdb5           24576       45055       10240   83  Linux
24 /dev/sdb6           47104       67583       10240   83  Linux
25 /dev/sdb7           69632       90111       10240   83  Linux
26 /dev/sdb8           92160      112639       10240   83  Linux
27 /dev/sdb9          114688     2097151      991232   83  Linux

11.将/dev/sdb9改为LVM分区(即动态调整)

 1 Command (m for help): t2 Partition number (1-9): 9   //要修改的分区标识3 Hex code (type L to list codes): 8e    //代表LVM,可用l查询对应的Id4 Changed system type of partition 9 to 8e (Linux LVM)5 6 Command (m for help): p7 8 Disk /dev/sdb: 1073 MB, 1073741824 bytes9 255 heads, 63 sectors/track, 130 cylinders, total 2097152 sectors
10 Units = sectors of 1 * 512 = 512 bytes
11 Sector size (logical/physical): 512 bytes / 512 bytes
12 I/O size (minimum/optimal): 512 bytes / 512 bytes
13 Disk identifier: 0x94c5ab35
14
15    Device Boot      Start         End      Blocks   Id  System
16 /dev/sdb1            2048       22527       10240   83  Linux
17 /dev/sdb2           22528     2097151     1037312    5  Extended
18 /dev/sdb5           24576       45055       10240   83  Linux
19 /dev/sdb6           47104       67583       10240   83  Linux
20 /dev/sdb7           69632       90111       10240   83  Linux
21 /dev/sdb8           92160      112639       10240   83  Linux
22 /dev/sdb9          114688     2097151      991232   8e  Linux LVM

12.分区结尾工作

1 Command (m for help): w    //写入分区表
2 The partition table has been altered!
3
4 Calling ioctl() to re-read partition table.
5 Syncing disks.
6 [root@server ~]# partprobe /dev/sdb    //将分区表的修改结果告诉内核,这样可用忽略重启系统

使用fdisk给新增加硬盘分区相关推荐

  1. w7计算机新加,win7系统新加硬盘分区的详细步骤

    win7系统使用久了,好多网友反馈说win7系统新加硬盘分区的问题,非常不方便.有什么办法可以永久解决win7系统新加硬盘分区的问题,面对win7系统新加硬盘分区的图文步骤非常简单,只需要一.首先将新 ...

  2. 如何在计算机中增加硬盘分区,win10系统电脑下增加新磁盘分区的操作方法

    有关win10系统电脑下增加新磁盘分区的操作方法想必大家有所耳闻.但是能够对win10系统电脑下增加新磁盘分区进行实际操作的人却不多.其实解决win10系统电脑下增加新磁盘分区的问题也不是难事,小编这 ...

  3. 没有硬盘计算机照样可以工作吗,没有Fdisk 照样给电脑硬盘分区

    如今硬盘容量的发展速度早已远远超越其它硬件设备,昔日的40GB硬盘已经称不上"大"了,主流配置都是80GB.120GB,甚有者160GB.320GB同样不在少数.大硬盘购买后,第一 ...

  4. linux脚本用fdisk批量给主机硬盘分区

    文章目录 说明 fdisk分区流程[下面的不能跳过] 每个区的大小计算 获取使用的命令参数 获取方式 值提取后如下 值提出来以后删除刚才创建的分区 脚本测试分区是否正常 脚本内容如下 执行结果 脚本中 ...

  5. fdisk分区详解【适用于2T以内的新硬盘分区】

    文章目录 磁盘结构介绍 分区类型说明 磁盘管理说明 fdisk -l 参数详解 分区大小转换计算方法 方式一 方式二 MBR分区管理 图形化分区 命令行模式 命令格式化硬盘为gpt和mbr说明[了解就 ...

  6. 多硬盘分区管理fdisk

    前言 硬盘是一台计算机的必备硬件之一,计算机如何开始使用硬盘资源就要从硬盘分区说起.开始时,一台计算机只有一块硬盘,在安装Linux Ubuntu时,第一步就是对硬盘进行分区.当我们已经安装操作系统, ...

  7. 计算机怎么硬盘分区,新电脑如何分区,详细教您如何给电脑硬盘分区

    在买电脑装机时,磁盘分区与设置分区大小的问题一般都是由装机人员设定的,这点并没有引起太多购买者的注意.一般情况下在装机时都将一个磁盘分成4个分区,如果觉得不够的话,那如何给电脑硬盘分区,下面,小编给大 ...

  8. linux进行硬盘分区挂载-了解系统,最更好的开发

    linux 进行分区汇总.新电脑配置了一个固态256G的还有一个3T的硬盘.新公司要求自己进行安装.刚开始安装系统的时候没有注意到还有一块硬盘.导致在安装系统的时候没有进行把普通硬盘进行分区和挂载,那 ...

  9. 多硬盘分区管理fdisk-张丹

    多硬盘分区管理fdisk ubuntu实用工具系列文章 操作系统实用工具系列文章,将介绍基于Linux ubuntu的各种工具软件的配置和使用.有些工具大家早已耳熟能详,有些工具经常用到但确依然陌生. ...

  10. Ubuntu硬盘分区/格式化/挂载文件系统各种应用(转载)

    摘要:硬盘上有些什么.文件们都有多大,在有些时候我们是需要关心的,所以这里简单介绍两个命令:df.du.一个Ubuntu硬盘可以划分4个区,3个主要分区,一个扩展分区,而扩展分区里可以划分n个逻辑分区 ...

最新文章

  1. 【机器学习入门笔记7:TensorFlow常量变量的定义】20190210
  2. hangfire 过期记录_韩剧丨顶楼、空洞、再次十八岁、僵尸侦探、青春记录
  3. 无线数传电台工业控制的应用
  4. C#删除文件夹以及删除文件
  5. js执行环境作用域和闭包_JavaScript中执行上下文,提升,作用域和闭包的终极指南
  6. 导入已有项目到svn
  7. hud抬头显示器哪个好_汽车加装HUD抬头显示实用吗?不低头就能获取数据
  8. WPF TreeView的使用
  9. Hyper-V 2016 系列教程44 System Center 2016 Data Protection Manager 介绍和工作原理
  10. Hyperledger Fabric教程(13)-- 集成CouchDB作为状态数据库
  11. 【数据结构与算法】车辆路径问题(Vehicle Routing Problem,VRP)
  12. 人工智能与大数据时代-2019
  13. 解决win2019安装.net3.5的问题,亲测可行(未成功启用报错,找不到源文件报错,统统解决。。)
  14. 电商企业营销案例方案:2019年618大促用红包推广引流
  15. 广告术语(持续更新...)
  16. Nexus的权限管理
  17. Java小程序木叶村_恋爱球滚动的天空
  18. iPhone6今发售被指已变味 加价倒手成黄牛圈钱工具
  19. 在Matlab R2019版本上分析simulink模型的BODE图、阶跃响应、单位脉冲响应
  20. 什么是 Redis ?

热门文章

  1. GreenPlum分布式集群数据库实战培训课程(2天速成版)
  2. Typora下载链接
  3. php laravel手册,laravel5.6手册下载|Laravel5.6中文手册pdf最新版下载(附使用方法)_星星软件园...
  4. navicat 8.0 mysql 名、组织、注册码
  5. CAD文件如何转JPG图片?分享两种转换方法
  6. 计算机辅助设计课程设计评分标准,CAD考试规则评分标准.doc
  7. 二阶系统响应指标图_二阶系统单位阶跃响应.ppt
  8. php呼伦贝尔,呼伦贝尔php培训
  9. matlab 图像分割_图像分割之阈值分割(matlab)
  10. 计算机二级VEP考试内容,2017计算机二级VEP知识点:报表设计与应用