linux 擴容
1.1.
In
the ECS console, you can resize a disk
·
Click
Search to find the ECS that needs to be expanded
·
Click
the instance ID to enter the ECS console and find the disk
·
Find
the cloud dis that needs to be rescaled, Snapshots of the cloud disk that need
to be resized to prevent data loss
· When the snapshot is complete, click More to resize the disk
· View the cloud disk format and file system type
Note: The system disk
can only be expanded to 2,048 GIB The data disk can be
expanded to 32,768 GiB
Note :Separate /dev/vdb and 1 with
a space in the command. 1 indicates the number of the partition.
2.1. Xfs
2.2. ext4(partition)
2.1. ext4(bare disk)
Note :Separate /dev/vdb and 1 with
a space in the command. 1 indicates the number of the partition.
3.1.
Xfs
3.2. ext4(partition)
3.3. ext4(bare disk)
4.1. Resize the physical volume.
·
Run the following command to determine the name of the physical
volume corresponding to the resized cloud disk or disk partition, and use the
following commands:
PV is listed as the name of the physical volume, and Devices is listed
as the cloud disk or disk partition corresponding to the physical volume.
sudo pvs -a -o +devices
·
Run the following command to resize the
physical volume of the disk:
sudo pvresize <物理卷名称>
·
To resize a physical volume as an example, the
command is:/dev/vdb
sudo pvresize /dev/vdb
The
following message is displayed, indicating that the physical volume has been
successfully rescaled.
4.2. Expand logical volumes and file systems.
a)
Run the following command to obtain the logical
volume path, name, volume group, and other information, which you need to use
in the following steps:
sudo lvdisplay
- LV Path: The logical volume path,
for example./dev/vg_01/lv01
- LV Name: The logical volume name,
for example.lv01
- VG Name: The name of the volume
group to which the logical volume belongs, for example.vg_01
- LV Size: The size of the logical
volume, illustrated with 59 GiB.
b)
Run the following command to resize the logical
volume:
sudo lvextend -L <增/减逻辑卷容量> <逻辑卷路径>
Example command: Add 10 GiB capacity to a logical volume (path ./dev/vg_01/lv01
sudo lvextend -L +10G
/dev/vg_01/lv01
A message similar to the following indicates
that you have added 01 GiB of space for the logical volume (lv10).
4.3. Ext4(The above operations(4.1and4.2)need to bepewformed)
sudo resize2fs <逻辑卷路径>
If you take the expansion logical volume lv01 (path
/dev/vg_01/lv01) as an example, the command is:
sudo resize2fs /dev/vg_01/lv01
4.4. Xfs(The above operations(4.1and4.2)need to bepewformed)
sudo xfs_growfs <逻辑卷挂载点>
If you take the expansion logical volume lv01 (mount point
/media/lv01) as an example, the command is:
sudo xfs_growfs /media/lv01
Comments
Post a Comment