[root@localhost ~]# fdisk -l         #查看当前分区状态
Disk /dev/sda: 42.9 GB, 42949672960 bytes, 83886080 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000c54beDevice Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     2099199     1048576   83  Linux
/dev/sda2         2099200    83886079    40893440   8e  Linux LVM
Disk /dev/mapper/centos-root: 39.7 GB, 39720058880 bytes, 77578240 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mapper/centos-swap: 2147 MB, 2147483648 bytes, 4194304 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytesDisk /dev/sdb: 10.7 GB, 10737418240 bytes, 20971520 sectors        #未分区磁盘
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

创建分区

[root@localhost ~]# parted /dev/sdb    #使用parted工具选择未分区磁盘/dev/sdb
GNU Parted 3.1
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel gpt                     #标记为GPT
(parted) p
Model: VMware Virtual disk (scsi)
Disk /dev/sdb: 10.7GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number  Start  End  Size  File system  Name  Flags(parted) mkpart primary 0% 100%           #选择100%空间创建主分区
(parted) p
Model: VMware Virtual disk (scsi)
Disk /dev/sdb: 10.7GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number  Start   End     Size    File system  Name     Flags1      1049kB  10.7GB  10.7GB               primary
[root@localhost ~]# partprobe /dev/sdb   #partprobe重新读取分区表或者重启服务器
[root@localhost ~]# fdisk -l             #查看扩容磁盘分区状况
Disk /dev/sda: 42.9 GB, 42949672960 bytes, 83886080 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000c54beDevice Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     2099199     1048576   83  Linux
/dev/sda2         2099200    83886079    40893440   8e  Linux LVM
Disk /dev/mapper/centos-root: 39.7 GB, 39720058880 bytes, 77578240 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mapper/centos-swap: 2147 MB, 2147483648 bytes, 4194304 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytesDisk /dev/sdb: 21.5 GB, 21474836480 bytes, 41943040 sectors         #可看到磁盘容量已经增加
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x00000000Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1    20971519    10485759+  ee  GPT
[root@localhost ~]# umount /dev/sdb1        #卸载挂载的分区
[root@localhost ~]# parted /dev/sdb
GNU Parted 3.1
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
Error: The backup GPT table is not at the end of the disk, as it should be.  This might mean that another operating system believes the disk is smaller.  Fix, by moving
the backup to the end (and removing the old backup)?
Fix/Ignore/Cancel? Fix                       #按提示修复
Warning: Not all of the space available to /dev/sdb appears to be used, you can fix the GPT to use all of the space (an extra 20971520 blocks) or continue with the current
setting?
Fix/Ignore? Fix                              #按提示修复
Model: VMware Virtual disk (scsi)
Disk /dev/sdb: 21.5GB                         #看到所有磁盘容量
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: Number  Start   End     Size    File system  Name     Flags1      1049kB  10.7GB  10.7GB  ext4         primary(parted) resizepart 1 21.5GB            #根据磁盘容量重新指定分区大小
(parted) p
Model: VMware Virtual disk (scsi)
Disk /dev/sdb: 21.5GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: Number  Start   End     Size    File system  Name     Flags1      1049kB  21.5GB  21.5GB  ext4         primary(parted) quit
Information: You may need to update /etc/fstab.

