v_diskname1=/dev/sda
pvcreate -f $v_diskname1
vgcreate vg-docker $v_diskname1
lvcreate -L 100g -n lvapp vg-docker
mkfs.xfs /dev/vg-docker/lvapp
mkdir -p /apps
mount /dev/mapper/vg--docker-lvapp -o rw,pquota /apps
v_app=`grep apps /etc/fstab |wc -l`
if [ 0 -eq $v_app ]
then
echo "#/dev/mapper/vg--docker-lvapp /apps xfs rw,pquota 0 0" >> /etc/fstab
fi
#lvcreate -l 100%Free -n lvdata vg-docker
#mkfs.xfs /dev/vg-docker/lvdata
#mkdir -p /data
#mount /dev/mapper/vg--docker-lvdata -o rw /data
#v_diskname2=/dev/sdb
#pvcreate -f $v_diskname2
#vgcreate vg-data $v_diskname2
#lvcreate -l 100%Free -n lvdata vg-data
#mkfs.xfs /dev/vg-data/lvdata
#mkdir -p /data
#mount /dev/mapper/vg--data-lvdata -o rw /data
#v_data=`grep data /etc/fstab |wc -l`
#if [ 0 -eq $v_data ]
#then
# echo "#/dev/mapper/vg--docker-lvdata /data xfs rw 0 0" >> /etc/fstab
#fi
#v_data=`grep data /etc/fstab |wc -l`
#if [ 0 -eq $v_data ]
#then
# echo "#/dev/mapper/vg--data-lvdata /data xfs rw 0 0" >> /etc/fstab
#fi
chmod -R 777 /apps
#chmod -R 777 /data
v_res=`grep 169.169.0.100 /etc/resolv.conf |wc -l`
if [ 0 -eq $v_res ]
then
echo "nameserver 169.169.0.100 " >>/etc/resolv.conf
echo "search svc.cluster.local cluster.local" >>/etc/resolv.conf
echo "options ndots:5 " >>/etc/resolv.conf
fi
标签:vg,mount,dev,volume,etc,lvdata,Logical,docker,data
From: https://www.cnblogs.com/zikang/p/17103935.html