1

This is the procedure that I am currently using to incrementally backup my btrfs partition to an external drive. The issue im having is that the qgroup is still showing the deleted subvolume even after I run rescan (btrfs quota rescan /media/BTRFS).

Move the backup to backup-old on both the BTRFS and the ext hdd

mv /media/BTRFS/BTRFS-RO /media/BTRFS/BTRFS-RO-OLD
mv /media/EXT_BACKUP_DRIVE/BTRFS-RO /media/EXT_BACKUP_DRIVE/BTRFS-RO-OLD

Create a new read-only snapshot

btrfs su sn -r /media/BTRFS /media/BTRFS/BTRFS-RO

Sync the changes

sync

Send the changes to the external drive

btrfs send -p /media/BTRFS/BTRFS-RO-OLD /media/BTRFS/BTRFS-RO | btrfs receive /media/EXT_BACKUP_DRIVE

Delete the old (no longer needed subvolume)

btrfs subvolume delete /media/BTRFS/BTRFS-RO-OLD
btrfs subvolume delete /media/EXT_BACKUP_DRIVE/BTRFS-RO-OLD

This is the subvoume list before delete

btrfs subvolume list /media/BTRFS ID 257 gen 61392 top level 5 path BigDrive ID 7146 gen 38871 top level 257 path BTRFS-RO-OLD ID 7231 gen 60344 top level 257 path BTRFS-RO

qgroupid         rfer         excl
--------         ----         ----
0/5          16.00KiB     16.00KiB
0/257         4.81TiB      1.49GiB
0/7146        4.73TiB      9.63GiB
0/7230       64.00KiB     16.00EiB
0/7231        4.81TiB     22.46MiB

and after delete

btrfs subvolume list /media/BTRFS
ID 257 gen 61418 top level 5 path BigDrive
ID 7231 gen 60344 top level 257 BTRFS-RO

qgroupid         rfer         excl
--------         ----         ----
0/5          16.00KiB     16.00KiB
0/257         4.81TiB      1.49GiB
0/7146       16.00KiB     16.00EiB
0/7230       64.00KiB     16.00EiB
0/7231        4.81TiB     22.48MiB
0

Looks like I found the answer by:

btrfs qgroup destroy 0/7146 /media/BTRFS

Would this have any negative consequences for the data?

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.