1

My desktop system(Kubuntu-20.04.4, with LVM2 root-fs) need to be frequently adjusted the configurations, but some configuration would be fault.

I take a new LVM2 snapshot of root fs, before every time I modify some configuration.

If I found that some configuration is wrong in later using, I can easily roll back my root fs to the last snapshot, to prevent from re-installing the entire system.

So I always have a series of snapshots of my root-fs whenever my system is running normally.

If there's only one snapshot existing, the performance is acceptable, at least I don't fell obviously slower.

If there are multiple(5) snapshots, would my system be far more slower than that with only one snapshot existing?

Thanks!

1
  • Most likely yes because it needs to look at all snapshots
    – anon
    Commented Aug 31, 2022 at 5:05

1 Answer 1

3

Snapshots in LVM use a "copy on (first) write" (CoW) mechanism to keep a frozen copy of the source volume accessible from the snapshot.

Copy on Write works by storing the original data present in a block on the source volume, to the storage set aside for the snapshot, just before the first time the original data is overwritten by new data.

This copying of original data needs to be done for all snapshots that are active, and means any write to a block on the source volume that has not yet been overwritten before, will result in a write to all snapshots. This can obviously slow down writes to your source (active) volume.

Note that the longer a snapshot remains in existence, the more storage it will need for keeping copies of the original data, up to the size of the source volume. If the space set aside for the snapshot does not have enough room to store all the original data that has been changed in the source volume, it will become disabled and inaccessible.

In addition copying of individual blocks increases the fragmentation of the Logical Volume (LV), so that contiguous blocks (at the LV level) are not contiguous any more on the Physical Volume (PV) level. So even after removing unneeded snapshots the fragmentation will remain.

Also see this question on Unix StackExchange

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .