JElchison / format-udf

Bash script to format a block device (hard drive or Flash drive) in UDF. The output is a drive that can be used for reading/writing across multiple operating system families: Windows, macOS, and Linux. This script should be capable of running in macOS or in Linux.
GNU General Public License v2.0
518 stars 48 forks source link

When format-udf is run on OS X, specified label doesn't show up properly in Ubuntu #11

Closed JElchison closed 4 years ago

JElchison commented 9 years ago

When create on OS X, the label shows up in Ubuntu as something like:

MacOS X UDF 2015-02-20 1304.44
tloimer commented 7 years ago

On Archlinux, the label set with the "--lvid" option to mkudffs is used. Perhaps, in format-udf, --vid and --lvid shoud be used. Maybe, this also resolves the issue with Ubuntu MATE. ... Sorry, now I see that both options are always used.

pali commented 7 years ago

This is problem with older version (before 2.26) of libblkid library (from util-linux project). Older version read label from UDF vid (volume identifier) instead of UDF lvid (logical volume identifier).

And probably Apple's tool for formatting UDF set UDF vid to "MacOS X UDF 2015-02-20 1304.44".

Solution is to upgrading libblkid OR to changing UDF vid to same value as UDF lvid.

walterav1984 commented 4 years ago

This doesn't seem to be an issue anymore for me when using format-udf 1.7.1 on MacOS Yosemite 10.10.5 to format a 1G SDcard with a label called 'SDMAC1GB', the same label shows up in Ubuntu-mate 19.10 amd64 Caja(filemanager) or gnome-disks.

Maybe length or specific characters may change this?

pali commented 4 years ago

Maybe length or specific characters may change this?

No, see my previous post. It was problem in libblkid prior to version 2.26.

walterav1984 commented 4 years ago

Thanks @pali so it seems fixed. Is a specific parameter/flag for calling lvid/vid usefull or setting both just in case?

pali commented 4 years ago

UDF label is stored as LVID. But some older version of software (e.g. old libblkid) used VID as label.

So if you want that label would be correctly parsed also by older versions of software it is needed to set also VID. If you have your software everywhere up-to-date, LVID is enough.

Also recent version of Linux's mkudffs (2.0+) applies various fixups and compatibility options, so formatted disk device would be properly read and detected also by older software. E.g. it contains logic also of this format-udf script, therefore recent mkudffs on Linux is enough and format-udf wrapper is not needed anymore.

For technical details, you can read mkudffs mapage, specially sections: LINUX LABEL BUGS, WHOLE DISK VS PARTITION and BLOCK SIZE. Some information about UDF label is also in udflabel manpage, e.g. in section UDF LABEL AND UUID.

Hope that this helps you.

JElchison commented 4 years ago

Closing per @walterav1984's previous comment.

FYI, format-udf (this project) sets both --lvid="$LABEL" --vid="$LABEL" when formatting (in Linux). MacOS's newfs_udf only provides -v "$LABEL", as far as I know.