"
I found this message by Peter Bierman.
I'm not postitive that it is the same on OSX as on Darwin but it seems
likely. In short if you do the swap disk (like I have on my PBG4, prevents
swap fragmenting) using fstab and the disk respond in a different order it
can really screw things up.
Regards
Erick
------ Forwarded Message
From: Peter Bierman <bierman@apple.com>
Date: Wed, 27 Jun 2001 00:00:46 -0700
To: darwinos-users@lists.apple.com
Subject: warning: /etc/fstab doesn't do what you think
I've seen a bunch of messages here lately that describe using /etc/fstab to
mount volumes at boot.
You don't want to use /etc/fstab on darwin.
Drives are detected and mounted asychronously, which means that the same
physical disk might be assigned a different /dev/diskN node depending on how
quickly other devices respond to bus probing.
Put simply, /dev/disk2s5 for example, might not be the same partition two
boots in a row. It usually will be, but isn't required to be.
If you want to put your VM files on a dedicated partition, reorder the
startup items dependencies so that VM is started after volumes are mounted.
Have VM specify the swapfiles by the full path /Volumes/somedisk/somewhere.
Or use the fstab, and hope that the drives always respond to bus probes in
the same order.
-pmb
darwinos-users mailing list
darwinos-users@lists.apple.com
http://www.lists.apple.com/mailman/listinfo/darwinos-users
------ End of Forwarded Message
"
"
I think it's important to note some issues with the particular method you referenced on your website:
1) Darwin/Mac OS X tries not to use fstab, so adding and fstab file just adds more complexity to the subsystem.
2) The device location is usually static, but *not always* . Since the /etc/fstab file binds a device location to a mount point, this is not a good idea. A disk at /dev/disk0sXX could be located at /dev/disk0sYY the next time you boot.
Here's where I got the warning from:
[He noted the same post from Peter Bierman as noted above so I didn't repeat it here-Mike]
For a workaround, I have a method that is just as easy if not easier.
1) Back-up your /etc/rc file, because that is the file that we will be editing.
2) As root, open /etc/rc in a text editor and find the section that begins with:
##
# Start the virtual memory system.
##
ConsoleMessage "Starting virtual memory"
swapdir=/private/var/vm
3) Because OS X/Darwin normally mounts other disks *after* setting up swap, you must open /System/Library/StartupItems/Disks/Disks in a text editor and copy/paste the following lines to /etc/rc just before the section shown above:
##
# Mount any remaining filesystems
##
if [ ! -f /var/db/volinfo.database ]; then Uninitialized_VSDB=-YES-; fi
if [ "${AUTODISKMOUNT:=-YES-}" != "-NO-" ]; then
ConsoleMessage "Mounting media"
case ${AUTODISKMOUNT} in
-REMOVABLE-)
autodiskmountflags="-a" ;; # Mount removeable media
*)
autodiskmountflags="" ;;
esac
autodiskmount -v ${autodiskmountflags}
fi
if [ "${Uninitialized_VSDB:=-NO-}" = "-YES-" ]; then vsdbutil -i; fi
4) Now change the line 'swapdir=/private/var/vm' to the desired drive location...It should begin with /Volumes/. I've placed mine in /Volumes/harp/DO_NOT_TOUCH/.vm ... harp is the name of the volume. The directory DO_NOT_TOUCH is a visible warning, and the directory that will actually contain the swapfiles is invisible to the Finder because it has a "." in front of it.
I hope that makes sense...And don't get rid of the
/System/Library/StartupItems/Disks/ because other start-up items are dependent on it. Alternatively, you could probably create an OS X style StartupItem for starting up swap, but I'd rather have my swap ready earlier in the boot process.
Eugene Chan "