0

As far as understand snapshots in LVM (please, do correct me if I'm wrong): since they are not persistent and work even with a file system which doesn't itself support snapshots => I suppose it must mean that as soon as a snapshot is active, LVM will takes a copy of every block which is written to, before it is changed; this copy is saved to a RAM cache and eventually ends-up in another disk-space; and each read from the snapshot will be diverted to this «cache» if it exists there.

So I understand it means it should slow down every write while a snapshot exists. Does this mean that LVM snapshots should only be taken for as limited as possible durations, just for the time to backup data, and be suppressed as soon as possible ? And is this a concern only if the file system doesn't support snapshot natively ?

0

In short, yes, changing content which exists in a snapshot requires LVM to copy the content, which does slow down writes.

However, this happens regardless of the filesystem used because LVM operates at the block layer, and thus is unaware of the filesystem.

As for whether you should keep snapshots for only a short duration, that really depends on what is best for your use-case.

  • What I mean is that if would require to keep snaphots for a longer duration as for having a way to rollback wrong changes, It might mean that I should favor another snapshot system (like one implemented at the file system level with a permanent copy on write strategy.); – Camion Mar 25 '18 at 10:50
  • By the way, are you really sure that LVM is totally unaware of the file system ? Because il it's true, then it's even worse than I thought, since it means that it will even take copies of previously unallocated blocks. – Camion Mar 25 '18 at 10:53
  • LVM uses Linux's device-mapper, which makes it completely unaware of the filesystem. See unix.stackexchange.com/questions/391998/… – Emmanuel Rosa Mar 25 '18 at 21:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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