From: Zdenek Kabelac <zdenek.kabelac@gmail.com>
To: Michael DiDomenico <mdidomenico4@gmail.com>, dm-devel@lists.linux.dev
Subject: Re: delete on snapshot does not free space
Date: Tue, 30 Apr 2024 22:35:49 +0200 [thread overview]
Message-ID: <bda0198d-22dd-43fb-bf81-68fb101e596c@gmail.com> (raw)
In-Reply-To: <CABOsP2PL9AM5phv4ZhucGmpk6V1x+DozXLaPTBVaWqMdy-KdPA@mail.gmail.com>
Dne 30. 04. 24 v 19:54 Michael DiDomenico napsal(a):
> this is probably expected behavior, but i'd like to confirm as i'm not
> a device-mapper expert
>
> we're using COW snapshots overtop of a readonly block device. this
> seems to be working fine, however, when a person deletes files the
> blocks are not freed. case in point a RO block device with a COW
> filled up to 100% as shown in df. when i deleted some files to free
> space the usage never decreased
>
> to create the mount we do
>
> echo "0 <realsize> linear /dev/loop1 0" | dmsetup create roimage-base-real
> echo "0 <cowsize> linear /dev/loop2 0" | dmsetup create roimage-snap-cow
> echo "0 <realsize> snapshot-origin /dev/mapper/roimage-base-real" |
> dmsetup create roimage-base
> echo "0 <realsize> snapshot /dev/mapper/roimage-base-real
> /dev/mapper/roimage-snap-cow n 1" | dmsetup create roimage-cow
>
> mount /dev/mapper/roimage-cow /roimagemntpnt
>
> this is working as the origin device is Read-Only, but we can change files.
>
> so two questions come up
>
> 1 when we delete files, how do we reclaim the space
> 2 should/can we roll the snapshots to reclaim space?
Please consider using thin-pools - this should be giving you the features you
are likely looking for.
Note - you can use thin-pool to hold only snapshots and use your read-only
volume as the external origin for thin volume.
Regards
Zdenek
prev parent reply other threads:[~2024-04-30 20:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-30 17:54 delete on snapshot does not free space Michael DiDomenico
2024-04-30 20:35 ` Zdenek Kabelac [this message]
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=bda0198d-22dd-43fb-bf81-68fb101e596c@gmail.com \
--to=zdenek.kabelac@gmail.com \
--cc=dm-devel@lists.linux.dev \
--cc=mdidomenico4@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.