How to Get UUID of a USB Flash Drive

How to Get UUID: Need to quickly find the UUID of a USB flash drive for scripting, mounting, or system administration? This guide shows how to locate a USB drive UUID on Linux and macOS, along with the equivalent Windows volume serial number.

Get UUID of USB Flash Drives

Get UUID of USB drive

What Is a USB UUID?

A UUID (Universally Unique Identifier) is a unique identifier assigned to a storage volume. Linux and macOS commonly use UUIDs to identify drives consistently, even if the device path changes after rebooting or reconnecting the drive.

Windows uses a similar identifier called a Volume Serial Number.

Why UUIDs Matter

UUIDs are useful because device names and drive letters can change. For example, a Linux USB drive that appears as /dev/sdb1 today could become /dev/sdc1 later.

Using a UUID instead helps ensure scripts, automount rules, and backup jobs always reference the correct drive.

Find the UUID of a USB Drive on Linux

Linux makes it easy to display drive UUIDs from the terminal.

  1. Insert the USB flash drive.
  2. Open a terminal window.
  3. Run:
    lsblk -f
  4. Locate your USB device and look under the UUID column.

You can also use:

sudo blkid

This command displays additional details including filesystem type and device path information.

UUIDs are commonly used in Linux /etc/fstab configurations for persistent mounting.

Find the UUID of a USB Drive on macOS

macOS also uses UUIDs to identify storage volumes.

  1. Connect the USB flash drive to your Mac.
  2. Open the Terminal application.
  3. Run:
    diskutil list
  4. Identify your USB device, such as /dev/disk2.
  5. Then run:
    diskutil info /dev/disk2
  6. Look for the line labeled Volume UUID.

This UUID can be useful for scripting, automounting, and advanced disk management tasks.

Find the Volume Serial Number of a USB Drive on Windows

Windows does not typically use UUIDs in the same way Linux and macOS do. Instead, each storage volume receives a unique Volume Serial Number.

  1. Insert the USB flash drive.
  2. Open Command Prompt or Windows Terminal.
  3. Run:
    wmic volume get DriveLetter, Label, DeviceID, VolumeSerialNumber
  4. Locate your USB drive letter and corresponding serial number.

The volume serial number can be used in scripts and automation tasks that require identifying a specific USB device.

Frequently Asked Questions

Is a UUID the same as a device path like /dev/sdb1?

No. Device paths can change depending on boot order or connected hardware. UUIDs remain consistent unless manually modified.

Can I change the UUID of a USB drive?

Yes, though changing a UUID may break scripts or automount rules that depend on the existing identifier.

Does Windows use UUIDs?

Windows typically uses a Volume Serial Number instead of a traditional UUID for removable storage devices.

Final Thoughts

Knowing how to retrieve a USB drive UUID or volume serial number can make scripting, mounting, and storage management much more reliable. Linux and macOS both provide direct UUID access through terminal commands, while Windows uses a similar approach with volume serial numbers. You might also be interested in learning how to create a bootable USB from an ISO file using dd.