[parted-devel] [PATCH] libparted: Add support for MBR id and GPT GUID of UDF filesystem

Pali Rohár pali.rohar at gmail.com
Wed Aug 22 19:38:28 BST 2018


On Wednesday 22 August 2018 09:19:29 Pali Rohár wrote:
> On Tuesday 21 August 2018 14:30:16 Phillip Susi wrote:
> > On 8/19/2018 4:26 PM, Pali Rohár wrote:
> > > UDF detection is not simple when you want to do it correctly. But later
> > > I can implement it. What probe function needs to return? Just true/false
> > > if device is a UDF filesystem? Or it needs to return also some metadata?
> > 
> > It doesn't just have some magic number at some offset you can look for
> > to say yep, that looks like UDF?
> 
> Yes and no. Offset is according to anchor block descriptor and location
> of this block of course depends on UDF fs block size. Plus there are 4
> possible locations of anchor. But there is just a finite number of
> possible locations and finite number of possible file system block
> sizes. So it is not a problem, just "correct" implementation needs to
> check all possible combinations -- and I hope you want "correct"
> implementation :-)

Hi! I tried to implement it correctly. In attachment is a simple program
which check if input file is UDF filesystem or not.

But I do not know to easily re-write it to parted API as for reading
buffer there is just ped_geometry_read() function. Which does not take
offset in bytes, but in number of sectors. Anyway, if you have some idea
how to do it easily let me know...

-- 
Pali Rohár
pali.rohar at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: isudf.c
Type: text/x-csrc
Size: 4833 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/parted-devel/attachments/20180822/c306f6aa/attachment.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/parted-devel/attachments/20180822/c306f6aa/attachment.sig>


More information about the parted-devel mailing list