对阿里云原有磁盘中的lvm进行扩容

时间:2024-05-21 16:57:01

一.在阿里云上点击扩容

1.进入实例点击云盘扩容

对阿里云原有磁盘中的lvm进行扩容

2.重启机器并进入linux中对

1.我扩容的200G /dev/vdb
因为 LVM:/dev/appvg/applv 在 /dev/vdb1中
所以先需要对/dev/vdb1 (60G) 进行扩容到200G

2.先 fdisk /dev/vdb
然后对 步骤如下

``[[email protected] ~]# fdisk /dev/vdb //输入fdisk /dev/sdb 请确认扩容分区对应的硬盘名称,以免误删其他分区!

The number of cylinders for this disk is set to 41610.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:

  1. software that runs at boot time (e.g., old versions of LILO)
  2. booting and partitioning software from other OSs
    (e.g., DOS FDISK, OS/2 FDISK)
    Command (m for help): d //输入d删除分区
    Selected partition 1 //显示要删除的分区号,因为只有一个分区,所以显示1
    Command (m for help): n //输入n新建分区
    Command action
    e extended
    p primary partition (1-4)
    p //输入p,选择要操作的项目
    Partition number (1-4): 1 //输入要新建的分区号,这里输入1
    First cylinder (1-41610, default 1): //选择要截止的磁盘位置,这里直接按回车,全部增加。
    Using default value 1
    Last cylinder or +size or +sizeM or +sizeK (1-41610, default 41610): //直接按回车。
    Using default value 41610
    Command (m for help): w //输入w保存设置
    The partition table has been altered!
    Calling ioctl() to re-read partition table.
    WARNING: Re-reading the partition table failed with error 16: 设备或资源忙.
    The kernel still uses the old table.
    The new table will be used at the next reboot.
    Syncing disks.
    `
    3.重启机器
    对阿里云原有磁盘中的lvm进行扩容
    发现vdb1扩容成功

4.剩余对lvm扩容步骤如下
阿里云帮助文档
https://help.aliyun.com/document_detail/131143.html?spm=5176.11346930configuration.0.dexternal.3f4c5ca3JNw9Ud