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


BAD FIX!!! | 13 comments | Create New Account
Click here to return to the 'BAD FIX!!!' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
BAD FIX!!!
Authored by: ashevin on Jun 04, '02 07:32:55AM

# This fscks the disks and mounts them correctly
#
/sbin/autodiskmount <<<<----------- BAD BAD BAD
# HERE IS THE OTHER LINE TO CHANGE, so the swap file goes
# on your swap volume.
swapdir=/Volumes/Swap/private/var/vm
# END CHANGE
# Make sure the swapfile exists
if [ ! -d ${swapdir} ]; then
ConsoleMessage "Creating default swap directory"
mount -uw /
mkdir -p -m 755 ${swapdir}
chown root:wheel ${swapdir}
else
rm -rf ${swapdir}/swap*fi
...

There is a reason that the autodiskmount is only done after all the fstab partitions have been checked. The proper fix is to place an entry in /etc/fstab and let the default /etc/rc fsck code handle checking and mounting it.

The real way to use a seperate swap partition is to use a raw partition for swap. Check the manpage for fstab for details. Using an automounted HFS partition just to hold swap files is stupid, IMNSHO.

- Avi



[ Reply to This | # ]
BAD FIX!!!
Authored by: bhines on Jun 04, '02 05:53:47PM

Using a separate partition, period for swap is stupid. :) If you must move the swap file (and i don't agree that there's a point), put it on another physical disk.



[ Reply to This | # ]
BAD FIX!!! ... No, Should still be SAFE!!
Authored by: EatingPie on Jun 05, '02 02:16:17PM
There is a reason that the autodiskmount is only done after all the fstab partitions have been checked. The proper fix is to place an entry in /etc/fstab and let the default /etc/rc fsck code handle checking and mounting it.
Let's talk about this... In my post, I state that the /etc/rc fsck is either (a) not working right, (b) done too late, or (c) not done in /etc/rc. I lean toward (c) since I don't even see an fsck in my /etc/rc script!! More importantly, the autodiskmount *does* fsck your disk for you!! That's how the thing gets mounted... It checkd your disk (fsck? Okay, I don't know for sure, but it performs the SAME function as fsck by checking and cleaning), marks the disk as clean, and then mounts it. This is according to the man page on autodiskmount. So, this method, according to documentation is safe... and it works!
The real way to use a seperate swap partition is to use a raw partition for swap. Check the manpage for fstab for details. Using an automounted HFS partition just to hold swap files is stupid, IMNSHO.
This is really a different issue. The common way to doing a seperate swap partition *is* with an HFS/UFS partition. We can certainly discuss quality of methods: your "raw" method vs. the more common "automount" method, but , as I said, it's a different issue. Then again, if your name "Avi" refers to you being Avi Tevanian, I throw in the towel right now!! -Pie

[ Reply to This | # ]