udisks
udisks copied to clipboard
Improve UDF support
As stated in https://github.com/storaged-project/udisks/issues/338 there are some improvements for current code which format disk to UDF:
- Allow choosing media type or do some detection (currently it is hardcoded to HD media type)
- Allow choosing UDF revision (currently hardcoded to 2.01)
- Prefer formatting UDF on whole disk as is without MBR or GPT partitioning (this is what UDF specification expect)
- Fix processing label support
- mkudffs prior to version 1.1 can work only with ASCII characters in label
- --vid is limited to string with maximally 30 Unicode code points and only 15 if there is at least one above U+FF (Beware UTF-8 byte != Unicode code point)
- --lvid is limited to 126 resp 63.
- --vid and --lvid should be non-empty, which means that UDF partition always should have label
Just to note, UDF filesystem should be formatted on whole unpartitioned media without using MBR or GPT table. Otherwise disk would not be readable on e.g. Apple systems. Apple systems do not recognize UDF fileysystem on MBR or GPT partition.
For more details please look into mkudffs manpage, section WHOLE DISK VS PARTITION.
So udisks UDF formatting implementation is not currently compatible for cross OS support.
Just to note, UDF filesystem should be formatted on whole unpartitioned media without using MBR or GPT table. Otherwise disk would not be readable on e.g. Apple systems. Apple systems do not recognize UDF fileysystem on MBR or GPT partition.
For more details please look into mkudffs manpage, section WHOLE DISK VS PARTITION.
So udisks UDF formatting implementation is not currently compatible for cross OS support.
This is a caller responsibility, we don't (want to) carry this complex logic in UDisks, this belongs to a higher level above. UDisks will allow you to call org.freedesktop.UDisks2.Block.Format() where suitable.
Just to note, UDF filesystem should be formatted on whole unpartitioned media without using MBR or GPT table...
This is a caller responsibility...
Ok, could you in this case put into udisks document how callers should use udisks to correctly format disk to UDF filesystem?
Okay, so there are some related changes planned for UDisks 2.10 series. Filesystem definition, defaults and mkfs-related stuff is getting moved to libblockdev, see related https://github.com/storaged-project/libblockdev/pull/583 and https://github.com/storaged-project/libblockdev/pull/585 pull requests. The default options are set to mkudffs --utf8 --blocksize=<detected_by_libblockdev> --media-type=hd --udfrev=0x201. The label restrictions are set as described.
What's currently missing in UDisks is ability to provide extra options for the org.freedesktop.UDisks2.Block.Format() method call. Options that would be passed to corresponding mkfs tool for a given filesystem. No extra checks will be put in place, it's always a caller responsibility to provide extra options that would not conflict with our defaults (an option to bypass our defaults is also being considered). Security should be guaranteed by PolicyKit rules and again it's caller responsibility to provide sane options that would not destroy his system.
I believe this would cover all the points requested in this ticket.
The label restrictions are set as described.
Seems they are implemented incorrectly. I wrote comments to that pull request.
I believe this would cover all the points requested in this ticket.
So the remaining thing is how to handle that requirement that UDF needs to be formatted on whole unpartitioned media without GPT/MBR scheme as required by UDF specification (and also enforced by Apple implementation).