Tag Archives: HowTo

How to determine Intel SSD Endurance on Mac OS X

I’ve been chatting with @garyorenstein on Twitter about his upgrade from the stock spinning rust HDD in his MacBook Pro, to an Intel 320 Series SSD. This is an upgrade that I’ve undertaken before.

I started thinking about endurance. Commercial grade MLC SSD products have a bad reputation for early wear-out. I wanted to see what I could do to determine how much life my SSD has in it, according to Intel.

Intel has their Intel SSD Toolbox, which is available for Windows only. This isn’t much help for those of us running Mac OS X.

I’ve used smartmontools, specifically the smartctl command line program, under Linux and Mac OS X in the past.  It’s available for Mac as part of MacPorts. I updated my smartmontools package, and ran a quick view of the drive using “smartctl -a disk0″. The output includes a section with the SMART attributes, and I was hoping to see some SSD specific information. Here’s that section:

SMART Attributes Data Structure revision number: 5
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
 3 Spin_Up_Time 0x0020 100 100 000 Old_age Offline - 0
 4 Start_Stop_Count 0x0030 100 100 000 Old_age Offline - 0
 5 Reallocated_Sector_Ct 0x0032 100 100 000 Old_age Always - 12
 9 Power_On_Hours 0x0032 100 100 000 Old_age Always - 585
 12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 1239
170 Unknown_Attribute 0x0033 100 100 010 Pre-fail Always - 0
171 Unknown_Attribute 0x0032 100 100 000 Old_age Always - 0
172 Unknown_Attribute 0x0032 100 100 000 Old_age Always - 0
183 Unknown_Attribute 0x0030 100 100 000 Old_age Offline - 0
184 Unknown_Attribute 0x0032 100 100 090 Old_age Always - 0
187 Reported_Uncorrect 0x0032 100 100 000 Old_age Always - 0
192 Power-Off_Retract_Count 0x0032 100 100 000 Old_age Always - 19
199 UDMA_CRC_Error_Count 0x0030 100 100 000 Old_age Offline - 0
225 Load_Cycle_Count 0x0032 100 100 000 Old_age Always - 76344
226 Load-in_Time 0x0032 100 100 000 Old_age Always - 21155
227 Torq-amp_Count 0x0032 100 100 000 Old_age Always - 14
228 Power-off_Retract_Count 0x0032 100 100 000 Old_age Always - 2147518782
232 Unknown_Attribute 0x0033 100 100 010 Pre-fail Always - 0
233 Unknown_Attribute 0x0032 100 100 000 Old_age Always - 0
241 Unknown_Attribute 0x0032 100 100 000 Old_age Always - 76344
242 Unknown_Attribute 0x0032 100 100 000 Old_age Always - 88070

 

Nothing really stood out, except all those “Unknown Attributes”.

A little research revealed that MacPorts has a very old outdated version of smartmontools, version 5.38, which dates back prior to the common use of SSDs that we see today.

Since MacPorts didn’t have the latest code, I downloaded the latest directly from Sourceforge. It configures, compiles and installs cleanly, but to /usr/local/bin which is NOT ealier in the path than the Macports version. Users should remove the old version, located in /opt/local/sbin.

Running the command now gave me updated attributes titles:

SMART Attributes Data Structure revision number: 5
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
 3 Spin_Up_Time 0x0020 100 100 000 Old_age Offline - 0
 4 Start_Stop_Count 0x0030 100 100 000 Old_age Offline - 0
 5 Reallocated_Sector_Ct 0x0032 100 100 000 Old_age Always - 12
 9 Power_On_Hours 0x0032 100 100 000 Old_age Always - 587
 12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 1242
