0

All in the title. My problem is, I have an ExFAT partition on my disk that I want to mount using a UUID, but I can't seem to find any information on it.

fdisk -l says:

[logandark@arch-base ~]$ sudo fdisk -l
Disk /dev/nvme0n1: 1.75 TiB, 1920383410176 bytes, 3750748848 sectors
Disk model: Aura Pro X2                             
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: gpt
Disk identifier: 97D5F803-8142-4F64-AF7D-0246B6A26DD8

Device              Start        End   Sectors   Size Type
/dev/nvme0n1p1         40     409639    409600   200M EFI System
/dev/nvme0n1p2     409640  879315887 878906248 419.1G Apple APFS
/dev/nvme0n1p3 3331319808 3750748159 419428352   200G Microsoft basic data
/dev/nvme0n1p4  879316992  931745791  52428800    25G Linux filesystem
/dev/nvme0n1p5  931745792  933842943   2097152     1G Microsoft basic data

Partition table entries are not in disk order.

I want to automatically mount /dev/nvme0n1p5 in my /etc/fstab, but I don't want to use /dev/nvme0n1p5 as the identifier.

So, first attempt to find the UUID of that partition:

[logandark@arch-base ~]$ sudo fdisk -l /dev/nvme0n1p5
Disk /dev/nvme0n1p5: 1 GiB, 1073741824 bytes, 2097152 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: 0xf4f4f4f4

Here are my attempts to mount using that:

[logandark@arch-base ~]$ sudo nano /etc/fstab
[logandark@arch-base ~]$ sudo mount -a
mount: /mnt/transfer: can't find UUID=0xf4f4f4f4.
[logandark@arch-base ~]$ sudo nano /etc/fstab
[logandark@arch-base ~]$ sudo mount -a
mount: /mnt/transfer: can't find UUID=f4f4-f4f4.
[logandark@arch-base ~]$ sudo nano /etc/fstab
[logandark@arch-base ~]$ sudo mount -a
mount: /mnt/transfer: can't find UUID=4f4f-4f4f.
[logandark@arch-base ~]$ sudo nano /etc/fstab
[logandark@arch-base ~]$ sudo mount -a
mount: /mnt/transfer: can't find UUID=4F4F-4F4F.
[logandark@arch-base ~]$ sudo nano /etc/fstab
[logandark@arch-base ~]$ sudo mount -a
mount: /mnt/transfer: can't find UUID=F4F4-F4F4.

Okay, well that was a bust. Let's try to find the UUID other ways.

[logandark@arch-base ~]$ blkid
/dev/nvme0n1p1: LABEL_FATBOOT="EFI" LABEL="EFI" UUID="67E3-17ED" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="6646a281-b597-4238-bdb2-7d66f89bc423"
/dev/nvme0n1p2: UUID="b5b8a23d-92b5-4707-b62f-bdbce5cd59f9" BLOCK_SIZE="4096" TYPE="apfs" PARTLABEL="Customer" PARTUUID="08b0857a-52c8-4480-9271-29dc39cee4a5"
/dev/nvme0n1p3: LABEL="BOOTCAMP" BLOCK_SIZE="512" UUID="01D5F4B01A92AFE0" TYPE="ntfs" PARTLABEL="BOOTCAMP" PARTUUID="234ffad0-1c6a-4001-8cf7-1f08b702c8e0"
/dev/nvme0n1p4: LABEL="Arch" UUID="c82b4a77-2ff5-4545-9882-f917a9e2cf4d" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="73602c6d-07dd-a24e-8875-85c752eb62d4"

No entry for nvme0n1p5? Interesting...

[logandark@arch-base ~]$ ls -l /dev/disk/by-uuid/
total 0
lrwxrwxrwx 1 root root 15 Aug 26 22:45 01D5F4B01A92AFE0 -> ../../nvme0n1p3
lrwxrwxrwx 1 root root 15 Aug 26 22:45 67E3-17ED -> ../../nvme0n1p1
lrwxrwxrwx 1 root root 15 Aug 26 22:45 b5b8a23d-92b5-4707-b62f-bdbce5cd59f9 -> ../../nvme0n1p2
lrwxrwxrwx 1 root root 15 Aug 26 22:45 c82b4a77-2ff5-4545-9882-f917a9e2cf4d -> ../../nvme0n1p4

Still nothing.

[logandark@arch-base ~]$ ls -l /dev/disk/by-partuuid/
total 0
lrwxrwxrwx 1 root root 15 Aug 26 22:45 08b0857a-52c8-4480-9271-29dc39cee4a5 -> ../../nvme0n1p2
lrwxrwxrwx 1 root root 15 Aug 26 22:45 234ffad0-1c6a-4001-8cf7-1f08b702c8e0 -> ../../nvme0n1p3
lrwxrwxrwx 1 root root 15 Aug 26 22:45 6646a281-b597-4238-bdb2-7d66f89bc423 -> ../../nvme0n1p1
lrwxrwxrwx 1 root root 15 Aug 26 22:45 73602c6d-07dd-a24e-8875-85c752eb62d4 -> ../../nvme0n1p4

Apparently it's possible for a partition to have no GPT GUID either. Sigh...

I'm out of ideas. How do I find the UUID of this partition? Maybe if there is none, I can assign one? I've searched on Google and DDG and I can't for the life of me find any way to actually assign the partition a GPT GUID either, so I'm completely stumped. (Mostly SEO clickbait that only contains tune2fs or lsblk...)

