2.3 RC Trim and alignment?



  • Got me some new hardware to replace my old pfsense machine:
    5257U
    16GB RAM
    250GB Samsung 850 EVO

    Me beeing very new to pfsense (had help with my old installation + it has "grown" over the years) I have a lot of questions.

    To start with I'm wondering if the installer from the memstick image aligns the partitions and enables trim if you have a SSD?



  • I don't have that hardware, but FWIW, I had to manually enable trim on my Samsung SSD.

    You can check to see if trim is already enabled by doing:

    
    tunefs -p /
    
    

    If trim is on, one of the lines of output will show enabled as below:

    
    tunefs: trim: (-t)                   enabled
    
    

    If it's not enabled, you have to manually enable it once while running in single user mode. I used the following tutorial to set mine.

    https://gist.github.com/mdouchement/853fbd4185743689f58c



  • @Keyser:

    I don't have that hardware, but FWIW, I had to manually enable trim on my Samsung SSD.

    You can check to see if trim is already enabled by doing:

    
    tunefs -p /
    
    

    If trim is on, one of the lines of output will show enabled as below:

    
    tunefs: trim: (-t)                   enabled
    
    

    If it's not enabled, you have to manually enable it once while running in single user mode. I used the following tutorial to set mine.

    https://gist.github.com/mdouchement/853fbd4185743689f58c

    So I followed the instructions from the link but when verifying that TRIM really was enabled I get this:

    On command: "tunefs -p /" I get "tunefs: trim: (-t)                                        enabled"
    But with : "tunefs -p /var" I get "tunefs: trim: (-t)                                        disabled"

    EDIT: Just realized why I got different results, I have enabled "/var" as RAM-disk in the WEB-GUI

    Then there's the question of partition alignment, does the installer do it properly?



  • Do not enable TRIM on Samsung SSDs!

    I am serious! They have a very strange TRIM bug under Linux based machines!
    It will destroy all your data. I had one in a QNAP NAS.

    After a lot of configuration and setting up VMs on that QNAP, TRIM did not start instantly but after some days and destroyed everything  >:(

    And do not make the same mistake as me and think that will not happen to the PRO series. It also happens to them. Have fun explaining that bug to your reseller  :P
    Buy a intel SSD and you can save a lot of headache! They are not that much more expensive anymore and way more reliable.



  • @betatest:

    Do not enable TRIM on Samsung SSDs!

    I am serious! They have a very strange TRIM bug under Linux based machines!
    It will destroy all your data. I had one in a QNAP NAS.

    After a lot of configuration and setting up VMs on that QNAP, TRIM did not start instantly but after some days and destroyed everything  >:(

    And do not make the same mistake as me and think that will not happen to the PRO series. It also happens to them. Have fun explaining that bug to your reseller  :P
    Buy a intel SSD and you can save a lot of headache! They are not that much more expensive anymore and way more reliable.

    Perhaps related to this: https://linux.slashdot.org/story/15/07/30/1814200/samsung-finds-fixes-bug-in-linux-trim-code

    It should be fixed now anyway.



  • I read that too but it is still not fixed. And it is not fixed in the newest firmware (Dez. 2015).
    I don't know if Samsung or Linux ist to blame (I think Samsung, they denied it for a long time and said it's Linux fault).
    Sure if it is a just for fun project I would not care. But if you use it productive just get a new one. SSDs are so cheap nowadays.



  • does this apply to freebsd? pfsense does not run on linux



  • @betatest:

    I read that too but it is still not fixed. And it is not fixed in the newest firmware (Dez. 2015).
    I don't know if Samsung or Linux ist to blame (I think Samsung, they denied it for a long time and said it's Linux fault).
    Sure if it is a just for fun project I would not care. But if you use it productive just get a new one. SSDs are so cheap nowadays.

    Here's a little more on the matter and not just a random forum post: https://blog.algolia.com/when-solid-state-drives-are-not-that-solid/

    My setup is not supposed to be "just for fun" but it is not that super-sensitive either we can do with a little downtime.

    Where do you get that is in the drives itself, and is not fixed yet?



  • Where do you get that is in the drives itself, and is not fixed yet?

    My own experience  ;D I did this setup 2 months ago. I have read, that it is not that important to have TRIM enabled (OSX didn't have TRIM for a long time on 3 party SSDs).
    In my opinion you would be better of by not having TRIM enabled than having it enabled on a Samsung SSD.

    FreeBSD is a free Unix-like operating system descended from Research Unix via the Berkeley Software Distribution (BSD).

    So it is kind of a Linux? Or maybe has the same implementation of TRIM than Linux?

    I don't now where you live but in my country you can get a Intel SSD for 50$ (120GB) or you get a Intel Datacenter SSD (80GB) for 80$. Think about how much you earn an hour and how much time it will cost you to restore a dead SSD…

    You can still use our Samsung SSD for Squid or something else  :D



  • @betatest:

    Where do you get that is in the drives itself, and is not fixed yet?

    My own experience  ;D I did this setup 2 months ago. I have read, that it is not that important to have TRIM enabled (OSX didn't have TRIM for a long time on 3 party SSDs).
    In my opinion you would be better of by not having TRIM enabled than having it enabled on a Samsung SSD.

    FreeBSD is a free Unix-like operating system descended from Research Unix via the Berkeley Software Distribution (BSD).

    So it is kind of a Linux? Or maybe has the same implementation of TRIM than Linux?

    I don't now where you live but in my country you can get a Intel SSD for 50$ (120GB) or you get a Intel Datacenter SSD (80GB) for 80$. Think about how much you earn an hour and how much time it will cost you to restore a dead SSD…

    You can still use our Samsung SSD for Squid or something else  :D

    Maybe I'll spring for an Intel drive eventually (limited options with mSATA), this is what I got today so I'm gonna work with it for now.
    Once everything is setup the way I want it I will make a backup image of the drive anyway (using Redo) so it's going to be a rather easy migration to a new drive anyway.

    There's still the question if the installer aligns the partitions correct?

    Another thing - ZNC is ported to FreeBSD is there an "easy" way to install it on pfSense?



  • @betatest:

    FreeBSD is a free Unix-like operating system descended from Research Unix via the Berkeley Software Distribution (BSD).

    So it is kind of a Linux? Or maybe has the same implementation of TRIM than Linux?

    So many No's in one sentence I wont be able to fit them….

    UNIX is not Linux and Linux is not UNIX. For the most part UNIX does not use the same implementations of any of the linux binary's.



  • FWIW, I have been using Samsung SSDs with TRIM enabled (mSata drives specifically) with Centos and Debian Linux for 3+ years on high-use production equipment with no problems. If I remember correctly, there was a specific firmware version that potentially corrupted Sammy drives when TRIM was enabled under Linux and specific kernels, I was never bitten by this, but know others who were.

    If you are not writing and deleting a bunch of data on the drive over and over enabling TRIM is an arguable benefit, and in my specific use case for pfSense, it is only my OCD that makes me enable it, I use a ram disk and offload all the logging to a remote syslog server which keeps the amount of disk writes/rewrites to a minimum.

    And no… BSD is not Linux.


Log in to reply