使用parted工具 创建GPT分区,并进行扩容相关推荐

  1. linux parted新建分区表,Parted 创建 GPT 分区

    对于磁盘的分区表 MBR与GPT区别. MBR:MBR分区表(即主引导记录)大家都很熟悉,是过去我们使用windows时常用的. 所支持的最大卷:2T,而且对分区有限制:最多4个主分区或3个主分区加一 ...

  2. parted创建GPT分区

    本次操作环境: Ubuntu Server 10.10 SCSI Harddisk:/dev/sda       500GB U盘:/dev/sdb    8GB(模拟成USB Harddisk,安装 ...

  3. 使用 parted 命令创建新分区

    当磁盘容量大于2T的时候,我们一般使用 parted 命令去创建新分区. 1.使用 fdisk 命令查看系统识别到的新硬盘 2.使用 parted 命令管理新硬盘 3.使用 help 命令查看所有支持 ...

  4. diskpart命令创建GPT磁盘分区

    利用diskpart命令创建GPT磁盘分区图文教程很多朋友都是使用工具软件完成创建GPT磁盘分区,实际上你无论你是使用光盘.U盘还是硬盘(NT6)等方式全新安装Win7或者Win8系统,都可以利用di ...

  5. esp分区创建 linux_Linux 基础知识: GPT分区基础知识及如何在GPT分区上安装WIN7

    大硬盘和WIN8系统,让我们从传统的BIOS+MBR模式升级到UEFI+GPT模式,现在购买的主流电脑,都是预装WIN8系统,为了更好的支持2TB硬盘,更快速的启动win8,预装系统都采取了GPT分区 ...

  6. parted工具详解

    通常我们用的比较多的一般都是fdisk工具来进行分区,但是现在由于磁盘越来越廉价,而且磁盘空间越来越大:而fdisk工具他对分区是有大小限制的,它只能划分小于2T的磁盘.但是现在的磁盘空间很多都已经是 ...

  7. linux无损转换磁盘成gpt分区,Linux下数据无损动态修改MBR分区表格式为GPT

    个人博客站点:https://www.hiecho.cn 1.简介 腾讯云官网中有一篇帮助文档"扩容Linux文件系统,https://www.qcloud.com/document/pro ...

  8. 关于“在efi系统上,windows只能安装到gpt分区”的问题的解决方法的讨论(典型的宏基4750g)

    关于"在efi系统上,windows只能安装到gpt分区"的问题的解决方法的讨论(典型的宏基4750g) 通常用u盘安装系统的方法是: 用软碟通(ultraiso)将系统文件(is ...

  9. GPT分区下安装Windows7 x64 完整教程

    关于EFI的介绍,就不赘述了. 大家可以看看维基百科的介绍 http://zh.wikipedia.org/wiki/UEFI 在网上找了EFI安装win7 64位的教程,大多是从光盘启动安装,虽然这 ...

最新文章

  1. Linux 磁盘I/O读写速度检测
  2. 通讯录新建分组功能php,微信通讯录分组怎么设置
  3. RGB(FFFFFF)转255:255:255
  4. jquery上传图片_文件上传三种方式
  5. django默认缓存是多大_Django之缓存 - osc_fd8vzgsi的个人空间 - OSCHINA - 中文开源技术交流社区...
  6. ansible /usr/bin/python: not found
  7. iphone录屏没内部声音_6个iPhone隐藏功能,让你的手机好用到飞起
  8. 学习笔记之高质量C++/C编程指南
  9. PHP基于gettexts实现多语言i18n利用PoEdit
  10. linux串口结构termios,struct termios结构体—Linux串口.doc
  11. win任务栏计算机变未知,深度技术Win7电脑任务栏图标显示异常的解决方法
  12. 读懂复利“魔力” 30年让你成为千万富翁
  13. 【广告算法工程师入门 26】机制设计-考虑客户ROI的机制设计方法与实践
  14. 数理逻辑蕴含_(1)逻辑学(形式逻辑/数理逻辑): 基本概念
  15. 苹果6s微信提示未连接服务器,苹果6s微信无法打开,一直显示正在载入怎么处理?...
  16. java剑姬_Java虚拟机非常有用的性能监控工具
  17. server2003 必要的系统优化和安全设置
  18. mongodb 分片集群安装 -- 二进制文件安装
  19. 网络安全原理与实践学习笔记——设计DMZ
  20. 知乎书籍排行网站——建站始末

热门文章

  1. Theme主题的使用及windowIsTranslucent的理解
  2. C++随机字符串(可以包含中文)
  3. 【笔记四】:LIKE,UNION,ORDER BY,AND,OR,IN,BETWEEN,IS NULL,NOT
  4. 查询的数据出现Bug
  5. oracle dsg ogg,ogg 、 Shareplex和DSG RealSync 对比
  6. C#DataGridView选中行赋值刷新了,但是列表没刷新
  7. 智能烧水壶(WIFI版)05——水温调节和灯光提示功能实现篇
  8. 网友对网秦公司的真实评价
  9. uc/os-ii学习
  10. 基于51单片机的PM2.5和温湿度检测报警