170 Reserve_Block_Count 0x0033 100 100 010 Pre-fail Always - 0
171 Program_Fail_Count 0x0032 100 100 000 Old_age Always - 0
172 Erase_Fail_Count 0x0032 100 100 000 Old_age Always - 0
183 Runtime_Bad_Block 0x0030 100 100 000 Old_age Offline - 0
184 End-to-End_Error 0x0032 100 100 090 Old_age Always - 0
187 Reported_Uncorrect 0x0032 100 100 000 Old_age Always - 0
192 Unsafe_Shutdown_Count 0x0032 100 100 000 Old_age Always - 19
199 UDMA_CRC_Error_Count 0x0030 100 100 000 Old_age Offline - 0
225 Host_Writes_32MiB 0x0032 100 100 000 Old_age Always - 76433
226 Workld_Media_Wear_Indic 0x0032 100 100 000 Old_age Always - 2147483643
227 Workld_Host_Reads_Perc 0x0032 100 100 000 Old_age Always - 281457729732607
228 Workload_Minutes 0x0032 100 100 000 Old_age Always - 4294967295
232 Available_Reservd_Space 0x0033 100 100 010 Pre-fail Always - 0
233 Media_Wearout_Indicator 0x0032 100 100 000 Old_age Always - 0
241 Host_Writes_32MiB 0x0032 100 100 000 Old_age Always - 76433
242 Host_Reads_32MiB 0x0032 100 100 000 Old_age Always - 88076

 

A bit of further research showed the following areas that are of most interest to understanding the history to dateof the drive: ”233 Media_Wearout_Indicator” and “241 Host_Writes_32MiB”. If my understanding is correct, “Media_Wearout_Indicator” is the total life left to the nearest 1% in the Value (not Raw Value) column. Mine is showing 100, indicating that I’ve written less than 1% of the expected write lifetime. “Host_Writes_32MiB” is how much capacity of writes have been done to the drive since shipment, in 32MiB (MebiBytes). For those of you who aren’t familiar with it, a Mebibyte is 1,048,576 bytes, the base-2 number we are familiar with and sometimes call a MegaByte. Disk manufacturers use 1,000,000 bytes as a MegaByte, operating systems use 1,048,576 bytes as a MegaByte, but for disambiguation in the disk capacity world, a MebiByte is 1,048,576 bytes and a MegaByte is 1,000,000 bytes. This is why your 160GB drive formats to 149GB in the OS. It has little to do with space lost to partitioning or file system formatting, and almost entirely to do with MiB vs MB. 160MB*1,000,000/1,048,576=152MiB (or MB according to most OS tools).

But I digress!  According to smartctl, my laptop SSD has absorbed  76443*32MiB, or a little under 2.3TiB.

I then looked up the endurance claims for my 300GB Intel 320 Series SSD. It was a disappointingly low 30TB!!! What the heck! BUT…. reading more closely, that’s 30TB written at 4K random write via a benchmarking tool. Mac OS X will write larger than 4K when it can, unlike, say, Linux, that writes buffered writes at 4K size regardless of the size of the write by the application, and if you are lucky, write merges can make the writes larger again.

So, does this all add up? Nope. According to Intel’s specs, I should have used up approximately 13% (2/15) of my write endurance. How much that was alleviated by large block writes, or how much of the difference is due to buggy output by the drive, is unknown.

So, I now know how to measure how used my drive is. The life left, according to the SMART attributes, is huge. Then again, I found out that this drive is supposed to wear out as early as 30TB of writes, so it really should only be used as a laptop drive, never as a server drive in an enterprise environment (but I knew that already, because I work for Fusion-io).

Not really sure if I feel better or worse about my Intel 320 Series SSD at this point in time! I’m really happy with the performance, and I should be happy with that. Any SSD or HDD can die at any time, that’s what a good backup strategy is there for.

 


 

Savannah Stoker Auto-Tune

 

The Savannah Stoker is a PID controller upgrade for the Traeger brand of pellet grill. PID controllers get their name from the type of feedback loop they use to control the output. PID is short for “Proportional Integral Derivative”. A good description for those of atechnical bent can be found on the Wikipedia listing for PID Controller.

Savannah Stoker

The Savannah Stoker comes with pre-set numbers for the variables, such as the minimum temperature, and the maximum, but also for various outputs that determine, for example, the duty cycle of the auger at the minimum and and on the maximum.

For those that are interested in modifying these values, especially those who may have modified their Traeger on other ways (high speed auger motor, insulation, firebricks, etc.), they may find that they’d  like to play with the stock values.In addition, there is an Auto Tune function built into the controller module on which the Savannah Stoker is based.The following notes are taken from the manufacturers notes:

