Changing swapfile location to separate disk in 10.1

ilo

Registered
Well you all probably know the trick of changing the swapfile location in 10.0.x in order to squeeze a bit more speed out... I've tried the same trick, and it seems it doesn't work in 10.1. Has anyone pulled this off yet?
 

swizcore

Help Guide Coordinator
Originally posted by ilo
Well you all probably know the trick of changing the swapfile location in 10.0.x in order to squeeze a bit more speed out... I've tried the same trick, and it seems it doesn't work in 10.1. Has anyone pulled this off yet?
Well I tried it also with 10.1 and saw no improvement but figured it was because I had 1.5g of ram. Did a little searching around and discovered an overview on the process at www.resexcellence.com which states that the swapfile operation is likely to not work with 10.1 due to its optimization of code and such.
 

efoivx

Registered
moving the swap in any case has little to do with speed you'll notice unless you have less than 128 meg of ram. the swap is paged memory that steps in when real ram is not avaiable... it's much more optimized than classic VM but similar. You WILL notice it if you run ALOT of apps at once like me
my system load at almost all times

Audion 2
Internet Explorer
Entourage
Fire
Notebook (notepad)
ASM
Photoshop
Fireworks
Dreamweaver
Transmit
Terminal
Netscape
Addressbook

I do also have 640 megs of ram so it rarely touches the swap but when it does having my swap on a seperate CLEAN drive keep the spinning beachball from poping up... if my swap was on the same drive it would be up more often... so while you don't see it in "speed" you will gain performance by not having to wait for the beachball of death all the time.

cheers

ps moving the swap on OS X 10.1 absolutly still works

simple steps

partition your drive
one of partitions call swap it should be no larger than 500 meg no smaller than 100 meg
create any other partitions you like

open terminal
type df -k
you will see some text look for one that end with the name swap
/dev/disk0s9 1038096 86448 951648 8% /Volumes/swap

you are interested in the first part /dev/disk0s9 copy it yours will be different so dont copy mine from here.

in the terminal type
sudo pico -w /etc/fstab (hit enter)
type
/dev/disk0s9 /Volumes/swap/ hfs rw 1 2
hit control x then hit the letter y for yes and then enter to save the file
now type
sudo pico -w /etc/rc
be careful don't mess anything up in here
hit control w then type swap and hit enter
you will be placed at aline of text that looks like this
swapdir=/private/var/vm
comment this line out by adding a # in front of it
it will look like this
#swapdir=/private/var/vm
move to the line below it and type
swapdir=/Volumes/swap/vm
place a carrage return after this line
hit control x then hit y then hit enter
resart
you should now see a vm folder in the swap drive if not something went wrong

I'm not responable if you blow up you mac... you should become familiar with unix just a wee bit before doing system level mods it's better if you understand why you are doing it and what it will do and how it affects you. before you do things like this. a good unix admin will always have a back up plan you always know where to go next to quickly fix something you try.

cheers
 

Solaris

Official something...
The link you provided runs the manual mount command from the /etc/rc file.

It is a function of unix to mount file systems from the fstab. I'd use the method described by efoivx in this thread. It shows a better understanding of the unix subsystem.
 

efoivx

Registered
long story but to keep it simple

running mount from /etc/rc is not the correct way to do it. although it will work. It's just a more standard practice to mount from fstab.

not going to go into all the details but just trust me do it the way I described.

Cheers
 

legacyb4

Registered
Thanks for the prompt replies!

So the command lines*

ConsoleMessage "mounting directories"
mount -t hfs /dev/disk**** /disk-name

force a manual mount within the /etc/rc file rather than from fstab which is the conventional way of mounting drives.

Guess it's kinda like ejecting CD's in the old OS without dragging the icon to the trash; while it worked, it wasn't the correct way?

So many new things to learn about the Unix sub-system... <sigh>

Cheers.

Originally posted by Solaris
The link you provided runs the manual mount command from the /etc/rc file.

It is a function of unix to mount file systems from the fstab. I'd use the method described by efoivx in this thread. It shows a better understanding of the unix subsystem.
 

efoivx

Registered
As I said use the method I describe in my post.
use the fstab method.
it's the conventional way to do it.
 

ladavacm

Unperson Spotter
There is already a mount -a hfs command in /etc/rc, executed before starting swap subsystem.

This command mounts all hfs volumes listed in /etc/fstab. Therefore, there is no need to add another one. For extra points, make a SWAPLOCATION knob in /etc/hostconfig, or use the swap filesystem "type" in /etc/fstab and make /etc/rc automatically use it if specified. Submit a patch to Apple.
 
Top