Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: 单机上模拟部署生产环境集群,搭建完成后,如何扩容/data1目录
To simulate deploying a production environment cluster on a single machine, I mapped a volume from storage and formatted it into an ext4 file system to serve as the /data1 directory. Now, I have expanded the volume by 100G from the storage side. How can I expand the /data1 mounted directory?
resize2fs /dev/xx (/data1 mount point)
You didn’t use LVM, right? Can you check with df?
Could you show your configuration?
You are modifying the storage directory.
Ask your operations team. These are basic issues and have nothing to do with the database.
Shouldn’t this automatically expand? Is volume expansion in Linux different from Windows?
After vg expansion, just execute the following one.
Look for operations personnel.
It’s really different; LVM partitions are completely different from standard partitions.
The troublesome points of LVM:
- Create PV: pvcreate /dev/sdb1
- Extend VG: vgextend /dev/VolGroup00 /dev/sdb1
- Extend LV: lvextend -L +n (M or G) /dev/VolGroup00/LogVol00
Uh… better find the operations senior brother~ I’m confused~
If it’s not LVM, you can first expand this storage and then expand the ext4 partition.
Or provide a detailed screenshot of lsblk
for us to take a look.
growpart /dev/vdb x
resize2fs /dev/vdbx
At that time, I followed these steps and initially used a 500G volume. Now I have expanded the volume to 600G at the storage layer. How do I synchronize this change to the mounted host?
LVM management is very simple, just adjust the size. Non-LVM is very troublesome. You can refer to this:
Expanding non-LVM partitions on a hard disk with services in CentOS7_CSDN Blog
Partition expansion with parted is somewhat different from LVM.
You can try unmounting first in the test environment and then expanding.
This depends on the expansion operation of the system volume and is unrelated to the database.
It looks like you are using Inspur’s storage and Inspur’s dynamic storage interface. It is still recommended to follow Inspur’s manual to expand the multipath. If you really can’t do it, contact Inspur’s after-sales service. Make sure to back up your data!!
If it’s a self-installed system, then start over and use LVM logical volume management for the disks. If it’s a cloud environment, I can expand the disk size on both Alibaba Cloud and Amazon Cloud.
In your screenshot, the operation is incorrect. You didn’t use growpart to expand the partition, so how can you directly use resize2fs to adjust the partition size? You should execute growpart /dev/mapper/idiska 1 for online expansion first, and then execute resize2fs to adjust the partition size.