NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
fb2k6
Jun 14, 2015Aspirant
What does cp --reflink command actually do?
I've read about moving files more quickly within subvolumes in OS6 using the "cp -a --reflink" command in the thread shown on the bottom of this post. I have a few questions about this command. 1)...
StephenB
Jun 14, 2015Guru - Experienced User
No. The metadata (directory information) in the source and destination folders both initially point to a single copy of the data. Note this is not the same as a symlink. A symlink is a way to have two different folders share the same file. cp --reflink creates two files that initially share the same data blocks.
fb2k6 wrote: 1) Is a physical copy actually made of the original files/folders when I use this command?
No. "Copy on write" means that when you modify copy A, then new data blocks are written for the parts you changed. Copy B will remain as it was. If you then change part of Copy B, new data blocks are written for them also. So from user perspective, they are two different copies.
fb2k6 wrote: 3) If I forget to delete the original source files/folders before issuing the command, do I need to worry about data integrity when I modify the same files from each of those folders
From a system perspective, when you change copy A it becomes fragmented, and defrag cannot fix it until copy B is deleted. Also, since A and B share the same disk space, when you back up A and B the backup will take up more space than the two on-disk copies. So if you do a lot of this, you'd need a bigger backup drive than the NAS volume size. Both of these issues also apply to snapshots.
Deleting the originals eliminates the two system implications above.
fb2k6 wrote: 2) How important is it to delete the original files/folders after issuing the command?
Related Content
NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!