[root@riyimei ~]# fdisk /dev/sdb
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): 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
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)
Command (m for help): p
Disk /dev/sdb: 214.7 GB, 214748364800 bytes
255 heads, 63 sectors/track, 26108 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xe8add119
   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-26108, default 1): 
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-26108, default 26108): +10G
Command (m for help): P
Disk /dev/sdb: 214.7 GB, 214748364800 bytes
255 heads, 63 sectors/track, 26108 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xe8add119
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        1306    10490413+  83  Linux
Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
e
Partition number (1-4): 2
First cylinder (1307-26108, default 1307): 
Using default value 1307
Last cylinder, +cylinders or +size{K,M,G} (1307-26108, default 26108): +20G
Command (m for help): P
Disk /dev/sdb: 214.7 GB, 214748364800 bytes
255 heads, 63 sectors/track, 26108 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xe8add119
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        1306    10490413+  83  Linux
/dev/sdb2            1307        3918    20980890    5  Extended
Command (m for help): n
Command action
   l   logical (5 or over)
   p   primary partition (1-4)
l
First cylinder (1307-3918, default 1307): 
Using default value 1307
Last cylinder, +cylinders or +size{K,M,G} (1307-3918, default 3918): 
Using default value 3918
Command (m for help): P
Disk /dev/sdb: 214.7 GB, 214748364800 bytes
255 heads, 63 sectors/track, 26108 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xe8add119
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        1306    10490413+  83  Linux
/dev/sdb2            1307        3918    20980890    5  Extended
/dev/sdb5            1307        3918    20980858+  83  Linux
Command (m for help): W
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@riyimei ~]# lsblk 
NAME                          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda                             8:0    0   50G  0 disk 
├─sda1                          8:1    0  512M  0 part /boot
└─sda2                          8:2    0 49.5G  0 part 
  ├─vg_riyimei-swap_lv (dm-0) 253:0    0    4G  0 lvm  [SWAP]
  ├─vg_riyimei-root_lv (dm-1) 253:1    0   10G  0 lvm  /
  ├─vg_riyimei-usr_lv (dm-2)  253:2    0   10G  0 lvm  /usr
  ├─vg_riyimei-var_lv (dm-3)  253:3    0   10G  0 lvm  /var
  ├─vg_riyimei-home_lv (dm-4) 253:4    0    4G  0 lvm  /home
  ├─vg_riyimei-tmp_lv (dm-5)  253:5    0    1G  0 lvm  /tmp
  └─vg_riyimei-opt_lv (dm-6)  253:6    0   10G  0 lvm  /opt
sr0                            11:0    1 55.2M  0 rom  
sdb                             8:16   0  200G  0 disk 
├─sdb1                          8:17   0   10G  0 part 
├─sdb2                          8:18   0    1K  0 part 
└─sdb5                          8:21   0   20G  0 part 
[root@riyimei ~]# 

