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.

I'm planning on using LVM in order to be able to take atomic snapshots of large files and rsync them to a remote site.

What I'd like to know is whether there is any long-term impact on the main (non-snapshot) volume: if I typically keep the snapshots for 24h before dropping and creating a new snapshot, does the main volume get progressively more fragmented?

share|improve this question
1  
You can check LV fragmentation using lvs -o +devices. In general, it shouldn't be a problem. Snapshots are a temporary thing, they do not cause fragmentation, data stays in the original, unmodified LV. –  frostschutz Mar 25 '13 at 14:09
    
Thanks frostschutz, that's my answer. Would you like to post it (perhaps linking to the LVM docs here)? –  Jack Douglas Mar 26 '13 at 12:07

1 Answer 1

up vote 4 down vote accepted

No, there will be no fragmentation on the original filesystem because of the snapshot.

Snapshots basically work this way:

  1. you start your snapshot by giving it some disk space to keep track of changes,
  2. one block on your original volume gets modified,
  3. before the new block is actually written on the original volume, the (old) block content is copied within the snapshot area,
  4. whenever you access your snapshot device, LVM maps block access either to the original volume or the snapshot area, giving you the feeling that your snapshot volume is "frozen".

Nowhere in that process the original volume behaves differently because of the snapshot. It just ignores the whole snapshot thing.

(You will note that this "fragmentation-avoiding" behavior comes at a performance cost when writing to the original filesystem though.)

share|improve this answer

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.