Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
public:btrfs_snapshot_size [2016/04/01 00:41] fangfufu |
public:btrfs_snapshot_size [2018/03/31 00:38] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== BTRFS snapshot size ====== | ||
+ | * First you need to enable quota | ||
+ | <code bash> | ||
+ | sudo btrfs quota enable /home | ||
+ | </code> | ||
+ | * You need to wait for BTRFS so scan the filesystem for quota usage, then | ||
+ | <code bash> | ||
+ | sudo btrfs qgroup show /home | ||
+ | </code> | ||
+ | * You get output which looks like this: | ||
+ | <code> | ||
+ | qgroupid rfer excl | ||
+ | -------- ---- ---- | ||
+ | 0/5 142.21GiB 89.70MiB | ||
+ | 0/410 96.00KiB 96.00KiB | ||
+ | 0/2191 17.62GiB 0.00B | ||
+ | 0/3237 137.90GiB 4.05GiB | ||
+ | </code> | ||
+ | ''qgroupid'' is the snapshot ID, ''rfer'' is the total size of that snapshot (the size of the parent subvolumes are included), ''excl'' is the exclusive space that particular snapshot occupies. | ||
+ | ===== Deleting snapshots ===== | ||
+ | |||
+ | |||
+ | * You can list all the subvolume by running this: | ||
+ | <code bash> | ||
+ | sudo btrfs subvolume list /home | ||
+ | </code> | ||
+ | Note that this will display the link between the ''BTRFS_SNAPSHOT_ID'' and ''SNAPPER_SNAPSHOT_ID''. | ||
+ | |||
+ | * Note that if you are using snapper, you should delete snapshots using: | ||
+ | <code bash> | ||
+ | snapper -c home delete $SNAPPER_ID | ||
+ | </code> | ||
+ | You shouldn't delete the snapshot using ''btrfs subvolume delete'', as this will confuse Snapper. | ||
+ | |||
+ | ===== Re-initialise qgroups ===== | ||
+ | If your filesystem has just suffered an episode of catastrophic failure, you might need to re-initialise things. A Snapper rollback can cause it. | ||
+ | <code bash> | ||
+ | for i in $(btrfs qgroup show /home | tail -n+3 | cut -d ' ' -f 1); do btrfs qgroup destroy $i /home; done | ||
+ | btrfs quota disable /home | ||
+ | btrfs quota enable /home | ||
+ | </code> |