Find Disk ID, Device Node & Identifier on Mac
In this article
To find a disk's ID, device node, and identifier on a Mac, open Terminal and run diskutil list — the output shows every disk with its device node (like /dev/disk0), identifier (like disk0s1), and other details. This article explains how to interpret that output, how to find the same information through the GUI, and how to use it safely for formatting, partitioning, or troubleshooting.
What Each Term Means
People often use these words interchangeably, but they refer to different things:
- Disk ID — a generic term that can mean the BSD name (e.g.,
disk0), the UUID of the volume, or the disk identifier string. In macOS, the BSD name is the most direct identifier. - Device node — the file in
/dev/that represents the whole disk or a partition, e.g.,/dev/disk0or/dev/disk0s2. The kernel creates these nodes automatically when a disk is attached. - Identifier — in the context of
diskutil, this is the short name likedisk0s1(whole disk:disk0, partition 1:s1). It is essentially the device node without the/dev/prefix.
So when someone asks for a “disk ID” on a Mac, they usually want the BSD identifier (e.g., disk2 or disk2s3), which is what you pass to commands like diskutil unmount or diskutil eraseDisk.
Using the Terminal (diskutil)
The most reliable method is the command line. Open Terminal (in Applications/Utilities or via Spotlight) and type:
diskutil list
This prints a table with all disks. For each disk you’ll see lines like:
/dev/disk0 (internal, physical): #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *500.3 GB disk0 1: EFI EFI 209.7 MB disk0s1 2: Apple_APFS Container disk1 500.1 GB disk0s2
The IDENTIFIER column gives the short name — disk0, disk0s1, disk0s2. The device node is the same with /dev/ in front. For a specific volume, use diskutil info disk0s2 to get its UUID, mount point, filesystem type, and more.
To list only external disks, use diskutil list external. To see just one disk, use diskutil info /dev/disk2 or diskutil info disk2.
Finding It in Disk Utility (GUI)
If you prefer the graphical interface, Disk Utility does show the device node, but it’s hidden by default. Open Disk Utility (in Applications/Utilities), then:
- Click View in the toolbar and select Show All Devices.
- Select a disk or volume in the sidebar.
- Click the Info button (or press Cmd+I).
The Info window shows “Disk Identifier” (e.g., disk0s2) and “Device Node” (e.g., /dev/disk0s2). It also lists the disk’s UUID, which is a separate identifier used by the system to track volumes.
Why You Might Need the Identifier
You’ll typically need the device node or identifier when:
- Unmounting or ejecting a stubborn disk:
diskutil unmount /dev/disk2s1 - Formatting a disk:
diskutil eraseDisk JHFS+ NewName /dev/disk2 - Creating or deleting partitions:
diskutil partitionDisk /dev/disk2 1 GPT JHFS+ NewName 100% - Checking disk health:
diskutil verifyVolume /dev/disk2s1 - Repairing permissions or filesystem:
diskutil repairVolume /dev/disk2s1
Using the wrong identifier can target the wrong disk, so always double-check the output of diskutil list before running any destructive command.
Common Pitfalls and Misconceptions
A frequent mistake is confusing the volume UUID with the device node. The UUID is a long hexadecimal string that remains constant even if the disk is moved to another port, while the device node (like disk2) can change after a reboot or when you plug in another drive. If you need a stable reference, use the UUID in scripts, not the device node.
Another misconception: the device node /dev/disk0 is always the internal startup disk. That’s usually true but not guaranteed — if you boot from an external drive, that external drive may become disk0. Always verify with diskutil list.
Also, APFS containers add a layer: a physical disk (e.g., disk0) contains a container (disk1) that holds volumes (disk1s1, disk1s2). The container is a virtual device, and its identifier is what you use for most operations on APFS volumes.
Safety: Avoid Data Loss
Commands like eraseDisk and partitionDisk permanently destroy data on the target disk. Before running them:
- Back up any important files.
- Triple-check the identifier against
diskutil list— look at the size and name to confirm it’s the right disk. - Use
diskutil info diskXto see the mount point and volume name.
If you’re unsure, unmount the disk first (diskutil unmount diskX) — that’s reversible and safe. Never run diskutil eraseDisk on the disk that contains your macOS system unless you intend to wipe it.
Frequently Asked Questions
How do I find the disk identifier on a Mac without Terminal? Open Disk Utility, enable View > Show All Devices, select the disk, and press Cmd+I. The Info window shows the Disk Identifier and Device Node.
What is the difference between disk0 and disk0s1? disk0 is the whole physical disk; disk0s1 is the first partition (or slice) on that disk. The “s” stands for slice.
Why does my disk identifier change after reboot? Device nodes are assigned dynamically based on the order the system discovers disks. Adding or removing a USB drive can shift identifiers. Use the UUID if you need a permanent reference.
Can I use the UUID instead of the device node in commands? Yes, for many commands like diskutil unmount or diskutil info, you can use the UUID (e.g., diskutil unmount UUID=XXXX). However, some commands like eraseDisk require the whole-disk identifier.
How do I find the disk identifier for a mounted volume? Run diskutil list and look for the mount point (e.g., /Volumes/MyDrive) in the output. The corresponding identifier is in the same row.
Is there a way to list only volumes, not whole disks? Use diskutil list and look for lines that have a TYPE like Apple_HFS or Apple_APFS — those are volumes. Alternatively, diskutil list internal or diskutil list external filters by location.