该方法可以用来对数据库目录进行热备份
lvcreate -s -n test centos/home -L 100M
vgdisplay
lvcreate -s -n test centos/home -L 4M
mount -o nouuid /dev/centos/test -t xfs /tmp/test/
umount /tmp/test/
lvremove /dev/centos/test
以下命令失败
[root@mysql ~]# lvcreate -s -n test centos -L 100m
The origin name should include the volume group.
Run `lvcreate --help' for more information.
原因vg剩余的空间只有1个free pe,空间不足了,所以快照只能是4M
[root@mysql /]# vgdisplay
--- Volume group ---
...
Total PE 50943
Alloc PE / Size 50942 / 198.99 GiB
Free PE / Size 1 / 4.00 MiB
VG UUID oLxxmE-Gxwg-bimi-v4fi-aN73-TVe0-aZgIeX
mount -o nouuid /dev/centos/test -t xfs /tmp/test/ 命令必须要有nouuid参数,因为快照上文件系统的uuid与实际逻辑卷的文件系统就是完全一致的,如果不加会导致mount失败
PS:
不太明白-L的意义,写4M的快照,挂载后也是完整的文件(5.6G),那快照大小的意义在哪儿?实际使用是否会有影响
网友评论