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

Relocate your swap file the GUI way Apps
I had to reinstall OSX over the weekend and, after reading a few more favourable reports on the speed gains with relocating the swapfile, thought I would try it again. Fresh reports of potential problems and the endless pages of Terminal code which promised to overcome them, though, filled my non-geek heart with fear.

I then remembered a small freeware application, Swap Cop, I had downloaded a few weeks back. Swap Cop promised to relocate the swapfile for me, sans Terminal.

So I set up the drive with 3 partitions: a 750 MB partition at the start, one big OSX (+Classic) and a small full 9.22. Did the full install of OS X and all the upgrades, then moved the swapfile with Swap Cop. It worked perfectly and quickly. Rebooted, restarted SwapCop and the old swapfile was deleted.

Performance has improved very noticeably. Six bounces in the Dock to open a disk image prior to the swap, two bounces afterwards. Everything is faster (Quicksilver 733, 768 MB RAM, 10.1.3).

[Editor's note: Some of the speed gain may be a result of reinstalling the system, but the swap move probably helped as well. For those of you who have been afraid of relocating your swap file, give Swap Cop a try.]
  • Currently 3.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)

Relocate your swap file the GUI way | 10 comments | Create New Account
Click here to return to the 'Relocate your swap file the GUI way' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Were you swapping/paging???
Authored by: barrysharp on Apr 11, '02 01:02:30AM

If your system was NOT swapping then any performance improvements (in your case dock icon bouncing -- ie launch times) are very unlikely to be attributable to your swapfile placement strategy.

[ Reply to This | # ]
Another point to consider
Authored by: vertigo on Apr 11, '02 10:32:48AM
If I am not mistaken, you really are only going to see improvements from moving your swap drive to a different drive, not just a different partition on the same drive. You will probably get some boost if it is on a different partition on the same drive if it keeps the swap partition from becoming fragmented, but that would be only noticeable on systems that didn't have enough free space for a contiguous swap file. I concur with the previous posters that the speed gains were likely due to installing a fresh system. You may want to defrag and optimize your new install as there has been a lot of discussion about OSX installing highly fragmented right from the get go (I just did a clean install and it was a mess. Cleaned it up nicely with Norton Speed Disk and Diskwarrior).

Also, to get the most from your swap file, put it on a separate drive from OSX and make it the first partition on that drive - as you will gain the fastest seek times by having the swap file sitting on the outer tracks on the hard disk. Then when your swap file is being accessed it won't co-opt your main drive while it does it's business.

And lastly, the best solution is to get more RAM. I have 1.5GB and I rarely swap any information to disk. I even keep all applications open so they are practically "instant on". Good stuff, that RAM.


[ Reply to This | # ]
Were you swapping/paging???
Authored by: WillyT on Apr 11, '02 06:20:16PM

I don't care what the naysayers think. If the swap partition keeps the spinning beachball away then its doing WHAT I WANT. If the systen feels faster and more useable that is what really counts!

[ Reply to This | # ]
Were you swapping/paging???
Authored by: pagmac2001 on Apr 13, '02 03:51:20PM

Sorry but I have to warn you given my fresh - and scary- experience. Obviously, moving the swap files to a partition where there are other files (I'm talking of my big files plus Macos 9) messes everything up. For me, it just changed the owner of all the folders situated at the 1st level of the partition where I put the swap files (but not the files of folders inside those 1st level folders). As a result, I wasn't able to move, delete, modify any of those folders, as I got each time an error saying that this was impossible because any folder at stake belonged to root. Very annoying. Hopefully I was able, thanks to Alex281, cheers mate, to reallocate the owner name to me.

Now it works, but at a point I thought that my whole second partition was totally f... up.

PS: I used Swapcop to move the files

[ Reply to This | # ]
HFS + UFS problem
Authored by: eddydasquige on Apr 11, '02 11:01:18PM

It say's this in the read me, but I didn't read it untill after I'd screwed my system. If the drive that you set as you swap is not formated the same as your OS X drive it can (in my case did) hose up your system. OS X will not boot properly after the switch. It starts to boot, gets as far as the grey screen with the little mac in the middle, and then restarts. It will keep looping like this forever I suppose.

I havn't figured a way to fix it yet, but you can boot into the system if you boot from single user mode (command+s), and the simply logout from the command line, OS X will then continue to boot as normal.

It does not effect the ability to boot into OS9.

[ Reply to This | # ]
HFS + UFS problem
Authored by: juissi on Apr 13, '02 11:25:56AM

I also screwed up my system with SwapCop and UFS + HFS volumes. I solved the problem... I found the file /etc/fstab which contained the following:

<pre>/dev/disk0s15 /Volumes/.swap hfs rw 1 2</pre>

I replaced SwapCop's rc with the backup SwapCop made, then I deleted (remember backups!!!) the fstab and problem was solved.

[ Reply to This | # ]
HFS + UFS problem
Authored by: juissi on Apr 13, '02 11:30:05AM
ooops. I forget to choose HTML formatted post and I had too fast fingers... /etc/fstab looked like this:
/dev/disk0s15 /Volumes/.swap hfs rw 1 2

[ Reply to This | # ]
99.999% due to initializing & reinstalling
Authored by: sjonke on Apr 11, '02 11:44:29PM

I say this because I once had a problem (had installed a bunch of unix stuff and then used a so-called easy uninstaller that worked on packages to remove them, blah, blah, blah.) Anyway, that's another story. So, I just decided to back up my files, wipe the partition clean, reinstalled OS X and updates, then restored my stuff. It was a pain, but my system was very noticeably faster as a result, I presume simply because it was a means of de-fragmenting the partition.

[ Reply to This | # ]
SwapCop and 10.2
Authored by: PeteChin888 on Sep 14, '02 08:41:59PM

Warning to all who want to use Swap Cop in 10.2 - just don't.

All that'll happen is that you'll get an error message during bootup saying "check /etc/rc - VM already running." And your swap will still be where it was, in your main OS X partition.

I received the following missive from Joshua Schrier via email; I hope he doesn't mind me quoting him.

"There have been significant changes in SystemStarter and the disk-mounting process during boot in OS 10.2. We are currently working with the Darwin team to integrate the functionality of Swap Cop into the operating system, and will probably update the software for 10.2 at some point in the future, as we learn more from them."

Well, as long as SwapCop works eventually, I'll be happy. I've got clients using PhotoShop / InDesign / Office X / Explorer / Flash who generate pageouts even with 1 GB RAM already..

[ Reply to This | # ]
RE: SwapCop and 10.2
Authored by: malvolio on Jan 29, '03 08:51:12PM

Weird, because I have successfully used Swap Cop to move the swap partitions on 2 different iMacs running 10.2 (right up to 10.2.3). I know Swap Cop worked because I have checked both machines by locating the swapfile0 file and by using the "ps -ax | grep dynamic_pager" command.

[ Reply to This | # ]