爱数anybackup——在后台完成VG、LV划分,并挂载到对应AnyBackup的数据卷,并设置开机自动挂载
安装lvm2
yum install lvm2
PV、VG创建
方式一:PV建在分区上
lsblk parted /dev/sdb mklabel msdos parted /dev/sdc mklabel msdos parted /dev/sdd mklabel msdos parted /dev/sde mklabel msdos parted /dev/sdb mkpart primary 0% 100% parted /dev/sdc mkpart primary 0% 100% parted /dev/sdd mkpart primary 0% 100% parted /dev/sde mkpart primary 0% 100% pvcreate /dev/sd[bcde]1 vgcreate ofs /dev/sdb1 vgcreate ddup /dev/sdc1 vgcreate self /dev/sdd1 vgcreate meta /dev/sde1
方式二:PV建在硬盘(LUN)上
lsblk pvcreate /dev/sd[bcde] vgcreate ofs /dev/sdb vgcreate ddup /dev/sdc vgcreate self /dev/sdd vgcreate meta /dev/sde
创建LV,并格式化
lvcreate -l 100%FREE -n ofs ofs lvcreate -l 100%FREE -n ddup ddup lvcreate -l 100%FREE -n self self lvcreate -l 100%FREE -n meta meta mkfs.xfs /dev/mapper/ofs-ofs mkfs.xfs /dev/mapper/ddup-ddup mkfs.xfs /dev/mapper/self-self mkfs.xfs /dev/mapper/meta-meta
创建对应目录,并挂载卷
创建挂载点目录
mkdir -p /abvol/{ofs,ddup,self,meta}
在/etc/fstab中添加如下内容:
/dev/mapper/ofs-ofs /abvol/ofs xfs defaults 0 0 /dev/mapper/ddup-ddup /abvol/ddup xfs defaults 0 0 /dev/mapper/self-self /abvol/self xfs defaults 0 0 /dev/mapper/meta-meta /abvol/meta xfs defaults 0 0
挂载并查看卷
mount -a cat /etc/fstab df -Th pvs vgs lvs