Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '10.4: Move Users directory to another partition' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: Move Users directory to another partition
Authored by: ScottRussell2 on May 02, '07 03:38:54PM

This is exactly the way to do it. In fact, as part of every new machine I build for my clients, I include the following in the /etc/rc.local script (note that my 2nd partition is named "Data" by default):

### BEGIN CODE ###

if [[ ! -e /etc/fstab ]] ; then
logger "RC.LOCAL: /etc/fstab DOES NOT exist - creating to mount /Users as /Volumes/Data"

DRIVE=`df`
INDEX=1
while [[ "$DRIVE" != *"/Volumes/Data"* && "$INDEX" -le 5 ]] ## get the device ID to pass to diskutil
do
sleep 2
DRIVE=`df` && logger "RC.LOCAL: Get device ID of /Volumes/Data, Attempt # $INDEX"
let INDEX+=1
done

DRIVE=`df | grep /Volumes/Data | /usr/bin/awk {'print $1'}` && logger "RC.LOCAL: Drive = ${DRIVE}"
UUID=`diskutil info "${DRIVE}" | grep UUID | /usr/bin/awk {'print $2'}` ## this method is slightly faster
echo "UUID=${UUID} /Users hfs rw 1 1" >> /etc/fstab ## create /etc/fstab with this line
niload -m fstab / < /etc/fstab ## merge /etc/fstab into NetInfo database
logger "RC.LOCAL: restarting computer for /etc/fstab import to complete"
shutdown -r now ## RESTART THE COMPUTER SO THIS NEW /etc/fstab WORKS
fi

### END CODE ###

---
Best wishes,
Scott



[ Reply to This | # ]