#1004476 mv: add reflink option

Package:
coreutils
Source:
coreutils
Description:
GNU core utilities
Submitter:
Matthias Urlichs
Date:
2022-04-09 11:09:07 UTC
Severity:
wishlist
#1004476#5
Date:
2022-01-28 12:07:25 UTC
From:
To:
Moving files between btrfs subvolumes doesn't work because they're
different volumes.

However, it's possible to reflink the files to their new location, then
remove the original.

Rather than forcing the user to do the cp+rm dance that -- in the distant
past -- was required to move files between different hard disks, please add
an option to /bin/mv to use (or try using) reflinks for moving files.

Using reflinks automatigally when a "normal" rename(2) fails may be a
sensible default, but should be turnoffable.

#1004476#10
Date:
2022-02-27 20:29:11 UTC
From:
To:
mv should already be doing this since v8.24
https://github.com/coreutils/coreutils/commit/b47231be6

Note we switched from BTRFS_IOC_CLONE to the more general FICLONE
in v8.26, though that should be supported by BTRFS:
https://github.com/coreutils/coreutils/commit/89e1fef97

Could you provide an strace of the failing reflink.

thanks,
Pádraig

#1004476#15
Date:
2022-04-09 11:06:46 UTC
From:
To:
mv has used reflinks by default since 2014
#1004476#20
Date:
2022-04-09 11:06:46 UTC
From:
To:
mv has used reflinks by default since 2014