<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Trim function works well on Linux/Ubuntu 9.10 64-bit in Archive</title>
    <link>https://community.solidigm.com/t5/archive/trim-function-works-well-on-linux-ubuntu-9-10-64-bit/m-p/1997#M1859</link>
    <description>&lt;P&gt;That's good news.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The big companies like Intel and Microsoft need to come out of their cave mentality. They thrive own their intellectual engineering thinking that no one else but them can come up with engineering solutions that will benefit the masses.  For Intel this is readily evident, in their lack of providing even a minimal of of help to their users and the tight-lip on how their SSDs work in general.  Anandtech took their drives apart and they did a excellent job of explaining how the Intel drive works  without Intel's help.  Shame on Intel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's going to take Microsoft and the vendors probably a year to get TRIM working harmoniously without data loss. The  Linux and the Unix brethren will have things working in months.  The proof is in your post.  As I said before in another thread Microsoft did not design Win7 to optimize the use of SSDs.  Their tactic was purely "hype" and as usual people fell for it and are now surely disappointed with its implementation.&lt;/P&gt;</description>
    <pubDate>Fri, 20 Nov 2009 21:49:22 GMT</pubDate>
    <dc:creator>idata</dc:creator>
    <dc:date>2009-11-20T21:49:22Z</dc:date>
    <item>
      <title>Trim function works well on Linux/Ubuntu 9.10 64-bit</title>
      <link>https://community.solidigm.com/t5/archive/trim-function-works-well-on-linux-ubuntu-9-10-64-bit/m-p/1996#M1858</link>
      <description>&lt;P&gt;For those waiting for an updated TRIM enabled firmware for their x25-m 80gb g2 postville:&lt;/P&gt;&lt;P&gt;I flashed my drive and am trimming away!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you track the conversation from here onwards you should be all set: &lt;A href="http://www.ocztechnologyforum.com/forum/showthread.php?t=60882&amp;amp;page=10" rel="nofollow noopener noreferrer"&gt;http://www.ocztechnologyforum.com/forum/showthread.php?t=60882&amp;amp;page=10&lt;/A&gt;&lt;/P&gt;&lt;P&gt;1) download hdparm 9.27&lt;/P&gt;&lt;P&gt;2) make, make install&lt;/P&gt;&lt;P&gt;3) apply the latest patch mentioned in the thread above as presented on page 10 by danekl&lt;/P&gt;&lt;P&gt;4) copy &lt;A href="http://wiper.sh" rel="nofollow noopener noreferrer"&gt;wiper.sh&lt;/A&gt; to usr/local/bin&lt;/P&gt;&lt;P&gt;5) run from terminal: sudo &lt;A href="http://wiper.sh" rel="nofollow noopener noreferrer"&gt;wiper.sh&lt;/A&gt; --commit / or sudo &lt;A href="http://wiper.sh" rel="nofollow noopener noreferrer"&gt;wiper.sh&lt;/A&gt; --commit /dev/sdaN (where sdaN is your ssd)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BTW, this is not real TRIM but gives the same effect. I run this each time at system start up.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Skip Windows, go Ubuntu!&lt;/P&gt;</description>
      <pubDate>Fri, 20 Nov 2009 18:51:24 GMT</pubDate>
      <guid>https://community.solidigm.com/t5/archive/trim-function-works-well-on-linux-ubuntu-9-10-64-bit/m-p/1996#M1858</guid>
      <dc:creator>idata</dc:creator>
      <dc:date>2009-11-20T18:51:24Z</dc:date>
    </item>
    <item>
      <title>Re: Trim function works well on Linux/Ubuntu 9.10 64-bit</title>
      <link>https://community.solidigm.com/t5/archive/trim-function-works-well-on-linux-ubuntu-9-10-64-bit/m-p/1997#M1859</link>
      <description>&lt;P&gt;That's good news.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The big companies like Intel and Microsoft need to come out of their cave mentality. They thrive own their intellectual engineering thinking that no one else but them can come up with engineering solutions that will benefit the masses.  For Intel this is readily evident, in their lack of providing even a minimal of of help to their users and the tight-lip on how their SSDs work in general.  Anandtech took their drives apart and they did a excellent job of explaining how the Intel drive works  without Intel's help.  Shame on Intel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's going to take Microsoft and the vendors probably a year to get TRIM working harmoniously without data loss. The  Linux and the Unix brethren will have things working in months.  The proof is in your post.  As I said before in another thread Microsoft did not design Win7 to optimize the use of SSDs.  Their tactic was purely "hype" and as usual people fell for it and are now surely disappointed with its implementation.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Nov 2009 21:49:22 GMT</pubDate>
      <guid>https://community.solidigm.com/t5/archive/trim-function-works-well-on-linux-ubuntu-9-10-64-bit/m-p/1997#M1859</guid>
      <dc:creator>idata</dc:creator>
      <dc:date>2009-11-20T21:49:22Z</dc:date>
    </item>
    <item>
      <title>Re: Trim function works well on Linux/Ubuntu 9.10 64-bit</title>
      <link>https://community.solidigm.com/t5/archive/trim-function-works-well-on-linux-ubuntu-9-10-64-bit/m-p/1998#M1860</link>
      <description>&lt;P&gt;FYI. here's the putput I get:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[Sat Nov 21 21:06:56 CET 2009] trim starting&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://wiper.sh" rel="nofollow noopener noreferrer"&gt;wiper.sh&lt;/A&gt;: Linux SATA SSD TRIM utility, version 2.5, by Mark Lord.&lt;/P&gt;Preparing for online TRIM of free space on /dev/sda1 (ext4 mounted read-write at /).Creating temporary file (65301988 KB).. Syncing disks.. Beginning TRIM operations..&lt;P&gt;&lt;/P&gt;&lt;P&gt;/dev/sda:&lt;/P&gt;trimming 30195709 sectors from 512 rangessucceeded&lt;P&gt;&lt;/P&gt;&lt;P&gt;/dev/sda:&lt;/P&gt;trimming 31358977 sectors from 512 rangessucceeded&lt;P&gt;&lt;/P&gt;&lt;P&gt;/dev/sda:&lt;/P&gt;trimming 31293442 sectors from 512 rangessucceeded&lt;P&gt;&lt;/P&gt;&lt;P&gt;/dev/sda:&lt;/P&gt;trimming 31457280 sectors from 512 rangessucceeded&lt;P&gt;&lt;/P&gt;&lt;P&gt;/dev/sda:&lt;/P&gt;trimming 6298568 sectors from 104 rangessucceededRemoving temporary file..Syncing disks.. Done. [Sat Nov 21 21:07:16 CET 2009] trim finished</description>
      <pubDate>Sat, 21 Nov 2009 21:12:34 GMT</pubDate>
      <guid>https://community.solidigm.com/t5/archive/trim-function-works-well-on-linux-ubuntu-9-10-64-bit/m-p/1998#M1860</guid>
      <dc:creator>idata</dc:creator>
      <dc:date>2009-11-21T21:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: Trim function works well on Linux/Ubuntu 9.10 64-bit</title>
      <link>https://community.solidigm.com/t5/archive/trim-function-works-well-on-linux-ubuntu-9-10-64-bit/m-p/1999#M1861</link>
      <description>&lt;P&gt;really nice to hear.  i'm new to ssds and therefore pretty unsure how to handle my x25-m g2. i opened two threads, maybe someone could give me an advice please:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- &lt;A href="http://communities.intel.com/thread/8419" rel="nofollow noopener noreferrer"&gt;http://communities.intel.com/thread/8419&lt;/A&gt;&lt;/P&gt;&lt;P&gt;- &lt;A href="http://sourceforge.net/projects/hdparm/forums/forum/461704/topic/3466536" rel="nofollow noopener noreferrer"&gt;http://sourceforge.net/projects/hdparm/forums/forum/461704/topic/3466536&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2009 20:09:19 GMT</pubDate>
      <guid>https://community.solidigm.com/t5/archive/trim-function-works-well-on-linux-ubuntu-9-10-64-bit/m-p/1999#M1861</guid>
      <dc:creator>idata</dc:creator>
      <dc:date>2009-11-23T20:09:19Z</dc:date>
    </item>
    <item>
      <title>Re: Trim function works well on Linux/Ubuntu 9.10 64-bit</title>
      <link>https://community.solidigm.com/t5/archive/trim-function-works-well-on-linux-ubuntu-9-10-64-bit/m-p/2000#M1862</link>
      <description>&lt;P&gt;blackSP,&lt;/P&gt;&lt;P&gt;  I tried it and i'm having no success. Downloaded from &lt;A href="http://sourceforge.net" rel="nofollow noopener noreferrer"&gt;sourceforge.net&lt;/A&gt; the hdparm 9.27 source which included &lt;A href="http://wiper.sh" rel="nofollow noopener noreferrer"&gt;wiper.sh&lt;/A&gt;.  I'm using 9.10 32 bit PAE mode on a Macbook pro 5,2. 6 GB memory.  Gives me an error message cannot open file.  I put some debug statements in the program to see how big the WIPEFILE is and it is huge.  It fills the remainder of the drive space.  What i'm doing wrong?  I didn't apply the patch also?.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Appreciate any help.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Nov 2009 03:02:34 GMT</pubDate>
      <guid>https://community.solidigm.com/t5/archive/trim-function-works-well-on-linux-ubuntu-9-10-64-bit/m-p/2000#M1862</guid>
      <dc:creator>idata</dc:creator>
      <dc:date>2009-11-24T03:02:34Z</dc:date>
    </item>
    <item>
      <title>Re: Trim function works well on Linux/Ubuntu 9.10 64-bit</title>
      <link>https://community.solidigm.com/t5/archive/trim-function-works-well-on-linux-ubuntu-9-10-64-bit/m-p/2001#M1863</link>
      <description>&lt;P&gt;This is exactly the output:&lt;/P&gt;&lt;P&gt;&lt;A href="http://wiper.sh" rel="nofollow noopener noreferrer"&gt;wiper.sh&lt;/A&gt;: Linux SATA SSD TRIM utility, version 2.5, by Mark Lord.&lt;/P&gt;rootdev=/dev/sda1 rdev=/dev/sda1fsmode2: fsmode=read-write/: fstype=ext4freesize = 132285104 KB, reserved = 1322851 KBPreparing for online TRIM of free space on /dev/sda1 (ext4 mounted read-write at /).This will be a DRY-RUN only.  Use --commit to do it for real.Creating temporary file (130962253 KB).. Syncing disks.. Simulating TRIM operations..get_trimlist=/sbin/hdparm --fibmap WIPER_TMPFILE.3818(dry-run) trimming 261924512 sectors from 4280 rangesRemoving temporary file..Syncing disks.. Done.</description>
      <pubDate>Tue, 24 Nov 2009 04:07:39 GMT</pubDate>
      <guid>https://community.solidigm.com/t5/archive/trim-function-works-well-on-linux-ubuntu-9-10-64-bit/m-p/2001#M1863</guid>
      <dc:creator>idata</dc:creator>
      <dc:date>2009-11-24T04:07:39Z</dc:date>
    </item>
    <item>
      <title>Re: Trim function works well on Linux/Ubuntu 9.10 64-bit</title>
      <link>https://community.solidigm.com/t5/archive/trim-function-works-well-on-linux-ubuntu-9-10-64-bit/m-p/2002#M1864</link>
      <description>&lt;P&gt;Sorry, being a complete noob I can't help you, I've been fiddeling for days myself to get &lt;A href="http://wiper.sh" rel="nofollow noopener noreferrer"&gt;wiper.sh&lt;/A&gt; to work!&lt;/P&gt;&lt;P&gt;I ended up registering on the OCZ form where the guys where extremely helpfull and made a few patches that were essential to get wiper to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I first followed up another suggestion: use wiper 1.9 and that worked straight away!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But... before you do anything ensure your drive supports trim, flash it (with the firmware Intel tookoffline). Linux is no Windows 7 so your machine shouldn't hang. Mine didn't!&lt;/P&gt;</description>
      <pubDate>Tue, 24 Nov 2009 12:40:10 GMT</pubDate>
      <guid>https://community.solidigm.com/t5/archive/trim-function-works-well-on-linux-ubuntu-9-10-64-bit/m-p/2002#M1864</guid>
      <dc:creator>idata</dc:creator>
      <dc:date>2009-11-24T12:40:10Z</dc:date>
    </item>
    <item>
      <title>Re: Trim function works well on Linux/Ubuntu 9.10 64-bit</title>
      <link>https://community.solidigm.com/t5/archive/trim-function-works-well-on-linux-ubuntu-9-10-64-bit/m-p/2003#M1865</link>
      <description>&lt;P&gt;Thanks, blackSP.  My ssd has the right firmware. I upgraded before Intel pulled it.  I will try the wiper 1.9 version.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Nov 2009 13:35:11 GMT</pubDate>
      <guid>https://community.solidigm.com/t5/archive/trim-function-works-well-on-linux-ubuntu-9-10-64-bit/m-p/2003#M1865</guid>
      <dc:creator>idata</dc:creator>
      <dc:date>2009-11-24T13:35:11Z</dc:date>
    </item>
    <item>
      <title>Re: Trim function works well on Linux/Ubuntu 9.10 64-bit</title>
      <link>https://community.solidigm.com/t5/archive/trim-function-works-well-on-linux-ubuntu-9-10-64-bit/m-p/2004#M1866</link>
      <description>&lt;P&gt;I upgraded my Intel G2 80GB SSD to the newest firmware ending in HD&lt;/P&gt;&lt;P&gt;I have hdparm 9.27 installed on my Arch Linux system&lt;/P&gt;&lt;P&gt;I patched the &lt;A href="http://wiper.sh" rel="nofollow noopener noreferrer"&gt;wiper.sh&lt;/A&gt; v2.5 to work for the Intel SSD and named it &lt;A href="http://wiper-intel.sh" rel="nofollow noopener noreferrer"&gt;wiper-intel.sh&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now &lt;A href="http://wiper-intel.sh" rel="nofollow noopener noreferrer"&gt;wiper-intel.sh&lt;/A&gt; works. I no longer get the "Input/Output Error"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I uploaded the patched &lt;A href="http://wiper.sh" rel="nofollow noopener noreferrer"&gt;wiper.sh&lt;/A&gt; to rapidshare here...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://rapidshare.com/files/349948975/wiper-intel.sh" rel="nofollow noopener noreferrer"&gt;http://rapidshare.com/files/349948975/wiper-intel.sh&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MD5sum= 90e596a399ff6660c8542bf6be1d58ce&lt;/P&gt;&lt;P&gt;SHA1sum= f1af639d00a671532069ccf6407a91a35bf94521&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the output of the last run of &lt;A href="http://wiper-intel.sh" rel="nofollow noopener noreferrer"&gt;wiper-intel.sh&lt;/A&gt; on the ext4 /root partition on my Intel SSD&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[XXXXX@LinuxBox ~]$ sudo ./&lt;A href="http://wiper-intel.sh" rel="nofollow noopener noreferrer"&gt;wiper-intel.sh&lt;/A&gt; --commit /dev/sda2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://wiper-intel.sh" rel="nofollow noopener noreferrer"&gt;wiper-intel.sh&lt;/A&gt;: Linux SATA SSD TRIM utility, version 2.5, by Mark Lord.&lt;/P&gt;Preparing for online TRIM of free space on /dev/sda2 (ext4 mounted read-write at /).&lt;P&gt;&lt;/P&gt;&lt;P&gt;This operation could silently destroy your data.  Are you sure (y/N)? y&lt;/P&gt;Creating temporary file (45499969 KB).. Syncing disks.. Beginning TRIM operations..&lt;P&gt;&lt;/P&gt;&lt;P&gt;/dev/sda:&lt;/P&gt;trimming 31178749 sectors from 512 rangessucceeded&lt;P&gt;&lt;/P&gt;&lt;P&gt;/dev/sda:&lt;/P&gt;trimming 31375361 sectors from 512 rangessucceeded&lt;P&gt;&lt;/P&gt;&lt;P&gt;/dev/sda:&lt;/P&gt;trimming 28445834 sectors from 464 rangessucceededRemoving temporary file..Syncing disks.. Done.</description>
      <pubDate>Sat, 13 Feb 2010 09:19:32 GMT</pubDate>
      <guid>https://community.solidigm.com/t5/archive/trim-function-works-well-on-linux-ubuntu-9-10-64-bit/m-p/2004#M1866</guid>
      <dc:creator>idata</dc:creator>
      <dc:date>2010-02-13T09:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: Trim function works well on Linux/Ubuntu 9.10 64-bit</title>
      <link>https://community.solidigm.com/t5/archive/trim-function-works-well-on-linux-ubuntu-9-10-64-bit/m-p/2005#M1867</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an Intel G2 160 GB SSD. I have not been able to download the modified script from rapidshare, but from somewhere else, even though I cannot be sure of the integrity of the script then. It first seems to be OK (maximum number of displayed ranges is 512), but I'm still having the input/output errors.&lt;/P&gt;&lt;P&gt;1) can someone confirm that it also work on 160 GB model?&lt;/P&gt;&lt;P&gt;2) if so, could you indicate an alternate trustworthy download location?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 18 Feb 2010 08:46:02 GMT</pubDate>
      <guid>https://community.solidigm.com/t5/archive/trim-function-works-well-on-linux-ubuntu-9-10-64-bit/m-p/2005#M1867</guid>
      <dc:creator>ÉChem</dc:creator>
      <dc:date>2010-02-18T08:46:02Z</dc:date>
    </item>
    <item>
      <title>Re: Trim function works well on Linux/Ubuntu 9.10 64-bit</title>
      <link>https://community.solidigm.com/t5/archive/trim-function-works-well-on-linux-ubuntu-9-10-64-bit/m-p/2006#M1868</link>
      <description>&lt;P&gt;Hum, that link still works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, so it is not working ? LIke it quits with an Input/Output error? Or are you getting errors in /var/log/messages ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, the script is farly small. You can just read it to make sure it is not running netcat on some random port and emilling off your IP to some randome email account or something like that. Hell, you may be best off to to that anyway. my point being that you can read the script there really is not need for the hash values as far as security is consered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;----------&lt;/P&gt;&lt;P&gt;Ok I just posted the script below. Make sure word-wraping dosen't mess up the code.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Feb 2010 06:23:21 GMT</pubDate>
      <guid>https://community.solidigm.com/t5/archive/trim-function-works-well-on-linux-ubuntu-9-10-64-bit/m-p/2006#M1868</guid>
      <dc:creator>idata</dc:creator>
      <dc:date>2010-02-19T06:23:21Z</dc:date>
    </item>
    <item>
      <title>Re: Trim function works well on Linux/Ubuntu 9.10 64-bit</title>
      <link>https://community.solidigm.com/t5/archive/trim-function-works-well-on-linux-ubuntu-9-10-64-bit/m-p/2007#M1869</link>
      <description>&lt;P&gt;# !/bin/bash&lt;/P&gt;# #  SATA SSD free-space TRIM utility, by Mark Lord&lt;P&gt;&lt;/P&gt;&lt;P&gt;VERSION=2.5&lt;/P&gt; #  Copyright (C) 2009 Mark Lord.  All rights reserved.# #  Requires gawk, a really-recent hdparm, and various other programs.#  This needs to be redone entirely in C, for 64-bit math, someday.#  #  This program is free software; you can redistribute it and/or#  modify it under the terms of the GNU General Public License Version 2,#  as published by the Free Software Foundation.#  #  This program is distributed in the hope that it would be useful,#  but WITHOUT ANY WARRANTY; without even the implied warranty of#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the#  GNU General Public License for more details.# #  You should have received a copy of the GNU General Public License#  along with this program; if not, write to the Free Software Foundation,#  Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA&lt;P&gt;&lt;/P&gt;&lt;P&gt;export LANG=C&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#  The usual terse usage information:&lt;/P&gt;# function usage_error(){    echo &amp;gt;&amp;amp;2    echo "Linux tune-up (TRIM) utility for SATA SSDs"    echo "Usage:  $0 [--verbose] [--commit] " &amp;gt;&amp;amp;2    echo "   Eg:  $0 /dev/sda1" &amp;gt;&amp;amp;2    echo &amp;gt;&amp;amp;2    exit 1}&lt;P&gt;&lt;/P&gt;&lt;P&gt;#  Parameter parsing for the main script.&lt;/P&gt;#  Yeah, we could use getopt here instead, but what fun would that be?# &lt;P&gt;&lt;/P&gt;&lt;P&gt;echo&lt;/P&gt;echo "${0# */}: Linux SATA SSD TRIM utility, version $VERSION, by Mark Lord."&lt;P&gt;&lt;/P&gt;&lt;P&gt;verbose=0&lt;/P&gt;commit=""argc=$# arg=""while [ $argc -gt 0 ]; do    if [ "$1" = "--commit" ]; then        commit=yes    elif [ "$1" = "--verbose" ]; then        verbose=1    elif [ "$1" = "" ]; then        usage_error    else        if [ "$arg" != "" ]; then            echo "$1: too many arguments, aborting." &amp;gt;&amp;amp;2            exit 1        fi        arg="$1"    fi    argc=$((argc - 1))    shiftdone[ "$arg" = "" ] &amp;amp;&amp;amp; usage_error&lt;P&gt;&lt;/P&gt;&lt;P&gt;#  Find a required program, or else give a nicer error message than we'd otherwise see:&lt;/P&gt;# function find_prog(){    prog="$1"    if [ ! -x "$prog" ]; then        prog="${prog# */}"        p=`type -f -P "$prog" 2&amp;gt;/dev/null`        if [ "$p" = "" ]; then            echo "$1: needed but not found, aborting." &amp;gt;&amp;amp;2            exit 1        fi        prog="$p"        [ $verbose -gt 0 ] &amp;amp;&amp;amp; echo "  --&amp;gt; using $prog instead of $1" &amp;gt;&amp;amp;2    fi    echo "$prog"}&lt;P&gt;&lt;/P&gt;&lt;P&gt;#  Ensure we have most of the necessary utilities available before trying to proceed:&lt;/P&gt;# hash -r  #  Refresh bash's cached PATH entriesHDPARM=`find_prog /sbin/hdparm`    || exit 1FIND=`find_prog /usr/bin/find`    || exit 1STAT=`find_prog /usr/bin/stat`    || exit 1GAWK=`find_prog /usr/bin/gawk`    || exit 1BLKID=`find_prog /sbin/blkid`    || exit 1GREP=`find_prog /bin/grep`    || exit 1ID=`find_prog /usr/bin/id`    || exit 1LS=`find_prog /bin/ls`        || exit 1DF=`find_prog /bin/df`        || exit 1RM=`find_prog /bin/rm`        || exit 1&lt;P&gt;&lt;/P&gt;&lt;P&gt;#  I suppose this will confuse the three SELinux users out there:&lt;/P&gt;# if [ `$ID -u` -ne 0 ]; then    echo "Only the super-user can use this (try \"sudo $0\" instead), aborting." &amp;gt;&amp;amp;2    exit 1fi&lt;P&gt;&lt;/P&gt;&lt;P&gt;#  We need a very modern hdparm, for its --fallocate and --trim-sector-ranges-stdin flags:&lt;/P&gt;#  Version 9.25 added automatic determination of safe max-size of TRIM commands.# HDPVER=`$HDPARM -V | $GAWK '{gsub("[^0-9.]","",$2); if ($2 &amp;gt; 0) print ($2 * 100); else print 0; exit(0)}'`if [ $HDPVER -lt 925 ]; then    echo "$HDPARM: version &amp;gt;= 9.25 is required, aborting." &amp;gt;&amp;amp;2    exit 1fi&lt;P&gt;&lt;/P&gt;&lt;P&gt;#  Convert relative path "$1" into an absolute pathname, resolving all symlinks:&lt;/P&gt;# function get_realpath(){    iter=0    p="$1"    while [ -e "$p" -a $iter -lt 100 ]; do        #  Strip trailing slashes:        while [ "$p" != "/" -a "$p" != "${p%%/}" ]; do            p="${p%%/}"        done        #  Split into directory:leaf portions:        d="${p%/*}"        t="${p# */}"        #  If the split worked, then cd into the directory portion:        if [ "$d" != "" -a "$d" != "$p" ]; then            cd -P "$d" || exit            p="$t"        fi        #  If what we have left is a directory, then cd to it and print realpath:        if [ -d "$p" ]; then            cd -P "$p" || exit            pwd -P            exit        #  Otherwise if it is a symlink, read the link and loop again:        ...</description>
      <pubDate>Fri, 19 Feb 2010 06:27:47 GMT</pubDate>
      <guid>https://community.solidigm.com/t5/archive/trim-function-works-well-on-linux-ubuntu-9-10-64-bit/m-p/2007#M1869</guid>
      <dc:creator>idata</dc:creator>
      <dc:date>2010-02-19T06:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: Trim function works well on Linux/Ubuntu 9.10 64-bit</title>
      <link>https://community.solidigm.com/t5/archive/trim-function-works-well-on-linux-ubuntu-9-10-64-bit/m-p/2008#M1870</link>
      <description>&lt;P&gt;Thanks for your answer! I have the same problem though:&lt;/P&gt;&lt;P&gt;/dev/sda:&lt;/P&gt;trimming 154928 sectors from 164 rangesFAILED: Input/output error&lt;P&gt;&lt;/P&gt;&lt;P&gt;And hdparm -i shows Model=INTEL SSDSA2M160G2GC, FwRev=2CV102HD, so I have the right FW, right?&lt;/P&gt;</description>
      <pubDate>Fri, 19 Feb 2010 18:50:10 GMT</pubDate>
      <guid>https://community.solidigm.com/t5/archive/trim-function-works-well-on-linux-ubuntu-9-10-64-bit/m-p/2008#M1870</guid>
      <dc:creator>ÉChem</dc:creator>
      <dc:date>2010-02-19T18:50:10Z</dc:date>
    </item>
    <item>
      <title>Re: Trim function works well on Linux/Ubuntu 9.10 64-bit</title>
      <link>https://community.solidigm.com/t5/archive/trim-function-works-well-on-linux-ubuntu-9-10-64-bit/m-p/2009#M1871</link>
      <description>&lt;P&gt;News from the front:&lt;/P&gt;&lt;P&gt;I've just booted using the live CD (still 9.10 64 bit), installe hdparm 9.27 and use your modified script: it works!&lt;/P&gt;&lt;P&gt;I will try to find out what make it fails on my install and let you know if interesting.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 19 Feb 2010 19:27:36 GMT</pubDate>
      <guid>https://community.solidigm.com/t5/archive/trim-function-works-well-on-linux-ubuntu-9-10-64-bit/m-p/2009#M1871</guid>
      <dc:creator>ÉChem</dc:creator>
      <dc:date>2010-02-19T19:27:36Z</dc:date>
    </item>
    <item>
      <title>Re: Trim function works well on Linux/Ubuntu 9.10 64-bit</title>
      <link>https://community.solidigm.com/t5/archive/trim-function-works-well-on-linux-ubuntu-9-10-64-bit/m-p/2010#M1872</link>
      <description>&lt;P&gt;As far as I know it only works with hdparm 9.27, since I installed that my disk is trimmed with every boot, no i/o errors.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Feb 2010 20:52:43 GMT</pubDate>
      <guid>https://community.solidigm.com/t5/archive/trim-function-works-well-on-linux-ubuntu-9-10-64-bit/m-p/2010#M1872</guid>
      <dc:creator>idata</dc:creator>
      <dc:date>2010-02-19T20:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: Trim function works well on Linux/Ubuntu 9.10 64-bit</title>
      <link>https://community.solidigm.com/t5/archive/trim-function-works-well-on-linux-ubuntu-9-10-64-bit/m-p/2011#M1873</link>
      <description>&lt;P&gt;Update: it seems that it is coming from the 2.6.32 kernel (from Ubuntu PPA) I'm using. When using latest 2.6.31 kernel from Ubuntu it's working as intended.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2010 19:56:16 GMT</pubDate>
      <guid>https://community.solidigm.com/t5/archive/trim-function-works-well-on-linux-ubuntu-9-10-64-bit/m-p/2011#M1873</guid>
      <dc:creator>ÉChem</dc:creator>
      <dc:date>2010-02-25T19:56:16Z</dc:date>
    </item>
    <item>
      <title>Re: Trim function works well on Linux/Ubuntu 9.10 64-bit</title>
      <link>https://community.solidigm.com/t5/archive/trim-function-works-well-on-linux-ubuntu-9-10-64-bit/m-p/2012#M1874</link>
      <description>&lt;P&gt;I can confirm that there seems to be a problem with the 2.6.32-kernel in Ubuntu&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get input/output-errors (though not always, some of the TRIM commands succeed) with 2.6.32. But using 2.6.35-rc1, all TRIM commands succeed.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jul 2010 20:32:48 GMT</pubDate>
      <guid>https://community.solidigm.com/t5/archive/trim-function-works-well-on-linux-ubuntu-9-10-64-bit/m-p/2012#M1874</guid>
      <dc:creator>idata</dc:creator>
      <dc:date>2010-07-09T20:32:48Z</dc:date>
    </item>
  </channel>
</rss>

