LVM snapshots on 2.6.8-022stab064.1-enterprise
I have a nice 4 way box with 5GB of RAM running CentOS 4.2/OpenVZ. I like it a lot, but I've come across a stumbling block: Backups. I want to make snapshots and dump them over the network to a disk cache before being dumped to tape. I generally do this with lvm snapshots, the dump command, and ssh, but when I try to create the lvm snapshot, I get an error. # lvcreate -s -l 20 snap_root /dev/vg_sys/root snapshot: Required device-mapper target(s) not detected in your kernel lvcreate: Create a logical volume ... # modprobe dm_snapshot FATAL: Module dm_snapshot not found. Are lvm snapshots unavailable on the openvz kernels? --Andy
Re: LVM snapshots on 2.6.8-022stab064.1-enterprise
Hi Andy, # CONFIG_DM_SNAPSHOT is not set You must build your own kernel with enabled lvm/snapshot targets! Thorsten
Is there any reason the binary OpenVZ kernels don't come with CONFIG_DM_SNAPSHOT enabled? Just curious. --Andy
there is no any real reason for this i suppose. if someone will report that it works and disered to have, I will turn it on. Not a problem.
I was able to get lvm snapshots working. I tested it with ovzkernel-2.6.8-022stab070.1.src.rpm, changed one line in the enterprise config (CONFIG_DM_SNAPSHOT=y), and rebuilt. rpm -ivh ovzkernel-2.6.8-022stab070.1.src.rpm # make changes to config - set CONFIG_DM_SNAPSHOT=y vim /usr/src/redhat/SOURCES/kernel-2.6.8-022stab070-i686-enterprise.config.ovz rpmbuild -bb --target=i686 /usr/src/redhat/SPECS/kernel-ovz.spec # wait a little while rpm -ivh /usr/src/redhat/RPMS/i686/ovzkernel-enterprise-2.6.8-022stab070.1.i686.rpm reboot Snapshots seem to be working fine with the new build. # lvcreate -s -l 20 -n snap_vz vg_sys/vz Logical volume "snap_vz" created # lvremove -f vg_sys/snap_vz Logical volume "snap_vz" successfully removed Hope this helps. --Andy
ok. I will turn it ON in next kernel. NP.