Panther Swaps

Ahh, another thing that I meant to share..

Panther broke our old method of moving swapfiles. I remember when I installed Panther first, slapping the rc code into place and rebooting, not thinking for a second that it wouldn't work. Damn! Took me a good hour to figure this out, so, to save you an hour or so, here goes..

After a few trial and errors, I decided to use an old-fashioned method of doing this. Any dirty hack must be judged firstly on whether or not it works, and this does, superbly.

First have a UFS swap volume ready.

In this example it is called "Swap". If you call it something else *sigh* then please change *all* instances of the word "Swap".

open the file /etc/rc

replace..

original:
update

echo "Starting virtual memory"

swapdir=/private/var/vm
if [ "${netboot}" = "1" ]; then
sh /etc/rc.netboot setup_vm ${swapdir}
fi

# Make sure the swapfile exists

with..

updated:
update

umount -v /Volumes/Swap*
if [ -d /Volumes/Swap ]; then
ConsoleMessage "*** DELETING old Swap directory(s) ***"
rm -rf /Volumes/Swap*
fi

echo "Starting virtual memory"


if [ "${netboot}" = "1" ]; then
sh /etc/rc.netboot setup_vm ${swapdir}
fi

swapdir=/Volumes/Swap/swaps

# let's do it the old-fashioned way
if [ ! -d ${swapdir} ]; then
mkdir -p -m 755 /Volumes/Swap
# do 'df' in the terminal to get the *exact* string for the disk
mount -t ufs /dev/disk0s10 /Volumes/Swap
mount -uw /
fi

# Make sure the swapfile exists


Please read the notes in the code before performing the edit. You must ascertain the exact drive letter of your swap volume. Mine is "/dev/disk0s10", but yours may be something else.

When you reboot, check that swap files are forming in their correct location. Then you can safely delete the old ones.

that's it. Clean and frag-free swaps are yours once again!

for now..

:o) The Writing Entity @ corz.org



 ©  2024 « corz.org » 24.12.21  

Welcome to corz.org!

I'm always messing around with the back-end.. See a bug? Wait a minute and try again. Still see a bug? Mail Me!