Professional Web Applications Themes

How to determine UUID for disk image? - Mac Programming

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. :) I am writing a backup program that creates UDZO images from sp 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 ...

  1. #1

    Default How to determine UUID for disk image?

    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.
    :)

    I am writing a backup program that creates UDZO images from sp
    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
    Fletcher Guest

  2. #2

    Default Re: How to determine UUID for disk image?

    In article <fu-berlin.de>,
    "Fletcher T. Penney" <net> wrote:
     

    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 <ch>
    Patrick Guest

  3. #3

    Default Re: How to determine UUID for disk image?

    In article
    <fu-berlin.de>,
    Patrick Stadelmann <ch> wrote:
     
    >
    > 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
    >[/ref]

    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-
    Fletcher Guest

  4. #4

    Default Re: How to determine UUID for disk image?

    In article <fu-berlin.de>,
    "Fletcher T. Penney" <net> wrote:
     

    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>

    Miro Guest

  5. #5

    Default Re: How to determine UUID for disk image?

    In article <mit.edu>,
    Miro Jurisic <org> wrote:
     

    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
    Fletcher Guest

  6. #6

    Default Re: How to determine UUID for disk image?

    In article <fu-berlin.de>,
    "Fletcher T. Penney" <net> wrote:
     
    >
    > No - I DO want UUID's, if they work. I understand aliases, but am
    > looking for a better way of doing this.[/ref]

    They don't.
     

    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.
     

    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>

    Miro Guest

Similar Threads

  1. Sun PCI II - Disk Image Error
    By CJ in forum Linux / Unix Administration
    Replies: 0
    Last Post: February 22nd, 11:33 PM
  2. determine image information on image stored in MySQL BLOB
    By kristofl in forum PHP Development
    Replies: 2
    Last Post: October 4th, 01:22 PM
  3. OS X System Disk Image
    By spacemancw in forum Mac Applications & Software
    Replies: 1
    Last Post: July 29th, 11:47 AM
  4. dd disk image won't boot
    By /dev/null in forum Sun Solaris
    Replies: 1
    Last Post: July 15th, 07:32 PM
  5. Software Disk Image
    By Martin Roclawski in forum SCO
    Replies: 2
    Last Post: July 10th, 08:38 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139