Re: [gentoo-user] SSD discard / fstrim

2014-09-05 Thread Peter Humphrey
On Thursday 04 September 2014 11:57:19 Joseph wrote:
 This is my first SSD drive 480GB (the only one in the box).  I read about
 all discard / trim option and just want to double check that I'm doing it
 correct.
 
 I setup standard Gentoo and per instruction in Handbook.
 Not I'm reading about discard
 http://wiki.gentoo.org/wiki/SSD
 
 Do I setup: fstrim -v /
 or discard in fstab:
 /dev/sda2   /boot   ext2noauto,noatime  1 2
 /dev/sda4   /   ext4   
 defaults,relatime,discard   0 1 /dev/sda3   none   
 swapsw,pri=3,discard0 0
 
 Can I use them both?
 Do I need to add discard to /boot?

Another possibility is to use f2fs (flash-friendly file system) rather than 
the usual Linux file-systems. Then trimming doesn't arise.

http://git.kernel.org/?p=linux/kernel/git/jaegeuk/f2fs-tools.git;a=summary

I have it on a little LAN server here and it seems to work just fine. Fit and 
forget.

-- 
Regards
Peter




Re: [gentoo-user] SSD discard / fstrim

2014-09-04 Thread Rich Freeman
On Thu, Sep 4, 2014 at 2:26 PM, Сергей protsero...@gmail.com wrote:
 You need to run Fstrim if you mounted your partition WITHOUT discard
 option and did lots of changes. For example, if you installed your
 system without discard, do fstrim and then add discard to
 /etc/fstab.


Just a note that depending on the SSD model, discard can have a
substantial performance penalty with negligible benefit compared to
just sticking fstrim in your crontab.

In theory the ssd should just handle discard by making a note of what
is trimmed and utlizing this information when needed.  In practice
many ssds handle a trim by dropping whatever they're doing and don't a
copy/delete cycle if only part of a block is trimmed, which defeats
the whole point of trimming in the first place.  FStrim has the
advantage of being more asynchronous and possibly being able to
consolidate trims over a longer time-period, which could improve
performance if the ssd isn't smart about it.

Is there a really good place to go for SSD reviews/etc that actually
takes this sort of thing into account?  After getting an SSD it became
apparently that they vary widely in terms of quality.  Heck, I can't
even tell you what the erase cycle count is from the SMART info, while
other models seems to provide all kinds of useful info.

--
Rich



Re: [gentoo-user] SSD discard / fstrim

2014-09-04 Thread thegeezer
On 04/09/14 20:07, Rich Freeman wrote:
 On Thu, Sep 4, 2014 at 2:26 PM, Сергей protsero...@gmail.com wrote:
 You need to run Fstrim if you mounted your partition WITHOUT discard
 option and did lots of changes. For example, if you installed your
 system without discard, do fstrim and then add discard to
 /etc/fstab.

 Just a note that depending on the SSD model, discard can have a
 substantial performance penalty with negligible benefit compared to
 just sticking fstrim in your crontab.
+1
also for lvm remember to add in lvm.conf
issue_discards = 1


 In theory the ssd should just handle discard by making a note of what
 is trimmed and utlizing this information when needed.  In practice
 many ssds handle a trim by dropping whatever they're doing and don't a
 copy/delete cycle if only part of a block is trimmed, which defeats
 the whole point of trimming in the first place.  FStrim has the
 advantage of being more asynchronous and possibly being able to
 consolidate trims over a longer time-period, which could improve
 performance if the ssd isn't smart about it.
i understand that part of the reason it blocks so hard when run and
hasn't been run is the ssd defrags/consolidates the used blocks too. it
would be nice to know for sure what it's doing, or from kernel-space
tell the ssd what is most likely to be changing and what can be
consolidated happily.

 Is there a really good place to go for SSD reviews/etc that actually
 takes this sort of thing into account?  After getting an SSD it became
 apparently that they vary widely in terms of quality.  Heck, I can't
 even tell you what the erase cycle count is from the SMART info, while
 other models seems to provide all kinds of useful info.
+1 for this as other factors such as the erase blocksize should be taken
into account. i.e. the larger the erase blocksize the more need there is
for fstrim in the first place, but also the filesystem/partition
alignment becomes a magical dark art.

 --
 Rich