I have a file that is open by a program for writing (it's a log4j log). I want to test a theory about what happens if the file system becomes read-only while the file is still open. I haven't been able to re-mount the file system (because it is 'busy'), is there a way I can force that file to no longer be writable--even to the processes that already have it open?

I believe the filesystem is ext3.

  • Have you tried the obvious? sudo chattr +i filename? – MariusMatutiae Oct 11 '13 at 15:20
  • @MariusMatutiae Yes. The open process was still able to write to the file. – Michael Deardeuff Oct 11 '13 at 16:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.