Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the UUID of a USB device on a Mac?

Tags:

uuid

macos

usb

I'm currently facing a problem where an OS application is not showing one of two devices because according to the console logs, these devices have the same UUID. The devices have different vendor IDs, different product IDs, vendor name and device name. Out of the billions of possible UUID combinations, they had to clash.

How does the OS compute the UUID of a USB device? What USB info is it based on?

Additional info: Their serial numbers are the same, which are both currently zero. Is UUID just based on the serial number?

like image 633
radj Avatar asked Dec 12 '22 07:12

radj


2 Answers

diskutil info -all

Lists the volume UUID and other information :)

If you need a specific disk's info, then:

diskutil info disk2s1

like image 72
Varun Natraaj Avatar answered Jan 02 '23 00:01

Varun Natraaj


A reliable way to find UUIDs for volumes on many interfaces is to use the System Information application to generate a system report. Apple menu | About This Mac | More Info... | System Report... Now study the fine print under the interface in question.

This thread turns up in related searches, most of which get clogged by an astounding volume of misinformation and nonanswers. I've just been through a similar issue: I pulled both volumes out of an OWC hardware RAID1 array, and they were identical, including the UUIDs. I determined device ids using diskutil list then inspected each UUID using /System/Library/Filesystems/hfs.fs/hfs.util -k disk2s2 (substitute the correct disk id), then generated new, random UUIDs using sudo /System/Library/Filesystems/hfs.fs/hfs.util -s disk2s2 I unmounted and remounted the volumes, and they had new UUIDs. hfs.util has an online Apple man page found by searching.

hfs.util doesn't read UUIDs for volumes on my USB ports. I found this thread hoping for an answer, which I still don't have. This response is for future searchers who stumble onto this thread as I did, rather than for the OP. Given how search works and threads survive, it is astonishing that people still believe threads are about the OP.

like image 32
Syzygies Avatar answered Jan 01 '23 22:01

Syzygies