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


Click here to return to the 'Update for X final' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Update for X final
Authored by: bombich on Mar 30, '01 12:36:25AM

I struggled with this one for a while. I even managed to have no swapfile at all a few times (wow, I really, really, really do not recommend this, I'm targeting this at people who think they are frustrated with X's virtual memory and want to turn it off). Anyway, I thought an updated example would be beneficial to anyone trying this technique with X final.

Here is the code I used in /etc/rc:

swapdir=/Volumes/swap/vm

# Make sure the swapfile exists,
# first check existence
# if not first make sure disk is mounted
if [ ! -d ${swapdir} ]; then
ConsoleMessage "mounting directories"
mount -t hfs /dev/disk0s6 /Volumes/swap
mount -uw /
fi

# Make sure the swapfile exists,
# if not, create directory since disk should be mounted
if [ ! -d ${swapdir} ]; the
ConsoleMessage "Creating default swap directory"
mkdir -p -m 755 ${swapdir}
chown root:wheel ${swapdir}
else
rm -rf ${swapdir}/swap*
fi

Changes from prev posts: Accomodate that volumes are now stored in the /Volumes directory, gave an example of the disk in the code (disk0s6 is my disk's address and its name is "swap", you'll need to change those to accomodate your partition/disk) -- those dang stars kept throwing me off, so I gave a real life example. Good luck!



[ Reply to This | # ]
Clarification
Authored by: bombich on Apr 23, '01 10:02:44PM

Check out <a href="http://www.macfixit.com/ultimate/Forum35/HTML/002421.html">this forum</a> at MacFixIt for some additional clarification on the code above.



[ Reply to This | # ]