How to check if thin volume or snapshot was ever activated
Dear all,
as you know, a thin snapshot does have the "k" (skip activation) flag set, so one has to force activation by ignoring the flag (or removing the flag itself).
I wonder: can we detect if a volume/snapshot was *ever* activated? My reasoning is that a never-activated snapshot surely did not receive any application writes, so it can be safely removed (ignoring snapshot retention policy).
Regards.
Signature · 11 lines
Danti Gionatan Supporto Tecnico Assyoma S.r.l. - www.assyoma.it email: [email protected] - [email protected] GPG public key ID: FF5F32A8 _______________________________________________ linux-lvm mailing list [email protected] https://listman.redhat.com/mailman/listinfo/linux-lvm read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
Quoted 10 lines · Gionatan Danti
Dear all,
as you know, a thin snapshot does have the "k" (skip activation) flag set, so one has to force activation by ignoring the flag (or removing the flag itself).I wonder: can we detect if a volume/snapshot was *ever* activated? My reasoning is that a never-activated snapshot surely did not receive any application writes, so it can be safely removed (ignoring snapshot retention policy).
It sounds like you intend to keep snapshots that have been updated (written) since its creation, right?
The precise way might be checking the data mappings via thin_dump. An updated device has data mappings with timestamps greater than the device's creation time.
Checking device activation might not meet what you need. An activated device might or might not receive any write, so you don't know whether a device has been updated by looking into its activation history.
_______________________________________________
linux-lvm mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
Quoted 8 lines · Ming-Hung Tsai
Quoted 5 lines · Gionatan Danti
I wonder: can we detect if a volume/snapshot was *ever* activated? My reasoning is that a never-activated snapshot surely did not receive any application writes, so it can be safely removed (ignoring snapshot retention policy).
Quoted 4 lines
It sounds like you intend to keep snapshots that have been updated (written) since its creation, right?
The precise way might be checking the data mappings viathin_dump. An updated device has data mappings with timestamps greater than the
^^^^^^^^^^^^
Quoted 1 line
device's creation time.
sorry, I mean "greater than or equal to"
_______________________________________________
linux-lvm mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
Il 2021-08-09 05:53 Ming-Hung Tsai ha scritto:
Quoted 2 lines
It sounds like you intend to keep snapshots that have been updated (written) since its creation, right?
True.
Quoted 3 lines
The precise way might be checking the data mappings via
thin_dump. An updated device has data mappings with timestamps greater than the device's creation time.
Interesting approach, thanks.
Quoted 3 lines
Checking device activation might not meet what you need. An activated device might or might not receive any write, so you don't know whether a device has been updated by looking into its activation history.
Sure, but it can be a reasonable approximation before further inspection. Also, I wonder if dumping data mappings can be slow for big volumes.
Thanks.
Signature · 11 lines
Danti Gionatan Supporto Tecnico Assyoma S.r.l. - www.assyoma.it email: [email protected] - [email protected] GPG public key ID: FF5F32A8 _______________________________________________ linux-lvm mailing list [email protected] https://listman.redhat.com/mailman/listinfo/linux-lvm read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
A message that is not in the archive (sent off-list or not yet received): CAAYit8RWCA3W0y4vuZju6aZVSeu7e6SjErkZ1orLceJj0nhsvw@mail.gmail.com
Il 2021-08-10 10:40 Ming-Hung Tsai ha scritto:
Quoted 8 lines
It depends on the number of thin volumes and the space utilization. A selective dump might also help, e.g.,
# thin_dump <metadata> --dev-id <thin-id1> --dev-id <thin-id2> ...The thin-ids could be obtained from lvs, using listing:
# lvs -o lv_name,vg_name,thin_id or querying: # lvs -o thin_id --select <criteria> --noheadings
Greatly appreciated, thanks!
Signature · 11 lines
Danti Gionatan Supporto Tecnico Assyoma S.r.l. - www.assyoma.it email: [email protected] - [email protected] GPG public key ID: FF5F32A8 _______________________________________________ linux-lvm mailing list [email protected] https://listman.redhat.com/mailman/listinfo/linux-lvm read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/