Skip to content

files cache: index by physical extents to support reflinks & snapshots #2743

@alphazo

Description

@alphazo

XFS has implemented some new (experimental) exciting features such as reflink that allows instant CoW snapshots similar to what is found on btrfs. I don't think there is a plan to support send/receive commands like on ZFS so the dedup function is pretty much limited to the local filesystem.
I'm envisioning to use the following scheme for my external USB drive that contains my photos and that I usually backup on a second drive or network storage using borg. This applies to both btrfs and the new reflink enabled xfs.

  • While on the move and without network connectivity or access to my borg drive, I can, before working on the pictures, perform instant pseudo snapshots (not like the snapshots found on btrfs) without eating precious hard drive space.
    # cp -r --reflink=always /mnt/usbdrive/photos /mnt/usbdrive/snapshots/snap01

  • When I'm back home I can connect my photo drive and my backup drive to my PC and initiate a borg backup.
    # borg create /mnt/backupdrive/borg::borg-snap1 /mnt/usbdrive

So the borg-snap1 snapshot will contain all the different snapshots I performed while away from home plus the working directory. But since borg doesn't know about the reflink feature it will rescan each of the files found in each snapshot found on my photo drive thinking they are new files but will ultimately find corresponding known dedup blocks so it will effectively not copy over each of the btrfs/xfs pseudo snapshot. I tried it and the size of my photo directore + many snapshots of the same pictures gave pretty much the size of the photo directory on the borg snapshot which is great.
I was wondering it there would be a way to have a new feature in borg to detect such reflink enabled filesystems (btrfs/xfs) so it would immediately know that a file found in a btrfs/xfs directory is a duplicate of an existing known one and therefore use the same dedup blocks.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions