fdisk分区并扩展lvm

[root@zookeeper ~]# fdisk /dev/xvdb 
欢迎使用 fdisk (util-linux 2.23.2)。

更改将停留在内存中,直到您决定将更改写入磁盘。
使用写入命令前请三思。

Device does not contain a recognized partition table
使用磁盘标识符 0x06424561 创建新的 DOS 磁盘标签。

命令(输入 m 获取帮助):n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
分区号 (1-4,默认 1):1
起始 扇区 (2048-209715199,默认为 2048):回车
将使用默认值 2048
Last 扇区, +扇区 or +size{K,M,G} (2048-209715199,默认为 209715199):回车
将使用默认值 209715199
分区 1 已设置为 Linux 类型,大小设为 100 GiB

命令(输入 m 获取帮助):t
已选择分区 1
Hex 代码(输入 L 列出所有代码):8e
已将分区“Linux”的类型更改为“Linux LVM”

命令(输入 m 获取帮助):p

磁盘 /dev/xvdb:107.4 GB, 107374182400 字节,209715200 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节
磁盘标签类型:dos
磁盘标识符:0x06424561

    设备 Boot      Start         End      Blocks   Id  System
/dev/xvdb1            2048   209715199   104856576   8e  Linux LVM

命令(输入 m 获取帮助):w
The partition table has been altered!

Calling ioctl() to re-read partition table.
正在同步磁盘。

[root@zookeeper ~]# pvcreate /dev/xvdb1 
  Physical volume "/dev/xvdb1" successfully created.
[root@zookeeper ~]# vgextend centos /dev/xvdb1 
  Volume group "centos" successfully extended
[root@zookeeper ~]# lvextend -l +100%FREE /dev/mapper/centos-root 
  Size of logical volume centos/root changed from <47.79 GiB (12233 extents) to <147.79 GiB (37833 extents).
  Logical volume centos/root successfully resized.
[root@zookeeper ~]# resize2fs /dev/mapper/centos-root   #ext4格式
resize2fs 1.42.9 (28-Dec-2013)
resize2fs: Bad magic number in super-block 当尝试打开 /dev/mapper/centos-root 时
找不到有效的文件系统超级块.
[root@zookeeper ~]# xfs_growfs /dev/mapper/centos-root   #xfs格式
meta-data=/dev/mapper/centos-root isize=512    agcount=4, agsize=3131648 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=0 spinodes=0
data     =                       bsize=4096   blocks=12526592, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal               bsize=4096   blocks=6116, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
data blocks changed from 12526592 to 38740992
 

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值