Edit: I've tried assigning a random GUID using gdisk, no luck. How come that didn't work? Are ExFAT partitions special or something? Does this have something to do with the fact that I created the ExFAT partition with fdisk and not gdisk?

3
  • This appears to be off-topic. You may be able to get help on our sister site, Unix & Linux. Aug 27, 2020 at 15:50
  • When you did sudo fdisk -l /dev/nvme0n1p5, you effectively told fdisk to interpret the PBR of the 5th partition as if it was a real classic MBR. The resulting "Disk identifier" is not real: to use it, you would have to force the mount command to make the same mis-interpretation.
    – telcoM
    Aug 28, 2020 at 20:14
  • @telcoM Yeah, I don't feel like "that one exFAT partition" is a good enough identifier either :)
    – Dev
    Aug 28, 2020 at 21:04

2 Answers 2

1

A FAT/vFAT/FAT32/exFAT filesystem does not really have an UUID. What it has is a "volume serial number", usually represented in hexadecimal digits as xxxx-xxxx. This can be used instead of a real filesystem UUID - but apparently the kernel/mount command/other parts of your system responsible for exFAT filesystem support on your system don't support it quite yet.

(The exFAT specification was released to public by Microsoft on August 28, 2019, so the "kernel-level" exFAT support in Linux and the associated tools are going to be less than one year old at this point. The reverse-engineered FUSE-based driver is older and might be more mature, but the kernel-based implementation is expected to catch up.)

But any partition on a GPT-partitioned disk should have a PARTUUID, which is an unique UUID-style identifier stored not in the filesystem itself, but in the partition table. It should be just as usable for specifying the filesystem for mounting.

Run lsblk -o +PARTUUID to see the partition UUIDs. You should be able to use it in /etc/fstab, just specify it as PARTUUID=... instead of UUID=...

3
  • Here's the thing though - that partition does not have a PARTUUID. Indeed, I attempted to find it, but it is not there. Here is a haste since SE comments aren't great for this: hastebin.com/kaloqevuho.txt - is there a way for me to assign a PARTUUID since there isn't any already there?
    – Dev
    Aug 28, 2020 at 20:59
  • After using gdisk to attempt to set a new PARTUUID, it's still missing. hastebin.com/imuqidicut.txt
    – Dev
    Aug 28, 2020 at 23:20
  • I use inxi, which uses many methods internally to try to get this type of data: inxi -pu gives ... fs: exfat dev: /dev/sdd1 uuid: 9F39-27E7. Since different sources are used depending on what is available, saying how it gets this data isn't practical. But the overall answer here is good, what you want to do may not work. Also consider using mount by label by the way, you can use nix tools to create an exfat label, then mount it by label in fstab, that should work fine.
    – Lizardx
    Feb 26, 2023 at 23:29
0

It sounds like it doesn't have uuid which is a bummer BUT here is one more commands to throw at it just to see

udisksctl info -b /path/to/device/partition

Example output output is below. I think you should run this even though I doubt you'll get a UUID because part of the output is a list of all the places the device is symlinked. So you might be able to dig around in there and find a more permanent identifier than just /dev/whatever.

/org/freedesktop/UDisks2/block_devices/mmcblk0p1:
  org.freedesktop.UDisks2.Block:
    Configuration:              []
    CryptoBackingDevice:        '/'
    Device:                     /dev/mmcblk0p1
    DeviceNumber:               45825
    Drive:                      '/org/freedesktop/UDisks2/drives/00000_0x61cc04da'
    HintAuto:                   true
    HintIconName:
    HintIgnore:                 false
    HintName:
    HintPartitionable:          true
    HintSymbolicIconName:
    HintSystem:                 false
    Id:                         by-uuid-B726-57E2
    IdLabel:                    system-boot
    IdType:                     vfat
    IdUUID:                     B726-57E2
    IdUsage:                    filesystem
    IdVersion:                  FAT32
    MDRaid:                     '/'
    MDRaidMember:               '/'
    PreferredDevice:            /dev/mmcblk0p1
    ReadOnly:                   false
    Size:                       268435456
    Symlinks:                   /dev/disk/by-id/mmc-00000_0x61cc04da-part1
                                /dev/disk/by-label/system-boot
                                /dev/disk/by-partuuid/ab86aefd-01
                                /dev/disk/by-path/pci-0000:03:00.0-platform-rtsx_pci_sdmmc.0-part1
                                /dev/disk/by-uuid/B726-57E2
    UserspaceMountOptions:
  org.freedesktop.UDisks2.Filesystem:
    MountPoints:
    Size:               0
  org.freedesktop.UDisks2.Partition:
    Flags:              128
    IsContained:        false
    IsContainer:        false
    Name:
    Number:             1
    Offset:             1048576
    Size:               268435456
    Table:              '/org/freedesktop/UDisks2/block_devices/mmcblk0'
    Type:               0x0c
    UUID:               ab86aefd-01
`
3
  • I... don't have that command. hastebin.com/arizotamup.txt I don't know where it is. Where can I find it?
    – Dev
    Aug 28, 2020 at 21:02
  • Should be part of systemd I think. Looks like the arch wiki says that you can install it as udisks2
    – FailureGod
    Aug 28, 2020 at 21:48
  • Turns out the correct command is udisksctl (with an S). But, no luck unfortunately. The only symlinks I have are based on the UUID of the physical device combined with the partition nmuber.
    – Dev
    Aug 28, 2020 at 22:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .