How can I do cp --reflink?
I'm running FreeNAS-11.1-U6
It would be nice if FreeNAS supported (through the underlying ZFS filesystem and FreeBSD utilities) something like
cp --reflink which enables files to be copied instantly (initially the two copies refer to the same underlying storage, but blocks are copied lazily when they are updated (copy-on-write semantics)). My understanding is that the latest ZFS module has native support for this.
Currently, when I attempt to do this from an NFS share, I get:
%> cp --reflink a b cp: failed to clone 'b' from 'a': Inappropriate ioctl for device
On the FreeNAS FreeBSD OS, the
cp utility doesn't have the
--reflink flag. Is there some other way to accomplish this?
Pool-level deduplication would accomplish this same effect, but it slows down performance and you advise against using it in your graphical interface for that reason. Snapshots would not be appropriate for my use case since I want to effectively deduplicate files without changing the filesystem presentation from the users' point of view.
#2 Updated by Alexander Motin over 1 year ago
- Status changed from Unscreened to Closed
- Target version changed from Backlog to N/A
- Reason for Closing set to Third Party to Resolve
- Needs QA changed from Yes to No
- Needs Doc changed from Yes to No
- Needs Merging changed from Yes to No
While I agree this functionality would be very useful in some cases, I don't think it is easy to implement for ZFS. I see it was discussed on ZoL for many years and still open (https://github.com/openzfsonosx/zfs/issues/647). It briefly mentions that Oracle implemented that in their ZFS somehow, but that is closed source. We would be happy to integrate that functionality into FreeBSD and FreeNAS once it would be available, but we don't have significant own manpower right now to implement it.