Welcome to Vifm Q&A, where you can ask questions about Vifm usage. Registration is optional, anonymous posts are moderated. GitHub or Google logins are enabled.

Can Vifm support cp --reflink=auto?

0 votes
asked Nov 10, 2015 in vifm by aleksejrs

I use btrfs, and you can make a copy-on-write "copy", that's something like a hardlink until you modify one of the copies. That makes the copy less backup-like, but it is much faster. Vifm 0.7.8 does not seem to do it.

1 Answer

+1 vote
answered Nov 10, 2015 by xaizek
edited Nov 11, 2015 by xaizek

I wasn't aware of this feature of btrfs. It seems to be quite easy to implement for both 'syscalls' and 'nosyscalls' cases, so this should be in the next version and will require enabling some option (as it's set to never by default in cp).

commented Nov 10, 2015 by aleksejrs

FWIW, it also applies to mv, where reflink=auto may be the default recently (coreutils 8.24?): https://lists.gnu.org/archive/html/coreutils/2014-09/msg00002.html

I have a Bash alias defined, adding "reflink=auto" to cp. Maybe Vifm could detect that (even if optionally)?

commented Nov 10, 2015 by xaizek

Then maybe just use auto by default, this would make it simpler. Moving between mount boundaries is just copy+delete, so it will work automatically.

aliases are not exported by shells and parsing configuration of a shell is problematic, this can't be done properly by Vifm on its own.

commented Nov 12, 2015 by xaizek

In master now. I ended up adding an option 'iooptions', so one needs to set it to fastfilecloning, linked message raises valid concern about unexpected slowdown due to COW and I don't want fix the behaviour.

If you would like to make a bug report or feature request consider using GitHub, SourceForge or e-mail. Posting such things here won't be considered as spam, but this is not a perfect place for it.
...