0

I would like to set up a union mount with aufs such that new files can be created on a writable branch, but existing files cannot be modified. Is it possible to disable copy on write so that if an attempt is made to modify a file that already exists on one of the branches it fails?

gregsymons
  • 103
  • 1

1 Answers1

0

What you are asking for isn't possible in the event that a user has root level access since they'll be able to perform block level operations on the hard drive. See Write once, read many (WORM) using Linux file system.

If you are looking for something a bit more generic and only for exporting via NFS or the like you can possibly use aufs with the immutable bit set on fixed branch and periodically sweep over any changes made to your writable branch and set the immutable flag.

Tim Brigham
  • 15,465
  • 7
  • 72
  • 113
  • That's pretty much the conclusion I came to, as well. If no one else posts a better answer in the next week or so, I'll accept this as the answer. – gregsymons Dec 03 '13 at 20:35
  • @TimBrigham There was absolutely no need to mention that directly writing to the hard drive can be used to bypass such a feature. The feature requested in the question is still useful. – Melab Feb 08 '21 at 02:46