fdisk 添加逻辑分区的更多相关文章

  1. linux下添加逻辑分区并挂载(手动和自动方式)

    一.查看新磁盘[root@desktop61 Desktop]# fdisk -cul /dev/sdc Disk /dev/sdc: 21.5 GB, 21474836480 bytes255 he ...

  2. Linux 使用fdisk添加新分区

    Linux系统由于数据累计增长.前期存储规划不合理等诸多因素,出现存储不够用的情况时,此时就需要扩展逻辑分区或添加新的逻辑分区.下面介绍一下通过使用fdsik添加新的逻辑分区. 首先使用df命令检查文 ...

  3. Centos7不修改默认交换分区下添加交换分区

    交换分区介绍 Linux系统中的交换分区是当物理内存(RAM)被充满时,作为物理内存的缓存来使用. 当系统需要更多的内存资源而物理内存已经充满,内存中不活跃的页就会被移动到交换分区上. 交换分区位于硬 ...

  4. linux 系统磁盘管理(主分区和逻辑分区)

    摘要:linux系统磁盘管理主分区和逻辑分区 1.linux系统分区应了解的常识 硬盘分区实质上是对硬盘的一种格式化,然后才能使用硬盘保存各种信息,在创建分区时,就已经设置好了硬盘的各项物理参数,指定 ...

  5. fdisk添加分区引起的Linux Error: 22: Invalid argument

    在Linux服务器(虚拟机)上使用fdisk添加分区.格式化分区后,遇到了Linux Error: 22: Invalid argument错误,操作步骤如下所示 [root@oracle-serve ...

  6. Linux fdisk命令详解[主分区/逻辑分区创建]

    fdisk常见命令参数 -b<分区大小>:指定每个分区的大小: -l:列出指定的外围设备的分区表状况: -s<分区编号>:将指定的分区大小输出到标准输出上,单位为区块: -u: ...

  7. Linux fdisk命令创建逻辑分区

    [root@localhost ~]# fdisk /dev/sdb …省略部分输出… Command (m for help): n #建立新分区 Command action l logical ...

  8. CentOS添加新硬盘到新的分区(xfs/ext4) 或者添加新分区

    CentOs添加新硬盘到新的分区(xfs/ext4)  添加新分区 转载请注明:http://www.cnblogs.com/juandx/p/5618162.html 这篇文章介绍怎么添加一块新的硬 ...

  9. (转)硬盘分区备忘(主分区,扩展分区和逻辑分区)以及Linux硬盘分区工具parted 介绍

    场景:最近在学习Linux的基础知识,不可避免的设计到Linux的磁盘分区,以前做过总结,但是那种总结就是复制别人的文章,总结完就不想看第二遍,所以很容易就遗忘了!清楚明白的理解分区后,我就可以在自己 ...

随机推荐

  1. struts中请求数据自动封装

    实现原理 参数拦截器 第一:jsp表单数据填充到action中的属性 必须实现set方法,get方法可以不需要实现,jsp页面name名字保持一致 第二:jsp表单填充到action的对象的属性 js ...

  2. SASS概览

    1.安装: sass需要使用ruby,首先安装ruby,之后: gem install sass 编译: sass input.scss output.css 2.快速入门: 变量: .scss 变量 ...

  3. php数组 匹配键值

    1.array_search() //判断键值是否在数组中,//存在,返回值对应的键;//不存在,返回false;//例子:$type = array( "选考" => 'o ...

  4. git--客户端管理工具初步使用

    说点废话哈 小白一枚, 今年3月份进入自己的第一家公司, 开始成为前端中的一份子,好在公司里有位和我一同进来的一位老哥带着我,从老哥身上学到的知识不多,(因为和老哥只相处工作了三个月,因为家里的事情, ...

  5. 新手须知 QT类大全

    QT类大全,在行内容中罗列出来了,希望大家多看看,如果是API就更好了,但可惜不是.这些是一些大类,请多做参考. QApplication 应用程序类 QLabel 标签类 QPushButton 按 ...

  6. 1.什么是Cython

    Cython是一种编程语言,它使Python语言的C扩展像Python本身一样简单.它旨在成为Python语言的超集,为其提供高级,面向对象,功能和动态编程.它的主要功能是支持可选的静态类型声明作为语 ...

  7. 使用plsql创建package

    1. 2.需要在packages中新建相同的包名:否则无法编译,报没有声明

  8. 揭秘Product Hunt怎样运用邮件崛起

    Product Hunt正被硅谷热议,而大家谈论Product Hunt时,经常涉及邮件营销. Product Hunt由Ryan Hoover 在2013年11月创立.鼓舞人们发现和分享新产品的站点 ...

  9. mysql实战45讲读书笔记(二) 一条SQL更新语句是如何执行的 极客时间

    前面我们系统了解了一个查询语句的执行流程,并介绍了执行过程中涉及的处理模块.相信你还记得,一条查询语句的执行过程一般是经过连接器.分析器.优化器.执行器等功能模块,最后到达存储引擎. 那么,一条更新语 ...

  10. MYSQL binlog 日志内容查看

    记录mysql数据库真正执行更改的所有操作(DML语句),不包含那些没有修改任何数据的语句,不会记录select和show这样的语句. 二进制日志的作用: 1. 可以完成主从复制的功能 2. 进行恢复 ...