博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
【LINUX学习】磁盘分割之建立primary和logical 分区
阅读量:6090 次
发布时间:2019-06-20

本文共 4303 字,大约阅读时间需要 14 分钟。

[root@localhost ~]# fdisk -l

Disk /dev/sda: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 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         522     4088542+  83  Linux

Disk /dev/sdb: 3221 MB, 3221225472 bytes

255 heads, 63 sectors/track, 391 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn't contain a valid partition table

Disk /dev/sdc: 3221 MB, 3221225472 bytes
255 heads, 63 sectors/track, 391 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *           1         131     1052226   82  Linux swap / Solaris

Disk /dev/sdd: 3221 MB, 3221225472 bytes

255 heads, 63 sectors/track, 391 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
   Device Boot      Start         End      Blocks   Id  System

[root@localhost ~]# fdisk /dev/sdb

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. 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)
Command (m for help): p
Disk /dev/sdb: 3221 MB, 3221225472 bytes
255 heads, 63 sectors/track, 391 cylinders
Units = cylinders of 16065 * 512 = 8225280 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
First cylinder (1-391, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-391, default 391): 150
Command (m for help): p
Disk /dev/sdb: 3221 MB, 3221225472 bytes
255 heads, 63 sectors/track, 391 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         150     1204843+  83  Linux

Command (m for help): n

Command action
   e   extended
   p   primary partition (1-4)
e --建立拓展分区
Partition number (1-4): 4
First cylinder (151-391, default 151):
Using default value 151
Last cylinder or +size or +sizeM or +sizeK (151-391, default 391):
Using default value 391
Command (m for help): p
Disk /dev/sdb: 3221 MB, 3221225472 bytes
255 heads, 63 sectors/track, 391 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         150     1204843+  83  Linux
/dev/sdb4             151         391     1935832+   5  Extended
Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
l   --在拓展分区中建立逻辑分区,因为拓展分区是不能够直接被使用的,只有做成拓展分区时,才能够被使用。
First cylinder (151-391, default 151):
Using default value 151
Last cylinder or +size or +sizeM or +sizeK (151-391, default 391): 250
Command (m for help): p
Disk /dev/sdb: 3221 MB, 3221225472 bytes
255 heads, 63 sectors/track, 391 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         150     1204843+  83  Linux
/dev/sdb4             151         391     1935832+   5  Extended
/dev/sdb5             151         250      803218+  83  Linux
Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
l --在拓展分区中建立逻辑分区
First cylinder (251-391, default 251):
Using default value 251
Last cylinder or +size or +sizeM or +sizeK (251-391, default 391):
Using default value 391
Command (m for help): p
Disk /dev/sdb: 3221 MB, 3221225472 bytes
255 heads, 63 sectors/track, 391 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         150     1204843+  83  Linux
/dev/sdb4             151         391     1935832+   5  Extended
/dev/sdb5             151         250      803218+  83  Linux
/dev/sdb6             251         391     1132551   83  Linux

Command (m for help): w  ---保存

The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@localhost ~]# fdisk -l
Disk /dev/sda: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 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         522     4088542+  83  Linux

Disk /dev/sdb: 3221 MB, 3221225472 bytes

255 heads, 63 sectors/track, 391 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         150     1204843+  83  Linux
/dev/sdb4             151         391     1935832+   5  Extended
/dev/sdb5             151         250      803218+  83  Linux
/dev/sdb6             251         391     1132551   83  Linux
[root@localhost ~]# 

转载地址:http://bttwa.baihongyu.com/

你可能感兴趣的文章
PLSQL 之SQL分类和动态SQL
查看>>
JavaScript性能优化 DOM编程
查看>>
CentOS上安装redis记录
查看>>
JAVA第三次作业
查看>>
java string 中文转换UTF-8
查看>>
梓益C语言学习笔记之结构体-共用体-枚举
查看>>
联想手机如何root
查看>>
通过思科模拟器CISCO PACKET TRACER学习网络12——静态NAT
查看>>
【12c OCP】CUUG OCP认证071考试原题解析(36)
查看>>
MongoDB、Hbase、Redis等NoSQL优劣势、应用场景
查看>>
Ubuntu下面MySQL的参数文件my.cnf浅析
查看>>
Tesra超算网络,解决AI开发困境
查看>>
The Quest Panel&obtain RS3gold free 900M runescape
查看>>
京东与万事达卡发布报告 移动支付战争C端转向B端
查看>>
screen命令详解
查看>>
使用 malloc后free出错 错误所在
查看>>
CentOS 搭建docker私有仓库实践
查看>>
VMware下安装QT Creator
查看>>
mysql从库出错
查看>>
vbs技巧
查看>>