udftools icon indicating copy to clipboard operation
udftools copied to clipboard

Read-only clarification

Open CyprusSocialite opened this issue 2 years ago • 5 comments

Hi!

This is not technically an 'Issue' but there really is nowhere else for me to ask.

I am struggling to understand how the --read-only option is supposed to work. It seems that using it will result in a new, empty and also immediately unwritable filesystem. What's the use, then?

Personally I am setting up some UDF partitions on my usb, and I would like to protect some of them from writing, but only after I've put some files there that can be read. Is there a way to accomplish this?

Thank you

CyprusSocialite avatar Jan 15 '23 00:01 CyprusSocialite

The purpose of mkudffs --read-only is to set into UDF filesystem "metadata" some flags which treat filesystem as readonly. I agree that this option as alone is not very useful. If there would be mkudffs option to put files/dirs during generating filesystem then it makes more sense (I was planning to implement this in past but I have not done it yet). Or if there is a tool which can set or clear those flags. Or if there was a tool which can put files into such filesystem and ignoring read-only flags. IIRC currently there no such tool is written yet.

pali avatar Jan 15 '23 01:01 pali

Just a guess, but doesn't udflabel edit metadata of existing UDF filesystems? So maybe the flag could be added/edited in a similar way...

CyprusSocialite avatar Jan 15 '23 18:01 CyprusSocialite

You are right. I was planning to write some udftune tool (based on the the udflabel code) which can set different flags like this but I have not done it yet.

pali avatar Jan 15 '23 18:01 pali

If you are interested to write such tool, feel free to do it.

pali avatar Mar 04 '23 12:03 pali

I am in need of this feature, and tried to scratch my own itch.

The most logical place (that already exists :)) for such a feature to implement is udflabel (since it modifies the on-disc structure of existing UDF data) - so I did the least amount of work to make that support setting a UDF device/file system "read-only" after the fact in https://github.com/pali/udftools/pull/62

I hope you find this contribution useful, and will consider merging it :) If there's any changes you would suggest or require to do so, please let me know.

jtru avatar Apr 23 '23 13:04 jtru