All of lore.kernel.org
 help / color / mirror / Atom feed
* grub-mkrescue: The blkid LABELs of its ISO 9660, HFS+, FAT filesystems
@ 2019-12-18 18:24 Thomas Schmitt
  2020-01-17 13:25 ` Daniel Kiper
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Schmitt @ 2019-12-18 18:24 UTC (permalink / raw)
  To: grub-devel

Hi,

during tests about the changes in blkid which are still discussed in
  https://github.com/karelzak/util-linux/pull/913
i noted that a grub-mkrescue ISO for x86 BIOS and EFI shows the same
filesystem label with its ISO 9660 and HFS+ filesystem superblocks.

  # lsblk -o NAME,FSTYPE,LABEL /dev/sdd
  NAME   FSTYPE  LABEL
  sdd    iso9660 ISOIMAGE
  ├─sdd1
  ├─sdd2 vfat
  ├─sdd3 hfsplus ISOIMAGE
  └─sdd4

On Linux this causes a name collision when udev creates /dev/disk/by-label
links. Usually HFS+ wins. But that's not guaranteed.

The label identity is currently hardcoded in libisofs. The code stems from
Vladimir Serbinenko. I am in charge of maintaining it, though.
See
  https://sources.debian.org/src/libisofs/1.5.2-1/libisofs/hfsplus.c/#L1632

  ret = set_hfsplus_name (target, target->image->volume_id,
                          &target->hfsp_leafs[target->hfsp_curleaf]);

It looks like the Volume Id from the libisofs ISO 9660 model is set as
name of HFS+ node target->hfsp_leafs[0]. I guess this is the root node.

Whatever, it is the only occurence of volume_id in Vladimir's code.
Thus this line must be the gateway of "LABEL" between libisofs settings
and HFS+ metadata production. ("ISOIMAGE" is the default Volume Id of
xorriso.)

--------------------------------------------------------------------------

So what to do ?

[ ] Leave both labels identical and continue to confuse users via udev.

[ ] Change HFS+ LABEL automatically by adding "_HFSPLUS" to the upto 32
    characters of Volume Id.

[ ] Have independent setting and default of HFS+ LABEL in libisofs.
    This is most flexible but also creates new duties for the users of
    grub-mkrescue, if both LABELs have to be unique in comparison to other
    filesystems on other devices.

I would vote for the middle alternative, if i had any experience with HFS+
beyond hosting Vladimir's code in libisofs.

Vladimir ? Anybody else with HFS+ experience ?

--------------------------------------------------------------------------

Further:

Should grub-mkrescue give the EFI FAT filesystem a LABEL, too ?

man mformat says about option -v
   v      Specifies the volume label. A volume label identifies  the  disk
          and  can  be  a  maximum  of  11  characters. If you omit the -v
          switch, mformat will assign no label to the disk.

"GRUBMKR_EFI" ?

On the other hand, no LABEL means no label problems.


Have a nice day :)

Thomas



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-01-17 15:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-18 18:24 grub-mkrescue: The blkid LABELs of its ISO 9660, HFS+, FAT filesystems Thomas Schmitt
2020-01-17 13:25 ` Daniel Kiper
2020-01-17 15:36   ` Thomas Schmitt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.