Henu
2010-Jul-14 09:59 UTC
[zfs-discuss] How to calculate space consumption of some snapshots
Hello Among all my snapshots, I''m interested about space consumption of some of them. Is it possible to calculate how much space would be freed if I destroy only some of all snapshots? Henrik Heino
Roy Sigurd Karlsbakk
2010-Jul-14 11:19 UTC
[zfs-discuss] How to calculate space consumption of some snapshots
----- Original Message -----> Hello > > Among all my snapshots, I''m interested about space consumption of some > of them. Is it possible to calculate how much space would be freed if > I destroy only some of all snapshots?zfs list -t snapshot that''ll show you their sizes as well as other details Vennlige hilsener / Best regards roy -- Roy Sigurd Karlsbakk (+47) 97542685 roy at karlsbakk.net http://blogg.karlsbakk.net/ -- I all pedagogikk er det essensielt at pensum presenteres intelligibelt. Det er et element?rt imperativ for alle pedagoger ? unng? eksessiv anvendelse av idiomer med fremmed opprinnelse. I de fleste tilfeller eksisterer adekvate og relevante synonymer p? norsk.
Henu
2010-Jul-14 12:12 UTC
[zfs-discuss] How to calculate space consumption of some snapshots
>> Among all my snapshots, I''m interested about space consumption of some >> of them. Is it possible to calculate how much space would be freed if >> I destroy only some of all snapshots? > > zfs list -t snapshot > > that''ll show you their sizes as well as other details > > Vennlige hilsener / Best regards > > royOkay, let''s think about this situation: machine# zfs get used storage NAME PROPERTY VALUE SOURCE storage used 1,00G - It seems my storage consumes one gigabyte in total, and that sounds logical, since I''ve had one 512MB and two 256MB files in my pool, in different snapshots. There has been file removings, etc., but all of those three files are still there, stored in some snapshots. Now lets list snapshots: machine# zfs list -t snapshot NAME USED AVAIL REFER MOUNTPOINT storage at snapshot_1 18K - 512M - storage at snapshot_2 0 - 769M - storage at snapshot_3 0 - 769M - storage at snapshot_4 0 - 769M - storage at snapshot_5 0 - 769M - This is the important moment. I would like to know how much space would become free if I destroy snapshots 4 and 5. Normally I cannot destroy them, but here, in this test I can. So lets find out: machine# zfs destroy storage at snapshot_5 machine# zfs destroy storage at snapshot_4 And then check used space again machine# zfs get used storage NAME PROPERTY VALUE SOURCE storage used 769M - About 256MB was released, but that number cannot be calculated from those that were given from "zfs list -t snapshot" (0, 0, 769M and 769M). I also tried "zfs list -o all -t snapshot" but that did not give any interesting numbers. I think this is because snapshots 4 and 5 are the only snapshots that contain one 256MB file. If they are examined one snapshot at a time, then it looks like the data is not unique, but if there would be possible to examine them "as a whole", then it would reveal that these two snapshots are the only ones where the file exist. This would mean that when destroying both of them, the file would be destroyed and 256MB would be freed. Henrik Heino