lvm2磁盘扩容
apt-get install lvm2 xfsprogs -y
pvcreate /dev/sdb
vgcreate db /dev/sdb
lvcreate -l 100%FREE -n minio db
mkfs.xfs /dev/mapper/db-minio
uuid=`blkid | grep db-minio | awk -F: '{print $2}' | awk -F' ' '{print $1}'`
echo $uuid' /data xfs defaults 0 0' >> /etc/fstab
mkdir -p /data
mount -a
df -h
pvcreate /dev/sdc
vgcreate db2 /dev/sdc
lvcreate -l 100%FREE -n minio db2
mkfs.xfs /dev/mapper/db2-minio
uuid=`blkid | grep db2-minio | awk -F: '{print $2}' | awk -F' ' '{print $1}'`
echo $uuid' /data2 xfs defaults 0 0' >> /etc/fstab
mkdir -p /data2
mount -a
df -h
pvcreate /dev/sdd
vgcreate db3 /dev/sdd
lvcreate -l 100%FREE -n minio db3
mkfs.xfs /dev/mapper/db3-minio
uuid=`blkid | grep db3-minio | awk -F: '{print $2}' | awk -F' ' '{print $1}'`
echo $uuid' /data3 xfs defaults 0 0' >> /etc/fstab
mkdir -p /data3
mount -a
df -h
pvcreate /dev/sde
vgcreate db4 /dev/sde
lvcreate -l 100%FREE -n minio db4
mkfs.xfs /dev/mapper/db4-minio
uuid=`blkid | grep db4-minio | awk -F: '{print $2}' | awk -F' ' '{print $1}'`
echo $uuid' /data4 xfs defaults 0 0' >> /etc/fstab
mkdir -p /data4
mount -a
df -h
#/bin/bash
disk_name=vdb
yum install -y lvm2
pvcreate /dev/$disk_name
vgcreate data /dev/$disk_name
lvcreate -l 100%FREE -n data data
mkfs.xfs /dev/mapper/data-data
uuid=`blkid | grep data-data | awk -F: '{print $2}' | awk -F' ' '{print $1}'`
echo $uuid' /data xfs defaults 0 0' >> /etc/fstab
mkdir -p /data
mount -a