• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Unique Identifier for Disk
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unique Identifier for Disk


  • Subject: Re: Unique Identifier for Disk
  • From: Michael Ziober <email@hidden>
  • Date: Thu, 29 Apr 2004 01:47:14 -0700

On Wed, 28 Apr 2004 20:18:41 -0500, Jeffrey Berman <email@hidden> wrote:

On 4/28/04 2:42 PM, "John C. Welch" <email@hidden> wrote:

On 4/28/04 1:47 PM, "Jeffrey Berman" <email@hidden> wrote:

At least on my system (OS X 10.2.8), the help text from the 'hfs.util'
command does not list a -k option and the command returns nothing when I use
it with a device file name. For example, the main partition of my startup
disk is associated with the device file "disk0s9" but the command:

/System/Library/Filesystems/hfs.fs/hfs.util -k disk0s9

does not return anything.

Try that with a sudo

Still no luck. The command:

sudo /System/Library/Filesystems/hfs.fs/hfs.util -k disk0s9

does not return anything.

-Jeffrey Berman

I am running 10.3.3. The usage information for hfs.util on my system makes no reference to the -k switch either. It is documented in the hfs.util(8) man page. Said man page also mentions a -s switch which you may want to try if you're feeling adventurous:

-s Set the UUID key (generates a new UUID value) for the HFS file
system at device

Is it possible that your disk was originally formatted with OS 9? I found this possibly relevant tidbit in the hdiutil(1) man page, although I'm not exactly sure what it implies:

-nouuid suppress addiing a UUID to the volume. Such a
volume will behave more like a volume which was
formatted with OS 9 or earlier.

I make no claims either way, but I imagine that it's possible that's why your disk appears to have no UUID. Perhaps you can use hfs.util to manually add a UUID to the volume *at your own risk*. I have not tried this myself. :-)

Assuming that you are able to assign a UUID to the disk(s) in question, then the UUID will persist across reboots, crashes, shutdowns, etc. until the next time the disk is formatted or you run hfs.util -s.

Device identifiers are assigned dynamically. The startup volume is disk0. Additional volumes are assigned as needed: disk1, disk2, diskN. If you eject them and then mount them in a different order, they will have different device identifiers, but the UUIDs will not change.

Here is what I get on my system with an internal drive, external FireWire drive, and three disk images:

df -t hfs | tail +2 | sed -e 's|^/dev/||' | while read d b u a c m; do
x=$(/System/Library/Filesystems/hfs.fs/hfs.util -k "$d"); echo "$x $m";
done
DCDD2EEB67C3E568 /
857B4FD1CA49F3B7 /Volumes/Fantom 120
44C5C87063BF8427 /Volumes/Themes
F3489772D542BC37 /Volumes/Resources
ED2834C2BE41B7E1 /Volumes/Sparse

As an aside, I don't see any reason to use sudo as hfs.util is generally executable:

ls -l /System/Library/Filesystems/hfs.fs/hfs.util
-rwxr-xr-x 1 root wheel 43848 17 Apr 15:23 /System/Library/Filesystems/hfs.fs/hfs.util

Michael
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Unique Identifier for Disk
      • From: Jeffrey Berman <email@hidden>
  • Prev by Date: Re: Applescript from Excel button
  • Next by Date: Re: Osascript and ssh
  • Previous by thread: Re: Unique Identifier for Disk
  • Next by thread: Re: Unique Identifier for Disk
  • Index(es):
    • Date
    • Thread