Methods I tried before worked in 10.1, but 10.2 seems a lot more problematic when trying to switch swap drives. The recent post here that describes copying the "drives" startup script into the rc file ended up making 10.2 unbootable. Other methods would create a folder "swap" in volumes and "swap" drive would mount as "swap 1;" it was stubborn like that.
Trying the most basic method, I created the fstab file with the mount point and edited only the location of the swap directory in the rc file:
swapdir=/Volumes/swap/vm"After that didn't work, I then added the other method's "mount -a" before the above line. Well that didn't help either. I even listed the explicit mount point with the fstab information with no success.
[Editor's note: I haven't tested this myself ... also, I'm testing a new method of posting long code snippets; I hope you find it as nice an improvement over the old method as I do! Read the rest of the article to see the new method.]
After looking over the way the rc file is set up now in 10.2, I noticed there were certain system calls that seemed to be key which occurred after the swap code. I thought I'd try moving the entire modified swap code section to the end of the file, hoping the other system calls would allow the drives to mount and bingo it worked! I spent a lot of determined time to get that to work. Here's how the new end of my rc file looks:
# Start System Services
##
# Set language from CDIS.custom - assumes this is parse-able by sh
. /var/log/CDIS.custom
export LANGUAGE
SystemStarter -g ${VerboseFlag} ${SafeBoot}
##
# Start the virtual memory system.
##
ConsoleMessage "Starting virtual memory"
mount -a
swapdir=/Volumes/swap/vm
#swapdir=/private/var/vm
if [ "${netboot}" = "1" ]; then
sh /etc/rc.netboot setup_vm ${swapdir}
fi
# Make sure the swapfile exists
if [ ! -d ${swapdir} ]; then
ConsoleMessage "Creating default swap directory"
mount -uw /
mkdir -p -m 755 ${swapdir}
chown root:wheel ${swapdir}
else
rm -rf ${swapdir}/swap*
fi
dynamic_pager -H 40000000 -L 160000000 -S 80000000 -F ${swapdir}/swapfile
exit 0
I still haven't tested whether the fstab file or the "mount -a" line are necessary. I'm tired of messing with it, and I'm just glad it works. Maybe someone else can test that theory and post the simplest solution.

