View previous topic :: View next topic |
Author |
Message |
jd2066 Apprentice
Joined: 04 Jun 2006 Posts: 155
|
Posted: Tue Oct 06, 2015 9:43 pm Post subject: VirtualBox + Guest use Host LVM LV + Use Host LVM Snapshot |
|
|
Hi,
I'm currently using VirtualBox Virtual Machines with VDI files on the root file system (/srv/virtualmachines) and had an idea to use an LVM partition instead.
From searching online, that part is possible.
I can create an LVM volume /dev/vmdata/myvm for example and the guest OS (also running Gentoo) would see this volume as the block device /dev/sda.
I can then create/use an ext4 file system directly on /dev/sda without any partitions so the host volume /dev/vmdata/myvm works without needing to use /dev/vmdata/myvm1 or similar.
The one part I'm not sure about is can I do this:
While the Virtual Machine is running using the Host volume /dev/vmdata/myvm, could I create an LVM Snapshot from that Volume that is in use and backup the contents of that Volume using a tool that supports LVM Snapshots such as rsnapshot?
Justin |
|
Back to top |
|
|
szatox Advocate
Joined: 27 Aug 2013 Posts: 3151
|
Posted: Wed Oct 07, 2015 8:17 pm Post subject: |
|
|
Yes, you can.
Depending on the data you have there you might be interested in different levels of consistency though. Doing a flat-file backup you may be totaly fine with crash-consistent backup (snapshot when VM is operating).
IN some cases you will want to flush buffers ( run "sync" inside the vm) and then freez IO (e.g. dmsetup suspend inside VM ).
You might even want to stop some applications and unmount a database first to emulate cold backup.
Obviously, once you have created snapshot you can thaw IO and mount that db again and start applicatins, and then read that snapshot later. This is the purpose of a snapshot, to make a persistent point-in-time image of your volume. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|