Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

It seems that usually it is talked about snapshots as read-only. (In a scenario where one creates a snapshot, then does some experiments with the main volume, and then restores the old state by "merging" the snapshot into the main volume.)

Is an alternative scenario possible in LVM? I.e., where one doesn't even want the temporary experiments to be visible in the main volume, so one creates a "temporary" snapshot, makes it writable, does the experiments there, in that "branch", and then discards the snapshot (or perhaps merges it if one is satisfied with the results)?

And if writable snapshots are possible in LVM, then what happens when merging a modified snapshot into the main volume which also has had some different modifications?

(BTW, btrfs snapshots seem to be writable by default, so this scenario seems to be well possible in btrfs.)

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

LVM does support read-write snapshots in fact that's the default. Merging a modified snapshot will delete the data on the snapshot origin volume the same way merging an unmodified snapshot would.

If you expect to discard modifications then I recommend RW snapshots and merge if you want to keep them. If you expect to keep the modifications then you should create a RO snapshot (or RW just don't mount it) and merge if something goes wrong.

An example for the first situation could be: You want to start a virtual machine with the exact same software every day. Sometimes you want to keep the changes because you installed patches but most of the time you want to start fresh.

The second situation could be a system upgrade. Most of the time it works and you can remove the snapshot. But every now and then it fails and you want to merge.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.