* delete on snapshot does not free space
@ 2024-04-30 17:54 Michael DiDomenico
2024-04-30 20:35 ` Zdenek Kabelac
0 siblings, 1 reply; 2+ messages in thread
From: Michael DiDomenico @ 2024-04-30 17:54 UTC (permalink / raw)
To: dm-devel
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?
- if i wanted to create a new snapshot and discard the existing one,
do i basically just to the fourth step again to a different device? i
haven't found a "clear" how-to on this. most people just stop after
the fourth line and then tear it all down
ideally what i'm looking to do is create a filesystem where the base
is read-only, but we can make changes. i'm okay with all those
changes getting lost after a reboot/unmount/etc. the issue right now
is when df shows 100% usage it seems the only recourse is reboot(aka
clear it all out) and restart. i'm hoping there's something more
graceful
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: delete on snapshot does not free space
2024-04-30 17:54 delete on snapshot does not free space Michael DiDomenico
@ 2024-04-30 20:35 ` Zdenek Kabelac
0 siblings, 0 replies; 2+ messages in thread
From: Zdenek Kabelac @ 2024-04-30 20:35 UTC (permalink / raw)
To: Michael DiDomenico, dm-devel
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-04-30 20:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-30 17:54 delete on snapshot does not free space Michael DiDomenico
2024-04-30 20:35 ` Zdenek Kabelac
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.