本章主要介绍虚拟化数据优化器
[root@node01 /]# mount /dev/cdrom /mnt/
mount: /mnt: WARNING: device write-protected, mounted read-only.
[root@node01 /]
[root@node01 /]# cat /etc/yum.repos.d/aa.repo
[aa]
name=aa
baseurl=file:///mnt/AppStream
enabled=1
gpgcheck=0
[bb]
name=bb
baseurl=///mnt/BaseOS
enabled=1
gpgcheck=0
[root@node01 /]#
[root@node01 /]# yum -y install vdo kmod-kvdo
[root@node01 /]# vdo list
[root@node01 /]#
[root@node01 ~]# vdo create --name vdo01 --device /dev/sdc --vdoLogicalSize 30G
Creating VDO vdo01
The VDO volume can address 26 GB in 13 data slabs, each 2 GB.
It can grow to address at most 16 TB of physical storage in 8192 slabs.
If a larger maximum size might be needed, use bigger slabs.
Starting VDO vdo01
Starting compression on VDO vdo01
VDO instance 0 volume is ready at /dev/mapper/vdo01
[root@node01 ~]#
[root@node01 ~]# vdo list
vdo01
[root@node01 ~]#
[root@node01 ~]# mkfs.xfs -K /dev/mapper/vdo01
meta-data=/dev/mapper/vdo01 isize=512 agcount=4, agsize=1966080 blks
= sectsz=4096 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=1, rmapbt=0
= reflink=1
data = bsize=4096 blocks=7864320, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0, ftype=1
log =internal log bsize=4096 blocks=3840, version=2
= sectsz=4096 sunit=1 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
[root@node01 ~]#
[root@node01 ~]# mkdir /vdo01
[root@node01 ~]# mount /dev/mapper/vdo01 /vdo01/
[root@node01 ~]#
[root@node01 ~]# grep vdo /etc/fstab
/dev/mapper/vdo01 /vdo01 xfs defaults 0 0
[root@node01 ~]#
[root@node01 ~]# vdostats --hu
Device Size Used Available Use% Space saving%
/dev/mapper/vdo01 30.0G 4.0G 26.0G 13% 98%
[root@node01 ~]#
wget https://mirrors.aliyun.com/centos/7/isos/x86_64/CentOS-7-x86_64-DVD-2009.iso?spm=a2c6h.25603864.0.0.41be2d1cNwXIGn
这个软件包大小是11M
[root@node01 ~]# cp /root/CenOS-7 /vdo01/centos7
[root@node01 ~]# vdostats --hu
Device Size Used Available Use% Space saving%
/dev/mapper/vdo01 30.0G 8.0G 22.0G 26% 3%
[root@node01 ~]#
[root@node01 ~]# cp /root/CenOS-7 /vdo01/centos02
[root@node01 ~]# vdostats --hu
Device Size Used Available Use% Space saving%
/dev/mapper/vdo01 30.0G 8.0G 22.0G 26% 51%
[root@node01 ~]#
[root@node01 ~]# cp /root/CenOS-7 /vdo01/centos03
[root@node01 ~]# vdostats --hu
Device Size Used Available Use% Space saving%
/dev/mapper/vdo01 30.0G 8.0G 22.0G 26% 67%
[root@node01 ~]#
[root@node01 ~]# vdo remove -n vdo01 //移除vdo01
[root@node01 ~]# vdo list //查看是否删除