delete on snapshot does not free space

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux