Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

MDangerous

macrumors member
Jan 25, 2008
91
7
Am I understanding correctly that I can TRIM my boot drive if I boot into recovery and repair with Disk Utility? This is without Trim Enabler on, correct? If so, this is not working for me. There is no message in DU saying that it TRIMed the disk. Am I misunderstanding?
 

hfg

macrumors 68040
Dec 1, 2006
3,621
312
Cedar Rapids, IA. USA
Am I understanding correctly that I can TRIM my boot drive if I boot into recovery and repair with Disk Utility? This is without Trim Enabler on, correct? If so, this is not working for me. There is no message in DU saying that it TRIMed the disk. Am I misunderstanding?

No, trim is not loaded in recovery mode and thus not active, although this is the way to run "Repair" on the boot drive ... just no trim. You may be able to trim with the Terminal commands from recovery, however I have not tried that. If you search these forums you will find the recommended Terminal commands for trim.

You will have to have another bootable instance of OS X which supports trim, enable it there, and then repair your boot disk from that other copy.
 

mrf5

macrumors newbie
Oct 11, 2011
15
0
^+1

Am I understanding correctly that I can TRIM my boot drive if I boot into recovery and repair with Disk Utility? This is without Trim Enabler on, correct? If so, this is not working for me. There is no message in DU saying that it TRIMed the disk. Am I misunderstanding?

Check out #138 & #139
 

mraviator

macrumors newbie
Dec 4, 2014
2
0
I'm late to the game...

I'm going to replace my Mac Mini 2012's HD with Samsung 840 EVO SSD this weekend. I only read about the TRIM issues with Yosemite after buying it. I have no problems disabling kext signing, security issues, etc (coming from Windows world...) and occasionally going through the temporary re-enable hoops to update the OS.

My question concerns the "occasional" automatic, non-user initiated PRAM reset. Is this something that occurs often or seldom? Are there specific events that cause PRAM resets? I don't reboot my MM very often, so I don't think it will be an issue.
 

h9826790

macrumors P6
Apr 3, 2014
16,656
8,587
Hong Kong
My question concerns the "occasional" automatic, non-user initiated PRAM reset. Is this something that occurs often or seldom? Are there specific events that cause PRAM resets? I don't reboot my MM very often, so I don't think it will be an issue.

The PRAM should not automatically clear itself.

Even though it happen, you may still able to boot with TRIM Enabled (assuming you use TRIM Enabler). Cindori really did his best to make the system as stable as possible. Reset PRAM may cause Yosemite unable boot to desktop, but not necessary happen. It's already proved by few of us.

I even perform my 10.10.1 upgrade without disable TRIM. No problem at all. Of course, TRIM will be disabled automatically after update, and I have to enable it again.
 

brycenesbitt

macrumors newbie
Aug 15, 2008
17
0
To TRIM or not to TRIM, that is the question.

Perhaps something that has already be explored (and shot down), but is there any method (short of booting to another drive and running disk repair) to issue a TRIM command to a drive in an ad-hoc way? I'm thinking along the lines of something that would become a maintenance routine, or perhaps a scheduled task (cron, launchd, etc...).

I've given up on TRIM, and do this instead:

dd if=/dev/zero of=trim.tmp bs=1024 count=10241024
rm trim.tmp

Which writes zeros to all empty parts of the file system, until the disk fills up.
A similar technique is used by recent Linux distributions to avoid the performance penalties and buggy software risks of TRIM on delete.

And this method will effectively trim everything, not just newly deleted sectors.

The main downside is the disruption of having the disk fill up to complete the operation. This would not be a good idea for server class machines.
 
Last edited:

VirtualRain

macrumors 603
Aug 1, 2008
6,304
118
Vancouver, BC
I've given up on TRIM, and do this instead:

dd if=/dev/zero of=trim.tmp bs=1024 count=10241024
rm trim.tmp

Which writes zeros to all empty parts of the file system, until the disk fills up.
This is the same technique used by recent Linux distributions to avoid the performance penalties and risks of TRIM.

And this method will effectively trim everything, not just newly deleted sectors.

The main downside is the disruption of having the disk fill up to complete the operation. This would not be a good idea for server class machines.


Perhaps I misunderstand what you're doing, but zeroing and Trimmng are two different things. From what I know, zeroing won't help at all and could actually be the worst thing to do, as filling all your drive with data (zeros or otherwise) forces it into a degraded performance state. Trim actually tells the SSD which data it no longer needs to keep (such as when a file is deleted). How does what you're doing accomplish that?
 

h9826790

macrumors P6
Apr 3, 2014
16,656
8,587
Hong Kong
AFAIK, TRIM will tell the SSD which block of data is not being used anymore. So, GC can be more effective (no need to move any useless data before it zero out the whole cell). Therefore, less write cycle to the SSD, and speed up the write process.

