11 Replies Latest reply: Oct 23, 2010 1:25 PM by jsd2
N@poleone Level 1 Level 1 (0 points)
Hi all,
I'm trying to mount a sparseimage file at account login without success.
I have already a Samba volume mounting at login so I thought it just needed to put the volume mounted on the login items... but nothing.

When I login next time I don't see the sparseimage mounted and in Account Preferences the item is marked as Unknown instead of Volume like the Samba one.

Any suggestion?? I can even change the image file in a dmg if necessary...

iMac, Mac OS X (10.6.4)
  • jsd2 Level 5 Level 5 (6,200 points)
    Try adding the actual .sparseimage file as the login item, not the mounted volume.
  • N@poleone Level 1 Level 1 (0 points)
    Hi, thanks for the solution but now I've a second problem...

    Now the sparseimage file is mounting right at my login... After that I execute a logout (not fast user switch) and login with a different account... The sparseimage is mounted again.

    The sparseimage contains an iphot library and it seems to be locked for the second account (the second account belong to a group with r/w permission on it and the sparseimage is set to ignore properties on it)...

    It seems that whatever account log first keep the image locked even if it logout completely... I supposed that on logout it should unmount all the volumes... isn'it??

    Any suggestion??
  • KJK555 Level 4 Level 4 (2,895 points)
    You will have write an automator script (app) to mount it first.

    put your sparse image in the root of your home folder,
    Open automator > workflow > shell script:

    Place the following lines in the shell script window:

    #!/bin/bash
    #script to mount sparsebundle
    hdiutil attach "~/my.sparse";
    exit;

    note: adjust the name of the sparse image as necessary.

    run it. If it works save workflow as an app, add your new app to the user login items.

    Message was edited by: KJK555
  • KJK555 Level 4 Level 4 (2,895 points)
    You will have to write a logout script to automate shutting down the sparse image,
    using diskutil eject command.

    http://codesnippets.joyent.com/posts/show/1763

    Message was edited by: KJK555
  • jsd2 Level 5 Level 5 (6,200 points)
    I'm not sure I understand - does your second account also list the sparseimage file as a login item? And where is the sparseimage file?

    I just put a sparseimage file onto an local external drive that has ownership ignored, added it to the login items of my first account, and then logged out and logged back in to that account, mounting the image. I then logged out of that account without unmounting the image, and logged into a second account that did not list the sparseimage file as a login item. The image did not stay mounted for the second account.

    Message was edited by: jsd2
  • N@poleone Level 1 Level 1 (0 points)
    Ok, your scenario is little different from mine...
    Try to put the same sparseimage file in the Login items of both account.
    Login to fist account... the sparseimage is mounted right
    Logout (completely, not fast user switch) from first account
    Login with second account (listing same sparseimage file at login)
    Sparseimage is mounted but iphoto see it locked.

    I suppose cause sparseimage is no properly unmounted?? R/W permission are for both account (group permission) and, however, properties are ignored on the volume.

    The sparseimage file is locate on the /Users/Share directory (in italian: /Utenti/Condivisa)

    Thanks.
  • jsd2 Level 5 Level 5 (6,200 points)
    It sounds as if you are using the second method described here:
    [iPhoto: Sharing libraries among multiple users|http://support.apple.com/kb/HT1198]

    I tried to duplicate your setup and did not have a significant problem. I listed the sparseimage file in /Users/Shared as a login item on both accounts. I did get a "locked" warning initially from iPhoto on the second account, but I hadn't checked the "ignore ownership" box on the mounted disk image. After I checked it, I was able to log in and out of each account in turn, with iPhoto in each account able to access the shared iPhoto library in the automatically mounted disk image.

    As a test, try removing the sparseimage file from each account's login items, and mounting it manually. From account #1, mount the image, open iPhoto, close iPhoto, unmount the image, and log out. Then log into account #2, mount the image, and open iPhoto, Does iPhoto on that account have access to the library on the image?
  • N@poleone Level 1 Level 1 (0 points)
    Yes, you're right. I'm trying that solution.

    Now I just tried your advice:
    1) Deleted image (now I'm trying with a dmg file...) from Login item on both account
    2) Logged on second account (not administrator)
    3) Mounted the image... but nothing... it seems locked. here the screenshot of properties.
    http://img837.imageshack.us/i/schermata20101022a23130.png

    4) Unmounted the image
    5) Logged out from second account
    6) Logged in on first account (administrator)
    7) Image already mounted??!!! ***??!!!
    8) Now it seems locked on this account too
    9) Here screenshot of properties for this account
    http://img196.imageshack.us/i/schermata20101022a23150.png

    First and second account belong to group "Immagini". It has R/W permission on the Volume. To try I add the second account itself to the list of owners... so you see it two times in the screenshots...
  • jsd2 Level 5 Level 5 (6,200 points)
    A few things seem strange-

    6) Logged in on first account (administrator)
    7) Image already mounted??!!! *??!!!


    Is there anything else currently in the login items of the first account that could have mounted the image? Is there any other account (including a 3rd account) still active via fast user switching?


    Also, normally when you look at the ownership of a volume that is marked "ignore ownership", whichever account is currently logged-in appears to be the owner. Your admin account seems to be named "Luca", but the only individual user I see on the mounted volume's permissions is "Nicoletta", even when you are logged into the "Luca" account.

    For my own test, I used admin accounts "t1" and "t2". I first changed the permissions of the sparseimage file to read-write for all, and also checked the box for "ignore ownership" on the mounted image. Here are my GetInfo results for the sparseimage file, the mounted image, and the iPhoto-9 library, first as seen from account t1:
    .
    !http://i53.tinypic.com/2uj0f7n.jpg!
    .
    and then as seen from account t2:
    !http://i55.tinypic.com/258w8rb.jpg!
    .
    This way each individual user has read-write privileges to all three items.
  • N@poleone Level 1 Level 1 (0 points)
    Thanks... From your image I saw that I didn't give r/w permission on the sparseimage file but only on the mounted volume... Tnx, now it's working!!!

    The next step is to port the same process to iTunes... I hope well...
  • jsd2 Level 5 Level 5 (6,200 points)
    Glad you got it going!

    The next step is to port the same process to iTunes


    Take a look here first:
    [iTunes: How to share music between different accounts on a single computer|http://support.apple.com/kb/HT1203]