Project

General

Profile

Feature #58950

How can I do cp --reflink?

Added by Keith Campbell 6 months ago. Updated 6 months ago.

Status:
Closed
Priority:
No priority
Assignee:
Alexander Motin
Category:
OS
Target version:
Estimated time:
Severity:
New
Reason for Closing:
Third Party to Resolve
Reason for Blocked:
Needs QA:
No
Needs Doc:
No
Needs Merging:
No
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:
Tags:

Description

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.

History

#1 Updated by Dru Lavigne 6 months ago

  • Assignee changed from Release Council to Alexander Motin

#2 Updated by Alexander Motin 6 months 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.

Also available in: Atom PDF