Mass storage filesystem labels

Hi all, I’ve configured UMS on a Xavier and provided an ext4 filesystem for it to use in read-only mode. I’ve successfully been able to connect a Macbook and read from the filesystem by using osxfuse and ext4fuse, so that’s great. The problem I’m running into is that MacOS is not able to detect any information about the partitions when using diskutil (type, name, etc.). I’ve added a label to the filesystem partition on the Xavier, but seemingly the information does not get communicated when using mass storage mode.

The filesystem I’m pointing to is an M.2 SSD partitioned as ext4, located at /dev/nvme0n1p1.

Am I missing a step in the labeling of my filesystem, is this a limitation with MacOS, or is there something missing in the Xavier configuration?

On the Xavier:

    user@xavier ~  $ df -h
    Filesystem      Size  Used Avail Use% Mounted on
    /dev/mmcblk0p1   28G   14G   13G  51% /
    none            7.7G     0  7.7G   0% /dev
    tmpfs           7.7G   84K  7.7G   1% /dev/shm
    tmpfs           7.7G   22M  7.7G   1% /run
    tmpfs           5.0M  4.0K  5.0M   1% /run/lock
    tmpfs           7.7G     0  7.7G   0% /sys/fs/cgroup
    /dev/nvme0n1p1  912G   22G  844G   3% /var
    tmpfs           1.6G     0  1.6G   0% /run/user/1000
    user@xavier ~  $ sudo lsblk -o NAME,LABEL
    NAME         LABEL
    loop0        data
    ...
    nvme0n1
    |-nvme0n1p1  data
    `-nvme0n1p2
    Disk /dev/nvme0n1: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disklabel type: dos
    Disk identifier: 0x12ca4ad8

    Device         Boot      Start        End    Sectors   Size Id Type
    /dev/nvme0n1p1            2048 1945136560 1945134513 927.5G 83 Linux
    /dev/nvme0n1p2      1945137152 1953525167    8388016     4G 82 Linux swap / Solaris

MacOS:

    ❯❯❯ diskutil list
    /dev/disk0 (internal, physical):
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      GUID_partition_scheme                        *500.3 GB   disk0
       1:                        EFI EFI                     314.6 MB   disk0s1
       2:                 Apple_APFS Container disk1         500.0 GB   disk0s2

    /dev/disk1 (synthesized):
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      APFS Container Scheme -                      +500.0 GB   disk1
                                     Physical Store disk0s2
       1:                APFS Volume Macintosh HD - Data     322.7 GB   disk1s1
       2:                APFS Volume Preboot                 84.5 MB    disk1s2
       3:                APFS Volume Recovery                528.1 MB   disk1s3
       4:                APFS Volume VM                      3.2 GB     disk1s4
       5:                APFS Volume Macintosh HD            11.0 GB    disk1s5

    /dev/disk2 (external, physical):
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:                                                   *995.9 GB   disk2

Unfortunately, we are lacking of the experience of UMS and also MacOS tools. I am even not sure what does UMS stand for here.

I will let other forum users to share their experience.

I’m thinking “USB Mass Storage” (over “gadget”).

If this is gadget, then information on how to export various parts of a drive (or to emulate various parts of a drive) would be valid for any documentation found on the web for that kernel release. Perhaps it is just a matter of needing to provide more details in your gadget details.

Yes, sorry for the lack of clarity. UMS -> USB Mass Storage, using the default l4t-usb-device-mode configuration settings provided as part of the L4T release. In the config script, I’m simply updating

fs_img="/dev/nvme0n1p1"

When you say update the gadget settings, do you mean these fields?

echo 0x0955 > idVendor
echo 0x7020 > idProduct
echo 0x0001 > bcdDevice
echo 0xEF > bDeviceClass
echo 0x02 > bDeviceSubClass
echo 0x01 > bDeviceProtocol

Those fields are just the USB side. In the case of gadget you are exporting emulated devices. Those devices might have an actual device underlying the gadget, but USB is acting as an adapter without directly exposing the driver. Should you talk directly to a disk driver, then I’m sure everything is passed through, but this is not the case…you are talking to the gadget layer, which is filling in some details, and passing through other parts from the actual partition.

I can’t say what, but it is likely either something is not being passed through, or else the Mac is ignoring it. If you believe the Mac is not ignoring this, then what is being passed through is at issue (the gadget layer middleman may have dropped something if you didn’t explicitly say to pass it through).

You might check what happens if you connect to another Linux computer and check with that…if labels show up there, then you know it is limited to the Mac. If labels do not show up, then you know label information was never passed through (Linux will definitely understand this, but Macs may have some obscure feature getting in the way).

Thanks linuxdev. I did confirm that linux hosts see the device labels correctly, so it appears to be a mac-specific thing. I’ll dig more into that side.