Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
VirtualBox + Guest use Host LVM LV + Use Host LVM Snapshot
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
jd2066
Apprentice
Apprentice


Joined: 04 Jun 2006
Posts: 155

PostPosted: Tue Oct 06, 2015 9:43 pm    Post subject: VirtualBox + Guest use Host LVM LV + Use Host LVM Snapshot Reply with quote

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
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3151

PostPosted: Wed Oct 07, 2015 8:17 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
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