Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm curious as to where OSX stores the names of mounted volumes. For example, if I connect my external USB hard drive, mount it and change the name to something else, how does OSX remember the name the next time I mount it? It seems like this should be stored on the volume itself, but I don't see any file that might contain this name. The only file that's created is the ".DS_Store" file, but this does not contain the volume name as far as I can tell.

If it's not store on the volume then how does the OS realize it's the same device being connected?

share|improve this question

2 Answers 2

up vote 5 down vote accepted

This information is stored outside the file systems in the device's partition table (or equivalent data structure). That's why you don't have to mount volumes to e.g. see their names in Disk Utility.

It depends on how the disks are formatted, modern OS X uses GPT by default.

Internally, OS X also uses GUIDs/UUIDs (128 bit numbers) to identify volumes.

Use /usr/sbin/diskutil to access metadata about disks and volumes.

share|improve this answer
    
Actually it may be stored on the volume itself, but not in a file. I'm not 100% certain however of where it is on the disk. I believe it is stored in what Apple calls the "Finder Info" of the volume. The volume identifier (which is not an UUID and is 64 bits only) is stored there. The UUID that Apple shows you is computed every time for display purposes using the Version 3 UUID algorithm from the volume id and a fixed "namespace" id. The UUID that is stored in the GPT is a separate thing (Apple calls it the "Media UUID"). –  Analog File Dec 2 at 22:38

I posted this as a comment to the accepted answer, but I think it really is an answer, so I'm reposting it.

I think it is stored on the volume itself, but not in a file. I'm not 100% certain however of where it is on the disk. I believe it is stored in what Apple calls the "Finder Info" of the volume (which, if I remember correctly, is part of the volume header data which is stored in sector 2 of the volume). Note that an HFS+ volume has a name even when it is not saved on a partition (for example if it's just a file, as is the case for so called "disk images", which really, at least in some cases, are just "partition images").

Even the volume identifier (which is not actually an UUID and is 64 bits only) is stored there.

The volume UUID that Apple shows you (which is 128 bits) is computed every time for display purposes using the Version 3 UUID algorithm from the 64 bits volume id and a fixed "namespace" id. The UUID of the partition which is stored in the GPT is a separate thing (Apple calls it the "Media UUID").

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.