The Yes, This Big Header Banner
Stickies
No stickies found.
Random Comment
Comment #1312
glad i could help ;) at least i won't be the only one not doing any work today...
 

Apple, the world's best unnovator

at 14:08 - 29th, May 2024
I wonder if we're reaching a breaking point with apple yet. I've been complaining for years about their repair stance and their soldering literally everything to the mobo.

Enter this guy who I think nails it perfectly but doesn't go deep enough.



It gets so much worse too and I'll never buy another mac because of this. Basically, mac's ssd is now soldered to the mobo and ssd's have a finite life span. Someone did a test and took 2 exact copy macbooks and unsoldered a component - I think it was a wifi antenna or the ssd - and swapped them from one machine to the other. They booted but both machines had the exact same graphical issues afterwards. Thinking it was a soldering issue, maybe he nicked something he shouldn't of so he switched the components back and the issues disappeared.

I've known for ages that apple was preparing to "security" check components through serial numbers and whatnot but this is ridiculous.

Alright, not the end of the world, simply do like I did with my imac and just get an external usb ssd and boot off of that. But hold on, it gets worse!

So this brings us to the ram now, 8 gigs is standard on all machines, even pro models. Most people won't think to upgrade before buying. The os will use up most of that on boot so the system will start reading and writing to the ssd as virtual memory and this puts wear and tear on the ssd shortening its lifespan.

I found another guy recently who killed his internal soldered storage, just wrote and deleted and repeated until the thing wouldn't work properly, you know what ssd's do. He found that even if you boot off an external drive, the system looks to the internal drive for for virtual memory. So even on my imac, the internal hdd is used even if I'm booting from my external ssd.

If your internal SSD is fried and you hit that ram limit, your mac will not work even if you boot on an external device.

People talk about how apple is a super green company, but really they are not. No one is talking about this at all. It's shocking to me. This basically means that

  1. we'll have an insane amount of e waste from apple products

  2. you should never buy a used mac because you don't know how long it'll last



When I had swapped out my optical drive for a second ssd in my macbook pro, I also was able to change where the os looks for the user accounts - the original storage instead of the user folder it created in the new os install on the secondary drive. There must be a way to change the virtual memory location too. It is Unix after all.

 

Similar posts

HFS+ coming to boot camp 10.6
sweet jebus it's about time they did this.

 
Apple announces new iPad mini and Macbook pro
Let's start with the Mac Mini because quite frankly I want to talk desktop computers and ...
Parallels Desktop now running natively on M1
This reminds me so much of the G3's and G4's back in the day and trying all sorts of emula...

 
Alex Alex
News comment 1 | User comment 4968 | 14:26 - 29th, May 2024


Apparently moving the swap file is possible.

1. Open Terminal and make a backup copy of Apple's default dynamic_pager.plist:

$ cd /System/Library/LaunchDaemons
$ sudo cp com.apple.dynamic_pager.plist{,_bak}
2. Convert the plist from binary to plain XML:

$ sudo plutil -convert xml1 com.apple.dynamic_pager.plist

Alex Alex
News comment 2 | User comment 4968 | 14:27 - 29th, May 2024


2. Convert the plist from binary to plain XML:

$ sudo plutil -convert xml1 com.apple.dynamic_pager.plist
3. Open the converted plist with your text editor of choice. (I use pico, see dblu's answer for an example using vim):

$ sudo pico -w com.apple.dynamic_pager.plist
It should look as follows:




EnableTransactions

HopefullyExitsLast

Label
com.apple.dynamic_pager
OnDemand

ProgramArguments

/sbin/dynamic_pager
-F
/private/var/vm/swapfile



Alex Alex
News comment 3 | User comment 4968 | 14:27 - 29th, May 2024


4. Modify the ProgramArguments array (lines 13 through 18) to use the wait4path shell command prior to launching dynamic_pager. See note #1 for details on why this is necessary. In the following example, my partition is called Swap, and I chose to put the swapfiles in a hidden directory on that partition, called .vm be sure that the directory you specify actually exists. The XML should look as follows:

ProgramArguments

/bin/bash
-c
/bin/wait4path /Volumes/Swap/ &&
/sbin/dynamic_pager -F /Volumes/Swap/.vm/swapfile


5. Save the plist, and return to the terminal prompt. Using pico, the commands would be:

to save the file
to accept the same filename (com.apple.dynamic_pager.plist)
to exit

Alex Alex
News comment 4 | User comment 4968 | 14:27 - 29th, May 2024


6. Convert the modified plist back to binary:

$ sudo plutil -convert binary1 com.apple.dynamic_pager.plist
7. Restart your Mac. If you run into trouble, switch to verbose startup mode by holding down Command-v immediately after the startup chime. This will let you see all of the startup messages that appear during startup. If you run into even worse trouble (i.e. you never see the login screen), hold down Command-s instead. This will boot the computer in single-user mode (no graphical UI, just a command prompt) and allow you to restore the backup copy of com.apple.dynamic_pager.plist that you made in step 1.

8. Once the computer boots, fire up Terminal and verify that the swap files have actually been moved:

$ cd /Volumes/Swap/.vm
$ ls -l
You should see something like this:

-rw------- 1 someUser staff 67108864 18 Sep 12:02 swapfile0

Alex Alex
News comment 5 | User comment 4968 | 14:28 - 29th, May 2024


9. Delete the old swapfiles:

$ cd /private/var/vm
$ sudo rm swapfile*
10. Profit!

Note 1

Modifying the arguments to dynamic_pager in the plist without using wait4path does not always work, and when it fails, it does so in a spectacularly silent way. The problem stems from the fact that dynamic_pager is launched very early in the startup process. If your swap partition has not yet been mounted when dynamic_pager is first loaded (in my experience, this happens 99% of the time), then the system will fake its way through. It will create a symbolic link in your /Volumes directory which has the same name as your swap partition, but points back to the default swapfile location (/private/var/vm). Then, when your actual swap partition mounts, it will be given the name Swap 1 (or YourDriveName 1). You can see the problem by opening up Terminal and listing the contents of your /Volumes directory:

$ cd /Volumes
$ ls -l
You will see something like this:

drwxrwxrwx 11 yourUser staff 442 16 Sep 12:13 Swap -> private/var/vm
drwxrwxrwx 14 yourUser staff 5 16 Sep 12:13 Swap 1
lrwxr-xr-x 1 root admin 1 17 Sep 12:01 System -> /
Note that this failure can be very hard to spot. If you were to check for the swapfiles as I show in step 12, you would still see them! The symbolic link would make it seem as though your swapfiles had been moved, even though they were actually being stored in the default location.

Alex Alex
News comment 6 | User comment 4968 | 14:28 - 29th, May 2024


note: copied from SuperUser:

For older versions of OSX, see this thread on forums.macosxhints.com.

Credit goes to dblu for explaining the use of plutil, ZILjr for introducing the wait4path command, and ekl for simplifying the whole thing by eliminating the need for an intermediate shell script.

Complete solution:

1. Open Terminal and make a backup copy of Apple's default dynamic_pager.plist:

$ cd /System/Library/LaunchDaemons
$ sudo cp com.apple.dynamic_pager.plist{,_bak}
2. Convert the plist from binary to plain XML:

$ sudo plutil -convert xml1 com.apple.dynamic_pager.plist
3. Open the converted plist with your text editor of choice. (I use pico, see dblu's answer for an example using vim):

$ sudo pico -w com.apple.dynamic_pager.plist
It should look as follows:




EnableTransactions

HopefullyExitsLast

Label
com.apple.dynamic_pager
OnDemand

ProgramArguments

/sbin/dynamic_pager
-F
/private/var/vm/swapfile



4. Modify the ProgramArguments array (lines 13 through 18) to use the wait4path shell command prior to launching dynamic_pager. See note #1 for details on why this is necessary. In the following example, my partition is called Swap, and I chose to put the swapfiles in a hidden directory on that partition, called .vm be sure that the directory you specify actually exists. The XML should look as follows:

ProgramArguments

/bin/bash
-c
/bin/wait4path /Volumes/Swap/ &&
/sbin/dynamic_pager -F /Volumes/Swap/.vm/swapfile


5. Save the plist, and return to the terminal prompt. Using pico, the commands would be:

to save the file
to accept the same filename (com.apple.dynamic_pager.plist)
to exit
6. Convert the modified plist back to binary:

$ sudo plutil -convert binary1 com.apple.dynamic_pager.plist
7. Restart your Mac. If you run into trouble, switch to verbose startup mode by holding down Command-v immediately after the startup chime. This will let you see all of the startup messages that appear during startup. If you run into even worse trouble (i.e. you never see the login screen), hold down Command-s instead. This will boot the computer in single-user mode (no graphical UI, just a command prompt) and allow you to restore the backup copy of com.apple.dynamic_pager.plist that you made in step 1.

8. Once the computer boots, fire up Terminal and verify that the swap files have actually been moved:

$ cd /Volumes/Swap/.vm
$ ls -l
You should see something like this:

-rw------- 1 someUser staff 67108864 18 Sep 12:02 swapfile0
9. Delete the old swapfiles:

$ cd /private/var/vm
$ sudo rm swapfile*
10. Profit!

Note 1

Modifying the arguments to dynamic_pager in the plist without using wait4path does not always work, and when it fails, it does so in a spectacularly silent way. The problem stems from the fact that dynamic_pager is launched very early in the startup process. If your swap partition has not yet been mounted when dynamic_pager is first loaded (in my experience, this happens 99% of the time), then the system will fake its way through. It will create a symbolic link in your /Volumes directory which has the same name as your swap partition, but points back to the default swapfile location (/private/var/vm). Then, when your actual swap partition mounts, it will be given the name Swap 1 (or YourDriveName 1). You can see the problem by opening up Terminal and listing the contents of your /Volumes directory:

$ cd /Volumes
$ ls -l
You will see something like this:

drwxrwxrwx 11 yourUser staff 442 16 Sep 12:13 Swap -> private/var/vm
drwxrwxrwx 14 yourUser staff 5 16 Sep 12:13 Swap 1
lrwxr-xr-x 1 root admin 1 17 Sep 12:01 System -> /
Note that this failure can be very hard to spot. If you were to check for the swapfiles as I show in step 12, you would still see them! The symbolic link would make it seem as though your swapfiles had been moved, even though they were actually being stored in the default location.

Note 2

I was originally unable to get this to work in Snow Leopard because com.apple.dynamic_pager.plist was stored in binary format. I made a copy of the original file and opened it with Apple's Property List Editor (available with Xcode) in order to make changes, but this process added some extended attributes to the plist file which caused the system to ignore it and just use the defaults. As dblu pointed out, using plutil to convert the file to plain XML works like a charm.

Alex Alex
News comment 7 | User comment 4968 | 14:28 - 29th, May 2024


Note 3

You can check the Console application to see any messages that dynamic_pager_init echos to the screen. If you see the following lines repeated over and over again, there is a problem with the setup. I ran into these messages because I forgot to create the '.vm' directory that I specified in dynamic_pager_init.

com.apple.launchd[1] (com.apple.dynamic_pager[176]) Exited with exit code: 1
com.apple.launchd[1] (com.apple.dynamic_pager) Throttling respawn: Will start in 10 seconds
When everything is working properly, you may see the above message a couple of times only, and then no more of the "Throttling respawn" messages. This means that the system did have to wait for the partition to load, but in the end it was successful.

Alex Alex
News comment 8 | User comment 4968 | 14:28 - 29th, May 2024


Exclude the path from Time Machine
In OS X 10.7 and later you can do this with tmutil. Example:

sudo tmutil addexclusion -p /Volumes/Swap/.vm

For that example, to review the result:

tmutil isexcluded /Volumes/Swap && tmutil isexcluded /Volumes/Swap/.vm

If the volume used for swap need not be indexed
Use mdutil. Example, to switch off then erase the store:

sudo mdutil -i off /Volumes/Swap && sudo mdutil -E /Volumes/Swap

Alex Alex
News comment 9 | User comment 4968 | 14:29 - 29th, May 2024


Got all of this from Stackexchange

Join the conversation
Login.

U:
 
P:
Don't have a username? Register Now
Can't remeber your login? Find Password