How to Get UUID of a USB Flash Drive on Windows, macOS, and Linux

Get UUID: Need to quickly find the UUID of a USB flash drive for scripting, mounting, or system administration? Whether you’re using Linux, macOS, or Windows, each system has its own method for identifying your device with a unique identifier like a UUID or volume serial. This comprehensive guide will help you locate the USB flash drive UUID on any major OS.

get uuid usb drive

What Is a UUID?

A UUID (Universally Unique Identifier) is a 128-bit identifier used to uniquely label objects. In the context of USB drives and storage devices, UUIDs are used to reliably mount the correct disk, even if the device path changes across boots or reboots. While Unix like systems use traditional UUIDs, Windows relies on a similar concept known as a volume serial number.

Why Use UUIDs or Volume Serials?

Using a UUID or volume serial number ensures you reference the correct device—even if its device name or drive letter changes. This is critical in backup scripts, server configurations, and custom mounting procedures.

Find the USB UUID on Windows, macOS, and Linux

Each operating system has a different method for identifying the UUID or volume serial number of a USB flash drive. Whether you're using Linux, macOS, or Windows, the steps below will guide you through retrieving this unique identifier. Knowing how to find your USB UUID ensures more reliable scripting, mounting, and device management across platforms.

How to Find UUID of USB Drive on Linux

To retrieve the Linux UUID of a USB flash drive, follow these steps:

  1. Plug in the USB flash drive.
  2. Open a terminal.
  3. Run the command:
    lsblk -f

    This lists devices along with their UUIDs and mount points.

  4. Alternatively, use:
    sudo blkid

    This provides more detailed information including the USB flash drive UUID, filesystem type, and device path (e.g., /dev/sdb1).

Knowing the Linux UUID is especially useful for creating persistent mount points in /etc/fstab.

How to Find UUID of USB Drive on macOS

To find the disk UUID of a USB flash drive on macOS:

  1. Connect the USB drive to your Mac.
  2. Open the Terminal app.
  3. Run:
    diskutil list

    This displays all disks and partitions.

  4. Identify your USB device (e.g., /dev/disk2), then run:
    diskutil info /dev/disk2
  5. Look for the line that reads Volume UUID. This is your macOS disk UUID.

macOS uses UUIDs for volume management and spotlight indexing, making them helpful for advanced tasks like scripting or automounting.

How to Find UUID (Volume Serial Number) of USB Drives on Windows

Windows doesn't use UUIDs in the same way as Linux or macOS. Instead, it assigns a Volume Serial Number to each storage device. This number acts similarly to a USB flash drive UUID in Unix systems.

Here’s how to find it:

  1. Insert your USB flash drive.
  2. Open Command Prompt or Windows Terminal as Administrator.
  3. Run the following command:
    wmic volume get DriveLetter, Label, DeviceID, VolumeSerialNumber
  4. Find the row with your USB drive's letter. The VolumeSerialNumber column shows your device's identifier.

This Windows volume serial can be used in scripts or configuration tools that need to refer to the same drive consistently.

Frequently Asked Questions

Here are some commonly asked questions regarding Linux UUID, macOS disk UUID, and Windows Volume Serial Numbers:

Can I change the UUID of a USB drive?

Yes, you can change UUIDs on Linux using tools like tune2fs or uuidgen, but it’s not recommended unless necessary. Changing a UUID can break automounts and scripts that rely on it.

Is the UUID the same as /dev/sdb1?

No. Device names like /dev/sdb1 are temporary and can change depending on boot order or how the system detects devices. UUIDs are persistent and don’t change unless manually modified.

How does Windows handle disk identification differently?

Instead of UUIDs, Windows assigns each disk volume a Volume Serial Number, which you can find using wmic or disk management tools. It works similarly to a UUID for identifying a specific USB drive.

Final Take on Getting a USB UUID or Volume Serial

Whether you're using Linux, macOS, or Windows, knowing how to retrieve the UUID of a USB flash drive is a key skill for reliable disk management. From scripting to automounting, these unique identifiers ensure you always reference the correct device — regardless of how or when it’s plugged in.

Was this guide helpful? Feel free to share it or let me know if you have any questions about working with USB drive UUIDs or volume serials.
You might also be interested in learning how to create a bootable USB from an ISO file using dd.