In order to start an Auto Tune, initiate normal start up and set the SV (Set Value) lower number to 250 temperature. When the pit is stable at 250, initiate the Auto Tune sequence as noted below.

  • Press and hold the Set Key to enter into the Parameter’s Menu which will show up in the PV Display (upper number) which is normally the sensor read out (pit temperature).
  • Once in the menu each time the Set Key is press the menu advances to next parameter.
  • Advance through the menu and record the current I, P and D Parameters (numbers) for reference. This way you can reset it to “factory” if you want to go back.
  • If you exit out of the menu just press and hold the Set Key to again enter the menu. To change parameters’ values use the up and down arrows.
  • Advance the menu to AT and you will see the number next to AT is 3 (normally).
  • Use the Down Arrow to change the number to 2.
  • Wait 3 to 5 seconds and the numbers in the SV Display (lower Number) will start flashing which indicates the PID is in the auto tuning mode.  This launches Auto Tune.

The auto tuning is accomplished by the PID by cycling from lower to higher temperatures 2 to 3 times.
When Auto Tuning is finished the numbers with stop flashing.

 

Adding AFP support to Nexenta Core 3.0

Due to the recent abandonment of OpenSolaris by Oracle, I moved my ZFS pools to a Nexenta Core 3.0 installation. In the process, I had lost the netatalk (AFP support) that I had hacked into my OpenSolaris installation.  That AFP support was done using the hints at Nathan Fielder’s blog, both for installation of netatalk on OpenSolaris, as well as making the services browseable via the Mac’s Bonjour capabilities.

I’ve done this reinstall of AFP a couple of times on a few OpenSolaris installations,  and want to make sure I have it all down in one place in case Nathan decides to erase his notes. I also want to capture a couple of other details that make Nexenta a little different than installing on OpenSolaris.

The list of tasks and commands one needs to run on a bare-metal Nexenta Core 3.0 installation differs slightly from OpenSolaris, based on the fact that Nexenta Core has fewer packages installed and fewer services enabled by default.

With appropriate homage paid to Nathan (thanks!), here’s what I did (in summary format) to get things going. I’m documenting it here so I don’t forget, should I choose to do it again on another Nexenta system. While it’s bad form, I did everything as root so you will have to insert your own escalation of privileges where necessary

Install Berkeley DB

  • Download Berkeley DB 4.8 from Oracle (be sure to look for Previous Versions, don’t struggle with the 5.x version)
  • untar the downloaded file and cd to the directory
  • cd build_unix
  • ../dist/configure –prefix=/usr/local
  • make
  • make install

Install netatalk

Add the appropriate OpenLDAP and OpenSSL development libraries so the netatalk configure script will complete correctly. Without libssl-dev, your working AFPD won’t respond to Diffie-Hillman encrypted passwords.

  • apt-get install libldap2-dev
  • apt-get install libssl-dev

Next you will need to download and untar netatalk from freshmeat. Go to the resulting folder, and make and install netatalk:

  • ./configure –without-pam
  • make
  • make install

Finally, configure netatalk (again borrowed from Nathan Fielder’s blog):

  • Edit /usr/local/etc/netatalk/afpd.conf, using the following line that enables encrypted password (that’s the “dhx” part) across all transports:
- -transall -uamlist uams_dhx.so -nosavepassword

  • Finally edit the share points. Open /usr/local/etc/netatalk/AppleVolumes.default in your favorite editor.  I have disabled home directory sharing by remarking out the line starting with ~ (please excuse the formatting and line wrap: If you copy and paste this snippet, it should properly paste as three lines of code, one is remmed out, the two others starting with “cnidscheme”)

#~ cnidscheme:dbd options:usedots,invisibledots,upriv perm:0770 /volumes/greenpool/shared “Shared” allow:bill cnidscheme:dbd options:usedots,invisibledots,upriv perm:0770 /volumes/data/tm-bill “tm-bill” allow:bill cnidscheme:dbd options:usedots,invisibledots,upriv perm:0770

Restart the service with

/etc/init.d/netatalk start

You should now be able to connect to the service via Finder, via the “Go” menu, choose “Connect to Server” and use the format “afp://servername”. Note that the username you chose to put into the AppleVolumes.default for each share must exist as a Nexenta OS user.

In a follow-on blog post, I’ll update this with the installation of DNS Service Discovery (the Open Source standard behind Apple’s Bonjour discovery service) so your other Macs can see the server in Finder. Again, that will borrow heavily from Nathan’s blog.

Comments or corrections are welcome! Comment below!