Welcome to Soft32 Forums!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

How to determine UUID for disk image?

 
   Soft32 Home -> Mac -> Programmer Help RSS
Next:  Job: Optimization Lead position at KLA-Tencor, Ch..  
Author Message
Fletcher T. Penney

External


Since: Mar 03, 2004
Posts: 5



(Msg. 1) Posted: Wed Mar 03, 2004 1:59 pm
Post subject: How to determine UUID for disk image?
Archived from groups: comp>sys>mac>programmer>help (more info?)

It seems as though I used to know how to find the UUID for a disk image,
but I can't find it now, despite searching everywhere I could think of.
Smile

I am writing a backup program that creates UDZO images from sparse
images. I would like to track the UUID's for these images for future
reference in restoring files down the road. The conversion is simply
done using the "hdiutil convert" command.

How can I determine the UUID for these disk images after converting
them? I can do it using Cocoa, or I can do it using shell commands -
either will work for this application.


TIA!!

Fletcher
Back to top
Login to vote
Patrick Stadelmann

External


Since: Nov 12, 2003
Posts: 423



(Msg. 2) Posted: Thu Mar 04, 2004 3:49 am
Post subject: Re: How to determine UUID for disk image? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article <me-72E9F2.19591703032004.TakeThisOut@news.fu-berlin.de>,
"Fletcher T. Penney" <me.TakeThisOut@privacy.net> wrote:

> How can I determine the UUID for these disk images after converting
> them? I can do it using Cocoa, or I can do it using shell commands -
> either will work for this application.

If you want to do this without mounting the image, I don't know... If
the image is mounted, the command :

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

should work.

Patrick
--
Patrick Stadelmann <Patrick.Stadelmann.TakeThisOut@unine.ch>
Back to top
Login to vote
Fletcher T. Penney

External


Since: Mar 03, 2004
Posts: 5



(Msg. 3) Posted: Thu Mar 04, 2004 10:37 am
Post subject: Re: How to determine UUID for disk image? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article
<Patrick.Stadelmann-2C2E70.09490204032004 DeleteThis @news.fu-berlin.de>,
Patrick Stadelmann <Patrick.Stadelmann DeleteThis @unine.ch> wrote:

> In article <me-72E9F2.19591703032004 DeleteThis @news.fu-berlin.de>,
> "Fletcher T. Penney" <me DeleteThis @privacy.net> wrote:
>
> > How can I determine the UUID for these disk images after converting
> > them? I can do it using Cocoa, or I can do it using shell commands -
> > either will work for this application.
>
> If you want to do this without mounting the image, I don't know... If
> the image is mounted, the command :
>
> /System/Library/Filesystems/hfs.fs/hfs.util -k diskXsY
>

Huh - I thought tried that yesterday with no success, but today it
worked.

BUT, the UUID I get is a 16 character one. When I encrypt a diskimage,
the password in Keychain Access references an account with a 32
character UUID ( in the format I am more accustomed to seeing UUID's
in...) I had assumed that this was the UUID for the disk image, but
perhaps this is a poor assumption?

I have found references at macosxhints to mounting disk images by UUID
in the fstab file. Is it possible to mount a disk image by UUID from
the command line or programmatically, NOT at boot time?



I am trying to track disk images that are created by my application, and
thought that the UUID would be a better means of doing this ( in case
files are moved, renamed, etc...) But this might not be the case...


Any thoughts?


F-
Back to top
Login to vote
Miro Jurisic

External


Since: May 10, 2004
Posts: 1194



(Msg. 4) Posted: Thu Mar 04, 2004 6:49 pm
Post subject: Re: How to determine UUID for disk image? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article <me-616F25.16370504032004.RemoveThis@news.fu-berlin.de>,
"Fletcher T. Penney" <me.RemoveThis@privacy.net> wrote:

> I am trying to track disk images that are created by my application, and
> thought that the UUID would be a better means of doing this ( in case
> files are moved, renamed, etc...) But this might not be the case...

You want Aliases, not UUIDs, as far as I know. UUIDs have nothing to do with
tracking disk files across moves/renames.

meeroh

--
If this message helped you, consider buying an item
from my wish list: <http://web.meeroh.org/wishlist>
Back to top
Login to vote
Fletcher T. Penney

External


Since: Mar 03, 2004
Posts: 5



