linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
From: "Linda A. Walsh" <lvm@tlinx.org>
To: LVM general discussion and development <linux-lvm@redhat.com>
Subject: [linux-lvm] Bug: 'cow' partitions for old active snapshots are not reliably removed.
Date: Sat, 28 Sep 2013 13:29:24 -0700	[thread overview]
Message-ID: <52473C24.5060606@tlinx.org> (raw)

I create snapshots of my Home partition.  After a day, I create a new snapshot, 
and use rsync to determine the diffs that occurred since the last snapshot, 
then remove the 'active snapshot', and copy the diffs to a new, static
partition that is sized for the size of the diffs that were found.  This 
leaves me with a partition that holds changes for the given date.

A "cow" is created for each active snap.  When I stop the active shapshot
and later delete it (replacing it with a normal, non-active partition
by the same name), I notice that none of the "cow" partitions are deleted
when I remove the old 'active' the old snapshot. It seems this is an
oversight -- i.e. -- the 'cow' partitions are no longer needed since there
is no active snapshot.  What's worse that 'dm' reuses old active snap names,
so some of the old 'cow' partitions point to new partitions that are unrelated
to the old active snap.

In addition, old snapshots are "pruned" based on age.  They are not pruned via
a simple "delete oldest", but by some number of snaps that I wish to keep for
a given age

Example:
...
lrwxrwxrwx 1       7 Sep 28 05:09 HnS-Home -> ../dm-3 (origin; static)
lrwxrwxrwx 1       8 Sep  4 08:55 HnS-Home--2013.08.28--04.07.02 -> ../dm-20 (reused)
lrwxrwxrwx 1       7 Sep  6 04:07 HnS-Home--2013.09.04--04.07.03-cow -> ../dm-4 (reused)
lrwxrwxrwx 1       8 Sep  7 04:07 HnS-Home--2013.09.06--04.07.03-cow -> ../dm-19 (reused)
lrwxrwxrwx 1       8 Sep  8 04:07 HnS-Home--2013.09.07--04.07.03-cow -> ../dm-21 (reused)
lrwxrwxrwx 1       8 Sep  9 04:07 HnS-Home--2013.09.08--04.07.02-cow -> ../dm-19 (reused)
lrwxrwxrwx 1       8 Sep 10 05:29 HnS-Home--2013.09.09--04.07.03 -> ../dm-21 (static)
lrwxrwxrwx 1       8 Sep 10 04:07 HnS-Home--2013.09.09--04.07.03-cow -> ../dm-23 (reused)
lrwxrwxrwx 1       8 Sep 11 04:07 HnS-Home--2013.09.10--04.07.02-cow -> ../dm-26 (reused)
lrwxrwxrwx 1       8 Sep 13 04:07 HnS-Home--2013.09.12--04.07.03-cow -> ../dm-26 (reused)
lrwxrwxrwx 1       7 Sep 14 05:00 HnS-Home--2013.09.13--04.07.03 -> ../dm-4 (static)
lrwxrwxrwx 1       8 Sep 14 04:07 HnS-Home--2013.09.13--04.07.03-cow -> ../dm-24 (invalid)
lrwxrwxrwx 1       8 Sep 16 06:13 HnS-Home--2013.09.15--04.07.03 -> ../dm-14 (static)
lrwxrwxrwx 1       8 Sep 17 04:07 HnS-Home--2013.09.16--04.07.03-cow -> ../dm-26 (reused)
lrwxrwxrwx 1       8 Sep 18 05:22 HnS-Home--2013.09.17--04.07.04 -> ../dm-16 (static)
lrwxrwxrwx 1       8 Sep 18 04:07 HnS-Home--2013.09.17--04.07.04-cow -> ../dm-24 (invalid)
lrwxrwxrwx 1       8 Sep 19 04:07 HnS-Home--2013.09.18--04.07.03-cow -> ../dm-26 (reused)
lrwxrwxrwx 1       8 Sep 20 04:58 HnS-Home--2013.09.19--04.07.03 -> ../dm-19 (static)
lrwxrwxrwx 1       8 Sep 20 04:07 HnS-Home--2013.09.19--04.07.03-cow -> ../dm-24 (invalid)
lrwxrwxrwx 1       8 Sep 21 05:02 HnS-Home--2013.09.20--04.07.03 -> ../dm-25 (static)
lrwxrwxrwx 1       8 Sep 21 04:07 HnS-Home--2013.09.20--04.07.03-cow -> ../dm-26 (reused)
lrwxrwxrwx 1       8 Sep 22 05:00 HnS-Home--2013.09.21--04.07.03 -> ../dm-18 (static)
lrwxrwxrwx 1       8 Sep 22 04:07 HnS-Home--2013.09.21--04.07.03-cow -> ../dm-24 (invalid)
.....
The ones marked 'invalid' are dangling symlinks.  The ones marked 'reused', 
exist and usually point to some other non-cow partition (a static partition).
FWIW, the names are in Vol/subvol-date-time format (a format that works
with MS's snapshot names and allows a user to find previous versions of files that
have changed since that date.

While cow partitions are not normally mounted, they seem to be potential future
problems and at best, are dangling symlinks that aren't cleaned up and sometimes 
point to new, valid data.

How is it that they are not deleted when I close and delete the active snapshot that
corresponds to them.  I can modify my "snapper" to manually delete 'cow' 
partitions, but this seems like a "hack" that should be unnecessary.

I'm assuming these "should" not be there, as they are no longer valid?

Thanks!

                 reply	other threads:[~2013-09-28 20:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52473C24.5060606@tlinx.org \
    --to=lvm@tlinx.org \
    --cc=linux-lvm@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).