|
在手册中,有这么一段:
- 6 使用snapshot 做备份
- 例如我们要对卷组"test_vg"每晚进行数据库备份,就要采用snapshot类型的卷组。这种卷组是其它
- 卷组的一个只读拷贝,它含有在创建 snapshot卷组时原卷组的所有数据,这意味你可以备份这个
- 卷组而不用担心在备份过程中数据会改变,也不需要暂时关闭数据库卷以备份。
- 6.1 建立snapshot卷
- 一个snapshot卷可大可小,但必须有足够的空间存放所有在本snapshot卷生存期间改变的数据,一
- 般最大要求是原卷组的1.1倍。如空间不够,snapshot卷将不能使用。
- # lvcreate -L592M -s -n dbbackup /dev/test_vg/databases
- lvcreate -- WARNING: the snapshot must be disabled if it gets full
- lvcreate -- INFO: using default snapshot chunk size of 64 KB for "/dev/test_vg/dbbackup"
- lvcreate -- doing automatic backup of "test_vg"
- lvcreate -- logical volume "/dev/test_vg/dbbackup" successfully created
复制代码
1 上文提到对卷组进行备份,但根据lvcreate的man手册里面所叙述的,snapshot应该是对逻辑卷(LV)进行备份的。
2 关于snapshot的大小的疑问,man手册里面说是原LV的15%-20%,这样是不是有问题,既然snapshot是某一时刻LV的精确备份,那么大小不应该小于原LV啊,即使snapshot可以通过lvextend扩展。
这是lvcreate的man手册中摘录的一段。
-s, --snapshot
Create a snapshot logical volume (or snapshot) for an existing, so called original logical volume
(ororigin). Snapshots provide a ’frozen image’ of the contents of the origin while the origin can still be updated. They enable consistent backups and online recovery of removed/overwritten data/files. The snapshot does not need the same amount of storage the origin has. In a typical scenario, 15‐20% might be enough. In case the snapshot runs out of storage, use lvextend(8) to grow it. Shrinking a snapshot is supported by lvreduce(8) as well. Run lvdisplay(8) on the snapshot in order to check how much data is allocated to it.
一点愚见,还望大家指正! |
|