(Msg. 5) Posted: Fri Mar 05, 2004 9:54 am
Post subject: Re: How to determine UUID for disk image? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article <macdev-8E0E50.00494805032004.DeleteThis@senator-bedfellow.mit.edu>,
Miro Jurisic <macdev.DeleteThis@meeroh.org> wrote:

> You want Aliases, not UUIDs, as far as I know. UUIDs have nothing to do with
> tracking disk files across moves/renames.
>
> meeroh

No - I DO want UUID's, if they work. I understand aliases, but am
looking for a better way of doing this.

My understanding is that all disk images contain a UUID, unless you
specify --nouuid when creating it. When you double-click an encrypted
disk image in the finder, it asks for you password. If that password is
in your keychain, it seems to be "linked" to the disk image via a
UUID-like account reference. I had THOUGHT that this was the UUID for
the disk image (like a serial number) and there are references on the
internet to being able to mount a disk image by UUID rather than file
name/path in fstab ( check macosxhints for this).

I would LIKE to be able to mount a disk image by UUID, but am not sure
if this is possible. If not, then of course aliases/filename is the
only way to go, but UUID would be nice....


Fletcher
Back to top
Login to vote
Miro Jurisic

External


Since: May 10, 2004
Posts: 1194



(Msg. 6) Posted: Fri Mar 05, 2004 7:02 pm
Post subject: Re: How to determine UUID for disk image? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article <me-3B8A8F.15540605032004 RemoveThis @news.fu-berlin.de>,
"Fletcher T. Penney" <me RemoveThis @privacy.net> wrote:

> In article <macdev-8E0E50.00494805032004 RemoveThis @senator-bedfellow.mit.edu>,
> Miro Jurisic <macdev RemoveThis @meeroh.org> wrote:
>
> > You want Aliases, not UUIDs, as far as I know. UUIDs have nothing to do
> > with
> > tracking disk files across moves/renames.
>
> No - I DO want UUID's, if they work. I understand aliases, but am
> looking for a better way of doing this.

They don't.

> My understanding is that all disk images contain a UUID, unless you
> specify --nouuid when creating it. When you double-click an encrypted
> disk image in the finder, it asks for you password. If that password is
> in your keychain, it seems to be "linked" to the disk image via a
> UUID-like account reference. I had THOUGHT that this was the UUID for
> the disk image (like a serial number) and there are references on the
> internet to being able to mount a disk image by UUID rather than file
> name/path in fstab ( check macosxhints for this).

Your interpretation is correct in that:

1. There is a UUID in every disk image except those created by older OSes or
those created with --nouuid.
2. You can put attach a UUID to every HFS+ partition

However, there is no way to map a UUID to an arbitrary volume. The only way that
the system knows which UUID corresponds to which disk is by finding the disk
during the boot time device search, and then remembering the UUIDs of all disks
it sees.

On other words, the first time the OS will learn the UUID of a disk image is
when you mount the disk image. This is clearly not useful to you.

> I would LIKE to be able to mount a disk image by UUID, but am not sure
> if this is possible.

No, it is not. The problem is very simple: UUIDs identify volumes, but you are
not trying to identify a volume, you are trying to identify a file (which
happens to be a disk image, but that is completely irrelevant).

hth

meeroh

--
If this message helped you, consider buying an item
from my wish list: <http://web.meeroh.org/wishlist>
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Image list - Hi all, I'm developing a simple application with Project Builder using Carbon (nib based). I'd like to create a list...

Is there a problem displaying image this way? - I'm trying to create a NSTableView that can display image. I kinda have a problem creating the image and insert it int...

Image-with-Metadata Choices? - Hi all. I need to find a nice, organic (OS X) solution for this. I'd like to have metadata attached to still images, an...

Using Image Well with Carbon API - Can anyone tell me how to draw an "image well" control in the selected state as the illustration in the OS8 H...

Best way to resize an image in a NSScrollView - Hi, I would like to put a "resizable" image in a NSScrollView, giving a variable zoom factor. I saw many po...

Adding image preview to NSOpenPanel - I need to add an image preview view to an NSOpenPanel view. Before I go too far down the wrong path, I thought I'd as...
       Soft32 Home -> Mac -> Programmer Help All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum

Categories:
 Windows
 Linux
  Mac
 PDA


[ Contact us | Terms of Service/Privacy Policy ]