1:创建磁盘分区(注意红色命令部分)

  1. [root@hongyin-test- ~]# fdisk /dev/sda
  2. Welcome to fdisk (util-linux 2.23.).
  3.  
  4. Changes will remain in memory only, until you decide to write them.
  5. Be careful before using the write command.
  6.  
  7. Command (m for help): m
  8. Command action
  9. a toggle a bootable flag
  10. b edit bsd disklabel
  11. c toggle the dos compatibility flag
  12. d delete a partition
  13. g create a new empty GPT partition table
  14. G create an IRIX (SGI) partition table
  15. l list known partition types
  16. m print this menu
  17. n add a new partition
  18. o create a new empty DOS partition table
  19. p print the partition table
  20. q quit without saving changes
  21. s create a new empty Sun disklabel
  22. t change a partition's system id
  23. u change display/entry units
  24. v verify the partition table
  25. w write table to disk and exit
  26. x extra functionality (experts only)
  27.  
  28. Command (m for help): n
  29. Partition type:
  30. p primary ( primary, extended, free)
  31. e extended
  32. Select (default e): p
  33. Selected partition
  34. First sector (-, default ):
  35. Using default value
  36. Last sector, +sectors or +size{K,M,G} (-, default ):
  37. Using default value
  38. Partition of type Linux and of size GiB is set
  39.  
  40. Command (m for help): t
  41. Partition number (-, default ):
  42. Hex code (type L to list all codes): L
  43.  
  44. Empty NEC DOS Minix / old Lin bf Solaris
  45. FAT12 Hidden NTFS Win Linux swap / So c1 DRDOS/sec (FAT-
  46. XENIX root Plan Linux c4 DRDOS/sec (FAT-
  47. XENIX usr 3c PartitionMagic OS/ hidden C: c6 DRDOS/sec (FAT-
  48. FAT16 <32M Venix Linux extended c7 Syrinx
  49. Extended PPC PReP Boot NTFS volume set da Non-FS data
  50. FAT16 SFS NTFS volume set db CP/M / CTOS / .
  51. HPFS/NTFS/exFAT 4d QNX4.x Linux plaintext de Dell Utility
  52. AIX 4e QNX4.x 2nd part 8e Linux LVM df BootIt
  53. AIX bootable 4f QNX4.x 3rd part Amoeba e1 DOS access
  54. a OS/ Boot Manag OnTrack DM Amoeba BBT e3 DOS R/O
  55. b W95 FAT32 OnTrack DM6 Aux 9f BSD/OS e4 SpeedStor
  56. c W95 FAT32 (LBA) CP/M a0 IBM Thinkpad hi eb BeOS fs
  57. e W95 FAT16 (LBA) OnTrack DM6 Aux a5 FreeBSD ee GPT
  58. f W95 Ext'd (LBA) 54 OnTrackDM6 a6 OpenBSD ef EFI (FAT-12/16/
  59. OPUS EZ-Drive a7 NeXTSTEP f0 Linux/PA-RISC b
  60. Hidden FAT12 Golden Bow a8 Darwin UFS f1 SpeedStor
  61. Compaq diagnost 5c Priam Edisk a9 NetBSD f4 SpeedStor
  62. Hidden FAT16 < SpeedStor ab Darwin boot f2 DOS secondary
  63. Hidden FAT16 GNU HURD or Sys af HFS / HFS+ fb VMware VMFS
  64. Hidden HPFS/NTF Novell Netware b7 BSDI fs fc VMware VMKCORE
  65. AST SmartSleep Novell Netware b8 BSDI swap fd Linux raid auto
  66. 1b Hidden W95 FAT3 DiskSecure Mult bb Boot Wizard hid fe LANstep
  67. 1c Hidden W95 FAT3 PC/IX be Solaris boot ff BBT
  68. 1e Hidden W95 FAT1 Old Minix
  69. Hex code (type L to list all codes): 8e
  70. Changed type of partition 'Linux' to 'Linux LVM'
  71.  
  72. Command (m for help): w
  73. The partition table has been altered!
  74.  
  75. Calling ioctl() to re-read partition table.
  76.  
  77. WARNING: Re-reading the partition table failed with error : Device or resource busy.
  78. The kernel still uses the old table. The new table will be used at
  79. the next reboot or after you run partprobe() or kpartx()
  80. Syncing disks.

2:重新加载分区表

  1. [root@hongyin-test- ~]# partprobe

3:查看新建的分区sda4

  1. [root@hongyin-test- ~]# fdisk -l
  2.  
  3. Disk /dev/sda: 150.3 GB, bytes, sectors
  4. Units = sectors of * = bytes
  5. Sector size (logical/physical): bytes / bytes
  6. I/O size (minimum/optimal): bytes / bytes
  7. Disk label type: dos
  8. Disk identifier: 0x000b2e61
  9.  
  10. Device Boot Start End Blocks Id System
  11. /dev/sda1 * Linux
  12. /dev/sda2 8e Linux LVM
  13. /dev/sda3 8e Linux LVM
  14. /dev/sda4 8e Linux LVM
  15.  
  16. Disk /dev/mapper/centos-root: 126.2 GB, bytes, sectors
  17. Units = sectors of * = bytes
  18. Sector size (logical/physical): bytes / bytes
  19. I/O size (minimum/optimal): bytes / bytes
  20.  
  21. Disk /dev/mapper/centos-swap: MB, bytes, sectors
  22. Units = sectors of * = bytes
  23. Sector size (logical/physical): bytes / bytes
  24. I/O size (minimum/optimal): bytes / bytes

4: 初始化物理卷

  1. [root@hongyin-test- ~]# pvcreate /dev/sda4
  2. Physical volume "/dev/sda4" successfully created

5: 查看卷组

  1. [root@hongyin-test- ~]# vgdisplay
  2. --- Volume group ---
  3. VG Name centos
  4. System ID
  5. Format lvm2
  6. Metadata Areas
  7. Metadata Sequence No
  8. VG Access read/write
  9. VG Status resizable
  10. MAX LV
  11. Cur LV
  12. Open LV
  13. Max PV
  14. Cur PV
  15. Act PV
  16. VG Size 119.50 GiB
  17. PE Size 4.00 MiB
  18. Total PE
  19. Alloc PE / Size / 119.50 GiB
  20. Free PE / Size /
  21. VG UUID RS3QPD-QV32-zaC9-gnx7-vcfj-Eg5a-G01NoW

6:  把新建的物理卷加到需要扩展的卷组

  1. [root@hongyin-test- ~]# vgextend centos /dev/sda4
  2. Volume group "centos" successfully extended

7: 查看逻辑卷

  1. [root@hongyin-test- ~]# lvdisplay
  2. --- Logical volume ---
  3. LV Path /dev/centos/root
  4. LV Name root
  5. VG Name centos
  6. LV UUID rVqhOK-1Qqp-2yRM-82t6-QR26-8SQQ-4mnefZ
  7. LV Write Access read/write
  8. LV Creation host, time localhost, -- :: +
  9. LV Status available
  10. # open
  11. LV Size 117.50 GiB
  12. Current LE
  13. Segments
  14. Allocation inherit
  15. Read ahead sectors auto
  16. - currently set to
  17. Block device :
  18.  
  19. --- Logical volume ---
  20. LV Path /dev/centos/swap
  21. LV Name swap
  22. VG Name centos
  23. LV UUID TWOjFe-dRbI-V5je-TJrM-U2Zr-8kZ4-FHmyZC
  24. LV Write Access read/write
  25. LV Creation host, time localhost, -- :: +
  26. LV Status available
  27. # open
  28. LV Size 2.00 GiB
  29. Current LE
  30. Segments
  31. Allocation inherit
  32. Read ahead sectors auto
  33. - currently set to
  34. Block device :

8: 扩展逻辑卷

  1. [root@hongyin-test- ~]# lvextend -l +%FREE /dev/centos/root
  2. Size of logical volume centos/root changed from 117.50 GiB ( extents) to 137.50 GiB ( extents).
  3. Logical volume root successfully resized.

9: 格式化文件系统

  1. [root@hongyin-test- ~]# xfs_growfs /dev/centos/root
  2. meta-data=/dev/mapper/centos-root isize= agcount=, agsize= blks
  3. = sectsz= attr=, projid32bit=
  4. = crc= finobt=
  5. data = bsize= blocks=, imaxpct=
  6. = sunit= swidth= blks
  7. naming =version bsize= ascii-ci= ftype=
  8. log =internal bsize= blocks=, version=
  9. = sectsz= sunit= blks, lazy-count=
  10. realtime =none extsz= blocks=, rtextents=
  11. data blocks changed from to

CentOS7 LVM磁盘扩容的更多相关文章

  1. 【转载】CentOS LVM磁盘扩容

    转自:http://blog.sina.com.cn/s/blog_8882a6260101cpfs.html EXSI5.1主机有一个linux虚拟机,系统是centos运行httpd服务,因为是多 ...

  2. 03.LinuxCentOS系统root目录LVM磁盘扩容

    根目录LVM扩容操作步骤: [root@centos7 ~]# df -lh文件系统 容量 已用 可用 已用% 挂载点/dev/mapper/centos-root 50G 7.7G 43G 6% / ...

  3. linux下 lvm 磁盘扩容

    打算给系统装一个oracle,发现磁盘空间不足.在安装系统的时候我选择的是自动分区,系统就会自动以LVM的方式分区.为了保证系统后期的可用性,建议所有新系统安装都采用LVM,之后生产上的设备我也打算这 ...

  4. CentOS 下lvm 磁盘扩容

    打算给系统装一个oracle,发现磁盘空间不足.在安装系统的时候我选择的是自动分区,系统就会自动以LVM的方式分区.为了保证系统后期的可用性,建议所有新系统安装都采用LVM,之后生产上的设备我也打算这 ...

  5. lvm 磁盘扩容

    LVM磁盘管理 一.LVM简介 LVM是 Logical Volume Manager(逻辑卷管理)的简写,它由Heinz Mauelshagen在Linux 2.4内核上实现.LVM将一个或多个硬盘 ...

  6. lvm磁盘扩容

    LVM实现新挂载磁盘扩容到原有目录 #查看磁盘 fdisk -l #创建pv pvcreate /dev/sdb [root@VM-67-49 ~]# pvcreate /dev/sdb Physic ...

  7. VMware CentOS LVM磁盘扩容

    一. 在虚拟机上增加磁盘空间 如下图. 增加完后会有提示 "磁盘已成功扩展.您必须从客户机操作系统内部对磁盘重新进行分区和扩展文件系统.是继续完成以下步骤才算成功. 二.调整虚拟机磁盘LVM ...

  8. 阿里云ECS 实例Centos7系统磁盘扩容

    需求:一台阿里云的数据盘磁盘空间不足,需要扩容,我这里只有一个主分区,ext4文件系统. 因为磁盘扩容场景不同,阿里云的文档比较全面一些,所以先奉上阿里云的文档,下面开始我的操作步骤: 1.登录控制台 ...

  9. 微服务架构 ------ 插曲 linux LVM磁盘扩容

    1.LVM的基本概念 物理卷(PV):可以在上面建立卷组的媒介,可以是硬盘分区,也可以是硬盘本身或者回环文件,物理卷包括一个特殊的header,其余部分被切割成一块块物理区域. 卷组(VG):将一组物 ...

随机推荐

  1. 用 CSS3 创建一个漂亮的多种色彩的菜单

    1. [图片] thumb.png ​2. [代码][HTML]代码 <!DOCTYPE html><html lang="en" >    <hea ...

  2. Linux课程---5、常用文件命令和目录命令(创建文件命令)

    Linux课程---5.常用文件命令和目录命令(创建文件命令) 一.总结 一句话总结: touch file1 1.管道符|有什么用? 将前一个命令的结果作为后一个命令的输入:比如查看文件前3行:ca ...

  3. 分享知识-快乐自己:IO流基本操作

    点我参考常用API: IO图解: 相关理论: 流的概念和作用: 流是一组有顺序的,有起点和终点的字节集合,是对数据传输的总称或抽象.即数据在两设备间的传输称为流,流的本质是数据传输,根据数据传输特性将 ...

  4. 目标检测 — Inception-ResNet-v2

    这篇文章介绍的网络有Inception V1.Inception V2.Inception V3.Inception V4与Inception-ResNet-V2. 1.Inception V1 主要 ...

  5. java_面试_01_一个月的面试总结(java)

    重点知识 由于我面试的JAVA开发工程师,针对于JAVA,需要理解的重点内容有: JVM内存管理机制和垃圾回收机制(基本每次面试都会问,一定要搞得透彻) JVM内存调优(了解是怎么回事,一般做项目过程 ...

  6. jQuery插件--图片文字向上向左循环滚动

    需要引用jquery 调用非常简单: 一. 向上滚动 $(".scroll_two").jScroll({vertical: true}); <div class=" ...

  7. JSP的一个增删改查例子和总结

    总结的几点: 1.在jsp中注意<%! %>声明代码块中的变量只会在项目开始的时候第一次运行jsp的时候执行一遍,有点类似于java类中的static代码块,所以如果是会改变的值不应该声明 ...

  8. Android数据传递的五种方法汇总

    Android开发中,在不同模块(如Activity)间经常会有各种各样的数据需要相互传递,我把常用的几种 方法都收集到了一起.它们各有利弊,有各自的应用场景. 我现在把它们集中到一个例子中展示,在例 ...

  9. Select\Poll\Epoll异步IO与事件驱动

    事件驱动与异步IO 事件驱动编程是一种编程规范,这里程序的执行流由外部事件来规定.它的特点是包含一个事件循环,但外部事件发生时使用回调机制来触发响应的处理.另外两种常见的编程规范是(单线程)同步以及多 ...

  10. Redis的安装和配置文件

    实验环境:Centos6.8 Redis版本:3.0.6 下载Redis,并放到/usr/local/soft下: yum -y install gcc automake autoconf libto ...