public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] SSD discard / fstrim
@ 2014-09-04 17:57 Joseph
  2014-09-04 18:26 ` Сергей
  2014-09-05  8:38 ` Peter Humphrey
  0 siblings, 2 replies; 5+ messages in thread
From: Joseph @ 2014-09-04 17:57 UTC (permalink / raw
  To: gentoo-user

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           ext2            noauto,noatime  1 2
/dev/sda4               /               ext4            defaults,relatime,discard       0 1
/dev/sda3               none            swap            sw,pri=3,discard                0 0

Can I use them both?
Do I need to add "discard" to /boot?


-- 
Joseph


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-user] SSD discard / fstrim
  2014-09-04 17:57 [gentoo-user] SSD discard / fstrim Joseph
@ 2014-09-04 18:26 ` Сергей
  2014-09-04 19:07   ` Rich Freeman
  2014-09-05  8:38 ` Peter Humphrey
  1 sibling, 1 reply; 5+ messages in thread
From: Сергей @ 2014-09-04 18:26 UTC (permalink / raw
  To: gentoo-user

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.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-user] SSD discard / fstrim
  2014-09-04 18:26 ` Сергей
@ 2014-09-04 19:07   ` Rich Freeman
  2014-09-04 19:42     ` thegeezer
  0 siblings, 1 reply; 5+ messages in thread
From: Rich Freeman @ 2014-09-04 19:07 UTC (permalink / raw
  To: gentoo-user

On Thu, Sep 4, 2014 at 2:26 PM, Сергей <protserovsd@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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-user] SSD discard / fstrim
  2014-09-04 19:07   ` Rich Freeman
@ 2014-09-04 19:42     ` thegeezer
  0 siblings, 0 replies; 5+ messages in thread
From: thegeezer @ 2014-09-04 19:42 UTC (permalink / raw
  To: gentoo-user

On 04/09/14 20:07, Rich Freeman wrote:
> On Thu, Sep 4, 2014 at 2:26 PM, Сергей <protserovsd@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
>



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-user] SSD discard / fstrim
  2014-09-04 17:57 [gentoo-user] SSD discard / fstrim Joseph
  2014-09-04 18:26 ` Сергей
@ 2014-09-05  8:38 ` Peter Humphrey
  1 sibling, 0 replies; 5+ messages in thread
From: Peter Humphrey @ 2014-09-05  8:38 UTC (permalink / raw
  To: gentoo-user

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           ext2            noauto,noatime  1 2
> /dev/sda4               /               ext4           
> defaults,relatime,discard       0 1 /dev/sda3               none           
> swap            sw,pri=3,discard                0 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



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-09-05  8:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-04 17:57 [gentoo-user] SSD discard / fstrim Joseph
2014-09-04 18:26 ` Сергей
2014-09-04 19:07   ` Rich Freeman
2014-09-04 19:42     ` thegeezer
2014-09-05  8:38 ` Peter Humphrey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox