markfasheh / duperemove

Tools for deduping file systems
GNU General Public License v2.0
816 stars 81 forks source link

Effects of -A option on read/write enabled subvolumes? #86

Closed Claes1981 closed 8 years ago

Claes1981 commented 9 years ago

Hi,

I have a question about the "-A" option of Duperemove. According to the manual it "Opens files readonly when deduping. Primarily for use by privileged users on readonly snapshots." It seems like you have to use this option if you want to dedupe readonly snapshots.

Are there any difference in the result or effects on the files of read/write enabled subvolumes when running Duperemove with the "-A" option, versus running Duperemove without the "-A" option? (For example dedupe over both read/write enabled /subvolumeA and readonly /subvolumeA/.snapshots/snapshot1.)

If there are no difference in the results, why are files not always open readonly when deduping? (No need of an "-A" option.) Perhaps is it slower?

markfasheh commented 8 years ago

Hi this is because the kernel will only allow dedupe of files open for read if you are the root user, so by default we open for write. On a readonly snapshot though, this can be a problem so -A forces duperemove to always open for read.

markfasheh commented 8 years ago

There's more detail on the problem in https://github.com/markfasheh/duperemove/issues/129, I'm going to close this issue and keep that one open until we have a resolution. Thanks.