Symlink "Users" folder in Imaging Process

mcrispin
Contributor II

I have a bunch of sweet iMacs of the SSD + HD variety, and in a lab environment (and for space and other usability reasons) - I've done some testing with symlinking the entire "Users" folder to the "traditional" HD, leaving the boot as SSD. Everything appears to work pretty darn good and very speedy.

Problem is - I'd like to invite this into the imaging process in some sort of automated fashion. So.. the background

  1. Imaging with homegrown NetBoot (10.7.3)
  2. Destination is Lion as well.
  3. Using a non-configured base install (I call it a 'nekkid' install, no mods)

Now - I know I could bake something into a PKG to do this when applying the base install, but that's not very scalable as a I have many users who don't need this (why make 2 base installs when one nekkid one works fine?)

So... what I do is a basic shell script -- that is not my problem.

My problem is that the 3 options I have for scripting are a) before the base install, b) after I've installed everything on before reboot, and c) after reboot.

I can't do before -- because there is no OS on the destination yet, and I can't do after reboot, because a live system doesn't like it's "Users" and "Shared" folder messed with. Therefore, the choice is after --

OK -- BUT.. I'm in netboot.. so a standard shell script fails because it has no idea which binary to run of off and I get the "bad interpreter" error. #!/bin/sh -- unhappy in netboot.

A final note -- WHY symlink that USERS folder? -- think of a lab -- many different users whom I can't predict, I need not only all current users on the system, but all future users to go to the same place (AD users -- then set mobility expiry to zero -- boom -- a typical lab).

So... am I even thinking about this the right way? Right now, I tell Casper Imaging not to reboot and I conflated the whole script into a single line command and run it manually, but I would much prefer to have this setup as it own configuration.

Am I making much sense here?

6 REPLIES 6

acdesigntech
Contributor II

have a script the runs during imaging after the base OS is laid down that moves the users folder to the mechanical drive and creates a sym link on the SSD. You need to recreate your netboot image -- it should NOT be getting confused with shell scripts.

richmac
New Contributor III

Im using the below script that runs at reboot and its working perfectly (provided you have the partitions already). It runs nice and fast too as at this point there is little information in the /Users folder and all new accounts are created on the second partition.

#!/bin/sh
ditto /Users /Volumes/DATA/Users
mv /Users /oldUsers
ln -s /Volumes/DATA/Users /Users

ToriAnneke
Contributor II

I have one HD split in 2 partitions (30% Boot + 70% Users)

Script and run it AFTER reboot:

#!/bin/bash
mv /Users/(501) /Volumes/Users
sleep 1
mv /Users/Shared /Volumes/Users
sleep 1

rm -rf /Users
sleep 1

ln -s /Volumes/Users /Users
sleep 1

chown root:admin /Volumes/Users/
chmod 755 /Volumes/Users/

PS: I like the sleep 1 command ;)

davidhiggs
Contributor III

hey guys, just something i found the other day. not sure if i should submit as a bug or something to be aware of.

When using Composer to capture and create packages, don't do it on a machine with this symlinked Users folder. For some reason, dragging files into composer won't wildcard them for FUT and FEU purposes. It doesn't work. Instead it recreates the full folder structure of the user and file. So it's ignoring this symlink.

Hope that makes sense.

I'm new to Casper and didn't know why my FUT and FUE packages were failing.

winkelhe
New Contributor

I do this as well and sym linking never worked right. So , i create a new users dir on a data volume and use an mcx pref for mobile home location.
Mobile Home Location | System Level Enforced | cachedaccounts.create.location | string | path
Mobile Home Parent Path | System Level Enforced | cachedaccounts.create.location.path | string | /Volumes/Data/Users/

mcrispin
Contributor II

It turned out my script was fine.... it was my netboot set! something went screwy with the permissions for Guest access on the server (to host the swap files for diskless net booting), so it thought the mechanical drive was it's swap space.

Fixed the Guest access on the NetBootClient0 share, and voila... the drive is mine to do with -- and my script was fine... basically the same as pvaders..

Thanks everyone! Mike