Re: snapshot space use

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

 



On Thu, 9 Apr 2015 12:39:33 AM Russell Coker wrote:
> # zfs list -t snapshot
> NAME                        USED  AVAIL  REFER  MOUNTPOINT
> hetz0/be0-mail@2015-03-10  2.88G      -   387G  -
> hetz0/be0-mail@2015-03-11  1.12G      -   388G  -
> hetz0/be0-mail@2015-03-12  1.11G      -   388G  -
> hetz0/be0-mail@2015-03-13  1.19G      -   388G  -
> hetz0/be0-mail@2015-03-14  1.02G      -   388G  -
> hetz0/be0-mail@2015-03-15   989M      -   386G  -
> 
> Is there any way to do something similar to the above ZFS command?  It's
> handy to know which snapshots are taking up the most space, especially
> when multiple subvols are being snapshotted.

Quota isn't really what I want.  What I don't want is to go to all the effort 
of creating quotas on snapshots (and the risk of using such features) just for 
the ability to see disk usage IF I want it.  What I want is to have it just 
work as it does in ZFS.  In the above example I can see that I can free 2.88G 
of disk space by removing the oldest snapshot, this is useful.

btrfs sub find-new $SNAPSHOT $LASTGEN | 
awk '{total = total + $7}END{print total}'

The above command gives a total of the lengths of extents that changed in a 
snapshot.  Of course the total length isn't going to be the total space used 
(it doesn't count metadata used or space saved through compression), but it 
does give an idea.  Thanks Hugo for the tip in another thread.

-- 
My Main Blog         http://etbe.coker.com.au/
My Documents Blog    http://doc.coker.com.au/
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux