[zfs-discuss] zfs and fstrim

covici at ccs.covici.com covici at ccs.covici.com
Thu Jan 21 01:11:35 EST 2016


So, what will happen to my ssds?  When I had ext4filesystems, I could
use fstrim and it would work, although I was advised that I should not
use it too often because I might get silent bit corruption and this is
why I wantedto use a file system which had checksums to  protect against
the silentbitrot.  So,do Ihave tonot use zfson the ssd drives?

Walter Parker <walterp at gmail.com> wrote:

> fstrim requires that the File System support discard/trim before it will do
> anything. Until ZFS on Linux supports TRIM/discard, fstrim will be a no-op.
> It is the file system that tells fstrim/the SSD what block are now empty
> (and can be removed from the SSD's list of blocks in use). Without writing
> an application that parses the ZFS used/free list and then calls proper
> APIs to mark those blocks as free, there is nothing you do to free/trim a
> ZFS pool.
> 
> 
> Walter
> 
> On Wed, Jan 20, 2016 at 6:16 PM, John Covici via zfs-discuss <
> zfs-discuss at list.zfsonlinux.org> wrote:
> 
> > But my original question was how to use the fstrim command in a zfs
> > pool, since I know that trim is not supported yet.  Do I use the pool
> > name, each dataset name, or what?
> >
> > Thanks.
> >
> > fermulator via zfs-discuss <zfs-discuss at list.zfsonlinux.org> wrote:
> >
> > > Official information is here:
> > http://open-zfs.org/wiki/Features#TRIM_Support
> > >
> > > For an elaboration into Gordan's option 2) there are numerous articles
> > > online on how to do it; some examples, see
> > >  -
> > >
> > http://techgage.com/article/enabling_and_testing_ssd_trim_support_under_linux/
> > >  -
> > >
> > http://blog.neutrino.es/2013/howto-properly-activate-trim-for-your-ssd-on-linux-fstrim-lvm-and-dmcrypt/
> > >
> > >
> > >
> > > -------- Original Message --------
> > > From: Gordan Bobic via zfs-discuss <zfs-discuss at list.zfsonlinux.org>
> > > Sent: 1/20/2016, 9:41:18 AM
> > > To: General discussion - ask questions, receive answers and advice
> > > from other ZFS users <zfs-discuss at list.zfsonlinux.org>
> > > Cc:
> > > Subject: Re: [zfs-discuss] zfs and fstrim
> > >
> > > > There are a few options:
> > > >
> > > > 1.1) You don't
> > > > 1.2) Leave untouched partition/space on a freshly secure-erased SSD
> > > > so that the SSD has more known untouched blocks to work with
> > > > (under-provisioning), and you don't worry about TRIM-ing.
> > > >
> > > > 2) Drop the SSD out of the array (make sure your redundancy is up to
> > > > the task), ATA secure erase it, re-add it, resilver. Space that
> > > > isn't used will be freshly trimmed. Repeat for all SSDs in the pool.
> > > >
> > > > In most cases 1.1) is good enough as SSDs are internally adequately
> > > > overprovisioned to handle this reasonably well, especially ones
> > > > based on Sandforce controllers that internally compress and dedupe
> > > > the data.
> > > >
> > > >
> > > > On Wed, Jan 20, 2016 at 2:17 PM, John Covici via zfs-discuss
> > > > <zfs-discuss at list.zfsonlinux.org
> > > > <mailto:zfs-discuss at list.zfsonlinux.org>> wrote:
> > > >
> > > >     Hi.  Since zfs does not support fstrim, how should I trim my
> > pool?  I
> > > >     have a pool with a number of datasets as  legacy mountpoints on 2
> > ssd
> > > >     drives -- so do I do each one separately, or how to do this
> > properly?
> > > >
> > > >     Thanks in advance for any suggestions.
> > > >
> > > >     --
> > > >     Your life is like a penny.  You're going to lose it. The question
> > is:
> > > >     How do
> > > >     you spend it?
> > > >
> > > >              John Covici
> > > >     covici at ccs.covici.com <mailto:covici at ccs.covici.com>
> > > >     _______________________________________________
> > > >     zfs-discuss mailing list
> > > >     zfs-discuss at list.zfsonlinux.org
> > > >     <mailto:zfs-discuss at list.zfsonlinux.org>
> > > >     http://list.zfsonlinux.org/cgi-bin/mailman/listinfo/zfs-discuss
> > > >
> > > >
> > > >
> > > >
> > > > _______________________________________________
> > > > zfs-discuss mailing list
> > > > zfs-discuss at list.zfsonlinux.org
> > > > http://list.zfsonlinux.org/cgi-bin/mailman/listinfo/zfs-discuss
> > >
> > >
> > > ----------------------------------------------------
> > > Alternatives:
> > >
> > > ----------------------------------------------------
> > > _______________________________________________
> > > zfs-discuss mailing list
> > > zfs-discuss at list.zfsonlinux.org
> > > http://list.zfsonlinux.org/cgi-bin/mailman/listinfo/zfs-discuss
> >
> > --
> > Your life is like a penny.  You're going to lose it.  The question is:
> > How do
> > you spend it?
> >
> >          John Covici
> >          covici at ccs.covici.com
> > _______________________________________________
> > zfs-discuss mailing list
> > zfs-discuss at list.zfsonlinux.org
> > http://list.zfsonlinux.org/cgi-bin/mailman/listinfo/zfs-discuss
> >
> 
> 
> 
> -- 
> The greatest dangers to liberty lurk in insidious encroachment by men of
> zeal, well-meaning but without understanding.   -- Justice Louis D. Brandeis
> 
> ----------------------------------------------------
> Alternatives:
> 
> ----------------------------------------------------

-- 
Your life is like a penny.  You're going to lose it.  The question is:
How do
you spend it?

         John Covici
         covici at ccs.covici.com


More information about the zfs-discuss mailing list