Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > Placing a user on a disk image?

Placing a user on a disk image?
Thread Tools
Mac Enthusiast
Join Date: May 2002
Status: Offline
Reply With Quote
Jan 25, 2003, 08:35 AM
 
Can I place a user on a disk image?

Presumably it won't be accessible until I mount it under one user, then log out and relogin as the disk image user.

How do I change it's path etc...

Thanks
GS_
     
Mac Elite
Join Date: May 2001
Location: ~/
Status: Offline
Reply With Quote
Jan 25, 2003, 11:55 AM
 
This is actually a pretty easy thing to do if you don't mind a little bit of typing. WARNING: This does indeed work but it is a good idea to make backups of your important files in case something goes haywire. Backing up files should be done anyways but that is another thread.

The first thing you need to do is create a disk image for use as a user directory. You can make this as big as you want so pick a size that will give you a comfortable amount of space. Create this image in your home directory to keep it handy. Mount this new image with Disk Copy.

Now what you're going to do is mirror the files in your home directory (only some of them mind you) on the disk image. The important directories things to copy are:

~/Desktop
~/Documents
~/Library/Mail
~/Application Support/Addresses
~/.ssh

Go ahead and stick more stuff in this directory if you want but definitely don't move the whole ~/Library folder, ~/Library/Keychains or ~/Library/Preferences. The image won't mount until you log in and without particular files from your ~/Library folder things will not work right. To copy stuff over to the disk image you'll be using the ditto command. The command will be:

ditto -rsrcFork ~/Desktop /Volumes/diskimage/Desktop

This will copy everything from Desktop to the disk image but preserve all permissions and also as a bonus preserve all HFS+ metadata. Once you've copied the directories you want you need to use a little more command line action.

The next step involves making the computer know you want to point at stuff on the disk image. To do this you're going to make symbolic links to the disk image's directories. First rename the documents your home folder to like Documents.save and so on. Then type in:

ln -s /Volumes/diskimage/Documents ~/Documents

Do that for each directory on the disk image. After you've done all that open System Preferences and open Login Items. Drag the disk image you created into the login item pane to have it automount when you log in. Once you've done all of this log out and log back in. Your disk image will mount and your links will now point to it. Check to make sure everything looks ok and then delete the .save directories and you're good to go.

Cool things you can do with this technique: make encrypted or compressed user directories. If you make your disk image an encrypted image and save the password in your keychain so it can mount whenever you're logged into the system you have a pretty transparent encrypted user volume with very little effort. You can also make it a compressed volume which helps save some space (at the cost of processor cycles used to compress/decompress the files).

I hope this helps.

Let me know if anything about the process is unclear.
     
Mac Enthusiast
Join Date: May 2002
Status: Offline
Reply With Quote
Jan 27, 2003, 04:24 AM
 
...thanks friend.

will try it, sounds straight forward enough.
     
Xeo
Moderator Emeritus
Join Date: Mar 2001
Location: Austin, MN, USA
Status: Offline
Reply With Quote
Jan 27, 2003, 06:39 AM
 
Originally posted by Graymalkin:

~/Application Support/Addresses
That's ~/Library/Application Support/Addresses.

Is there any way to mount a disk image at startup or does it have to be done by a user?
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:12 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2