The operation of disk in linux is based on lvm, This is a set of tools related to disk expansion.
Code: CreateLvm.sh
(1). dd if=/dev/zero of=${LOOP_PATH} bs=${LOOP_UNIT} count=${LOOP_SIZE} // generate memory file
(2). losetup // Virtualize a file into a block device
(3). vgcreate --> lvcreate --> mkfs.xfs --> mount -a
(4). CreateService(code func) // system service
Code: DiskExp.py
Script command set:
parted (>2GB) or fdisk --> Create disk partition
mkfs.xfs -f partition --> format new partition
pvcreate --> Create a physical volume group
vgextend --> Add physical volume space to volume group
lvextend --> Add idle PEFREE to the logical volume through lvextend
resize2fs (ext)/xfs_growfs (xfs) --> Sync file system
Code: initraid1
Through code or view code comments
Code: DiskPartedTool
nothing to say
init