Code: Select all
In other words, there isn't a "copy files" function in the kernel that automatically makes a "copy on write" copy for all userland tools that copy files.
BTW, some articles on the Web suggest --reflink=always (or just --reflink, which is equivalent to it), but this seems like a bad idea because, according to the "cp" manpage, if you make a mistake (or are calling "cp" programmatically) and use "cp" on a non-CoW filesystem such as ext4 or FAT, then "cp --reflink=always" will fail. The --reflink=auto parameter seems better, since the manpage says it will succeed (making a non-CoW copy) on non-CoW filesystems.
Anyway, I wondered whether Nemo (I'm using version 3.2.2) does CoW copying. I searched in this forum and in the Nemo issue tracker, and didn't find an answer. So here are my test results:
I used the "Duplicate" option in Nemo's right-click menu to copy a folder, containing 100+GB in 50k+ files, to the same 300+GB Btrfs filesystem on a mechanical (spinner) HDD on 6Gbps SATA.
- The copy seemed to go at a speed close to 1GB/second (I didn't actually measure it); to read & write all the data by brute force at 1 gigabyte/s would be more than 16 gigabits/s, which is more than the 6Gbps SATA link.
- The HDD light was off almost the whole time.
- The command-line "df" utility (version 8.23), run before & after the folder duplication, reported the partition as having gained less than 1 percentage point in usage. If the folder had been copied by brute force, the usage would have gone up by some 33 percentage points.