Without GC to zero out the "free" cell when the SSD is idle, TRIM will be effectively useless.

I don't really know the mechanism behind. However, if GC can works better with TRIM (an OS level function) because GC is a SSD internal background function, and doesn't know which cell's data is useless. But if this command is a OS level command, which able to tell the SSD which cell can be zero out. Then this is basically running GC + TRIM manually in the foreground. It sounds like will speed up the subsequence write process until the SSD is full of useless data again.

I personally still prefer to use TRIM. In fact, use TRIM Enabler is simple and painless so far. And I don't know if there is any potential risk (e.g. data corruption) to run this command. Also, I has no idea how to monitor my SSD and run this command at the correct timing (Too early, waste of time. Too late, reduce performance). So, the automatic background functions like TRIM + GC still my 1st choice.
 

brycenesbitt

macrumors newbie
Aug 15, 2008
17
0
Perhaps I misunderstand what you're doing, but zeroing and Trimmng are two different things.

They are closely related.

When an SSD is forced to "garbage collect", if it has data it can't know is junk, that forces a lot of I/O operations. However piles of zeroed sectors are very readily garbage collected by reasonably smart firmware. In addition a zero'ed sector can be immediately written to, even if it's not in a free map.

Note that SSD's have four possible ways to implement TRIM itself, including leaving the old data in place, or zeroing the sectors (Reference 7.10.3.2 Trim in the ATA/ATAPI command specification).

OS's similary have choices of not supporting TRIM (that would be Yosemite for 3rd party SSD's), supporting TRIM on delete (Windows), or batch trim (many recent Linux versions).

Unfortunately not every SSD firmware reacts the same to TRIM or zeroing sectors. The zero trick does work for me. Running the above command is quite fast the second time, indcating the firmware notices the sectors are already zero and it skips actually writing them. Those curious to explore TRIM (on Windows systems) can check out "TrimCheck" https://github.com/CyberShadow/trimcheck . Unfortunately SSD vendors don't explain how their drives work very well, but you can read one vendor's writeup about zeros here: http://www.xtremio.com/saved-by-zero . Also note the underlying flash memory can only turn 1 to 0 so some people recommend writing 0xff rather than zero.
 
Last edited:

Renecek

macrumors regular
Jun 1, 2011
106
4
Hi,

just downloaded and enabled TRIM Enabler in Yosemite. I have a quick question: do I need to write any commands in terminal after trim enabled please?
 

VirtualRain

macrumors 603
Aug 1, 2008
6,304
118
Vancouver, BC
If you need to do system updates for OS X, make sure to turn Trim Enabler off first. Otherwise, you risk getting the stop sign at boot.


I use to think that as well, but I inadvertently updated to 10.10.2 the other day without thinking to disable trim enabler on my Mini and it updated just fine. So has something changed, was that false advice, or was I just lucky?
 

h9826790

macrumors P6
Apr 3, 2014
16,656
8,587
Hong Kong
I use to think that as well, but I inadvertently updated to 10.10.2 the other day without thinking to disable trim enabler on my Mini and it updated just fine. So has something changed, was that false advice, or was I just lucky?

Nothing changed, it's just an extra precaution up to this moment. Not really necessary in the last few updates. However, due to no one knows what will happen in the future updates, it's a recommended procedure to avoid troubles.
 

Macshroomer

macrumors 65816
Dec 6, 2009
1,305
733
The grey question mark is totally different from the grey stop sign.

The grey question mark means that your Mac could not find a disk with an operating system on. It happens before the OS is even loaded so it's 100% unrelated to Trim.

This is what happened to me, then once I got it started and the new OS loaded, it put trim in a incompatible software folder. So I put it back in the active apps folder and tried to update to 3.3 and it says "Update Error, the update is improperly signed".

I had no choice but to update to 10.10.1 since one of my new camera's raw file thumbs would not be readable without doing it, a productivity standoff.

So I still have the old trim, it is not enabled and I have a ton of work to do and don't want to hose it....now what?
 

iamMacPerson

macrumors 68040
Jun 12, 2011
3,488
1,927
AZ/10.0.1.1
I use to think that as well, but I inadvertently updated to 10.10.2 the other day without thinking to disable trim enabler on my Mini and it updated just fine. So has something changed, was that false advice, or was I just lucky?

Yeah it went fine for me too when I upgraded to the beta. I would be careful though. That beta is trouble. I have been testing it on my rMBP and it has been problematic. I would still be running it on my Mac Pro but it did something one time it rebooted (still don't know what) and since I had TRIM enabled it brought me to the prohibited sign at boot. I used the Terminal app in the Recovery Partition to fix it and when I booted back into the OS I couldn't get TRIM to work again. Finally what I ended up doing was erasing the drive, reinstalling OS X, and manually dragging my data back from my Time Machine volume (no Migration Assistant used here).
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.