|
|
Re: 10.3: Move swap to another partition in Panther
This hint is fairly but not completely robust, and works in 10.3. It makes several essential observations: the use of fstab, the use of umount and mount_hfs, and the importance of examining the behavior during forced reboots. I would gently critique this hint as follows: 1. As noted in earlier comments, "/dev/disk0s14" is a better syntax than "LABEL=Swap" for the fstab entry, because the swap partition will then usually mount in time without help, saving the time spent on every boot waiting for mount_hfs. The umount and mount_hfs should be tried conditionally. 2. Even after all the measures taken in this hint, the swap partition can in rare instances fail to mount. One experiences this regularly while experimenting, because experiments can throw the system seriously out of whack. However, it is wrong to assume that this can't also happen for unknown reasons. Relocating the swapfile should be done conditionally, only if the swap partition successfully mounts. The only reason for the code to remove swap directories is to clean up after botched attempts to move the swapfile. Instead, never make botched attempts, and remove the obsolete swap files from /private/var/vm, as rc also does before modification. 3. There is no need to actually replace lines in /etc/rc. Redefining swapdir after the original definition has the same effect, and one can then revert by simply deleting clearly labeled insertions. 4. Anyone who needs a lesson in order to use a command line editor would be far better off downloading the demo or pay version of BBEdit, choosing Open Hidden... from its File menu, showing All Files, and editing in a familiar manner. 5. The fstab one-liner in the comments to instead mount the swap partition at /private/var/vm is very clever. However, this may only work if one substitutes the "/dev/disk0s14" syntax, and it does not work after forced reboots. 6. The single sentence take-away message from this hint is "Does your swapfile strategy work after forced reboots?", yet most comments ignore this question. Various authors then diplomatically ask followup questions, gently trying to get others to address this issue, and then slip away in frustration when they fail to get their message across. There remains no credible evidence that any off-the-shelf program moves the swapfile as robustly as a carefully custom-crafted hack. If someone wants to counter this assertion, they should explicitly describe the tests that they have carried out, knowing that others are examining their choice of words to assess their understanding, like an orals committee in grad school. Simply asking to have one's word believed won't convince anyone, given the poor signal-to-noise ratio on the internet. I welcome a similar critique of the advice offered in my tutorial, Moving the swapfile in Mac OS X 10.3 (Panther), which documents what I was able to confirm by experiment after reading this and other web pages, having moving my swapfile in each release of OS X. There, I offer code that I believe to be more robust.
Re: 10.3/4GB Swapfile Partition size?
I'm breaking in and setting up a new Dual G5 with 4 GB of ram, a 72 Gig 10Krpm System/boot disk and a 250 Gig 7.2Krpm Swap/Users work disk.
Re: 10.3/4GB Swapfile Partition size?
Wow this thread has really grown! I can't comment on any real-world metrics beyond the 1GB RAM range (I really wish I could afford to!!). However, given my experience in Panther with swap, I would say you want 10GB swap per 1GB RAM. But I can't say for sure.! I do, however want to comment on this... ... Then I read that with enough ram, swapfiles don't get used. With Panther, this isn't true! I always have at least one swap file in Panther... but that's still not the whole story! In my 1GB RAM/5GB Partition scheme, applications started crashing. BUT... my swap files themselves still had not reached 512 MB total! Yet VM use showed above 5GB using Activity Monitor! (Hence my apps dropping like flies.) I'm not sure what's going on in the kernel, but you cannot depend on small swap files telling the whole story!! Panther is a lot more persnickity about swap than Jaguar, so the best advice I can give is be careful, and make the biggest swap partition you can!! ---
Re: Swapfile Partition/RAM size?
> In my 1GB RAM/5GB Partition scheme, applications
Re: 10.3/4GB Swapfile Partition size?
Most of my experience with virtual memory and swapping is with large math computations, a single process on Unix using more than physical memory. No matter how big swap is, the process starts seriously slogging when it starts swapping. We generally bail and find a bigger machine long before swap runs out. I've also had Apple hardware since 1980, but the Mac is Unix now, my swap intuitions finally apply.
How to put swap on a different drive in Panther
I have a DP1.25 MDD tower.
It has a 2 bus SCSI card. Attached to the first SCSI bus are two drives. Attached to the second SCSI bus is one drive. There are no other SCSI drives in the tower, and there are no IDE drives in the tower (just two ATA optical drives - but that's irrelevant). SCSI0: •DriveA •DriveB SCSI1: •DriveC Here's the problem. When I first installed Panther, when I typed df in the terminal, the drives were ordered as such: /dev/disk1s10 DriveA /dev/disk2s10 DriveB /dev/disk3s10 DriveC Now, after a few days, they're ordered differently: /dev/disk1s10 DriveA /dev/disk2s10 DriveC /dev/disk3s10 DriveB This is a problem, because DriveB has my swap, and DriveC has my Users (properly set in netinfo). In order to use DriveB for my swap, I thought that I had to add a line to my /etc/fstab file: /dev/disk2s10 /Volumes/swap hfs rw 1 2 When the system decided (randomly) that it wanted to switch B and C, then /dev/disk2s10 pointed not to my swap, but to my users - and it mounted my users as the swap! Not only that, but it recreated a new /Users folder! Then it mounted swap as "swap 1". I had to fix everything, and I was concerned that it would flip-flop again (randomly). And in fact, from this discussion : >Using fstab for moving the swap is a bad idea. >You have absolutely no assurance that what was >/dev/disk1s2 (for example) one day will still >be /dev/disk1s2 the next time you boot. In other words, from this discussion : >Character device description files (such as >/dev/rdisk0s10) are created at boot time and >do not survive a shutdown. Unless the boot >volume is a CD, disk0 should contain the boot >volume, but all other numbers cannot be assumed >to remain stable. A lot of people suggested that I use LABEL or UUID in /etc/fstab . But that wouldn't work because autodiskmount is supposedly loaded after VM. Anyway, I think that I found the answer to the problem. Apparently, Panther doesn't mount non-IDE drives until the user logs in (and then unmounts them when the user logs out). This not only has implications for swap, but also being able to ssh into a computer where there is no user logged in. You're going to need to have a swap partition formatted and ready to go, then edit /etc/rc with sudo. Here's the code to stick into your /etc/rc file. After it says "swapdir=/private/var/vm" paste this (this is a slightly altered version of syzygies code - which is linked above):
And then if you're using non-IDE drives for swap, in the terminal, type:
There's no need to alter the /etc/fstab file. References: http://www.sciencequest.org/support/computers/mac/repair_topics/application_specific/osx/swapswapvm.html http://www.macosxhints.com/article.php?story=20031104150206554 http://www.math.columbia.edu/~bayer/OSX/swapfile.html http://discussions.info.apple.com/WebX?128@143.yzG8aPqmqaH.2@.599ea35e http://www.macosxhints.com/article.php?story=20031103155828117 |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.14 seconds |
|