Run OS and database on SD-card to prevent HDD spin-up?

    • OMV 4.x

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Run OS and database on SD-card to prevent HDD spin-up?

      I'm currently looking into building NAS/Plex Server on basis of a OMV.

      Since I will only be accessing the device a couple of times a week, low power consumption and noise are my main concern. When I don't actively use the NAS oder Plex Media Server, the device should be silent and not spinning up the mechanical HDD.

      Is there a way to have the basic OS and database for OMV and Plex Media Server on a SD-card so that the HDD will only spin up, when I'm actually accessing files? So I can basically browse the database on the HC1 for files and media and the HDD will only come to life once I actually access anything on the drive?

      Is that possible? Are there any long-life SD-cards on the market that do not fail every year?
    • TOMillr wrote:

      Are there any long-life SD-cards on the market that do not fail every year?

      Unlikely. But if your concern is 'flash storage wearing out too fast' then choose a good 120GB or 128GB SSD that provides a 'wear out indicator' via SMART.

      There are some SD cards that provide something similar but I doubt they cost less than a good SSD. Simply choose one from Crucial, Intel, Samsung, SanDisk, Transcend -- those companies that do NAND flash, controllers and assemble stuff to retail products and support reading out 'health' of the device via SMART.

      And be always careful with SMART attributes, see e.g. unix.stackexchange.com/a/127776
    • I've no idea about SD cards lifetime but my OMV, MySQL database and home directories are stored in flash USB.
      Many people say that this type of memory can't handle so many writes and reads and last for years and probably they're right. Espacially in case most common pendrives based on MLC NAND which are not meant for that task.
      But there're also SLC NAND pendrives which should do the job far better. I say "should" because I'm using this solution for a year or so without any problems so far.
      If you are interested here is the pendrive I'm using:
      mx-technology.com/h5/en/flash2.php?sid=23
    • TOMillr wrote:

      I was thinking about one of those new "PRO Endurance" cards made by Samsung

      Well, if you love ugly surprises (same with USB pendrives as suggested by @nbbt) then this is the way to go. These cards (and almost all USB pendrives) are made for sequential workloads while what we're talking here about is random IO.

      Those Pro Endurance cards are made for video recording and video recording is sequential IO with very low Write Amplification while 'OS drive' especially when combined with database is random IO with insanely high Write Amplification. See here why that's important and what happens at every layer, especially at the lowest flash memory layer: forum.armbian.com/topic/6444-v…findComment&comment=50833

      Then again: all flash memory will die eventually. But unlike SD cards and USB pendrives good SSDs can be asked about their remaining lifetime through SMART. You are able to replace your SSD before you run into a problem while with an SD card and USB pendrives there will be a day when your drive either fails noticable or will turn into read-only without you noticing immediately (then 'funny' stuff happens since it seems you'll loose settings after a reboot)

      BTW: it doesn't matter whether you're using MLC or SLC -- usually fraudsters love to sell you cheap MLC flash as counterfeit SLC products since you as customer can't tell the difference anyway.
    • Of course they will all die eventually, I'm just saying that SLC pendrives will last longer as Single level cells are more durable. This is a fact.
      And you're right I can't tell whether is SLC or MLC but I believe it's SLC. This little thing was presented in 2014, have you seen consumer pendrives reaching almost 200 MB/s write speed in 2014? Espacially 16GB pendrives? I'm quite sure there was none like this. That's why I think this is real SLC - they tend to be faster than MLC also.

      I've chosen pendrive as an OS drive not because they can compare SSD but because I wanted miniITX board and these are mostly 2 or 4 sata ports. I wasn't going to spare one of four sata ports for OS.
      And even if it will die, so what? Reinstalling OMV and setting it up takes me about 2 hours - I can live with that ;)
    • nbbt wrote:

      200 MB/s write speed

      It's useless. Users look always at the wrong type of numbers, trust in marketing BS like 'SLC' and nothing will change.

      Random IO is important for this type of application and not sequential transfer speeds. And if the storage will be used with random access write patterns then Write Amplification is an issue and it would be rather stupid to use storage that will fail eventually without notifying the user before.

      Good SSDs are accessible via SMART. They support an attribute that tells you when this thing will finally die so you can replace it before it fails. Why would you prefer storage failing suddenly and even loosing data instead?!

      [IMG:http://kaiser-edv.de/tmp/jbTirW/TS120GMTS420_JMS578.jpg]

      This is a M.2 SATA SSD (Transcend TS120GMTS420) in an el cheapo JMS578 USB3 adapter without enclosure but heatsinks (those fast M.2 SSDs overheat badly otherwise). Costs less than 'SLC pendrives' while being way faster at the same time and way more reliable since being able to be queried with SMART.

      Same with SD cards. Reliable and fast (random I/O!) cards like SanDisk Extreme Pro/Plus A1 cost more, are slower and still there's no SMART to query them for 'wear out indication'.

      If you want to permanently write data to flash storage you might want to ask the flash storage about its health, true?
    • That's how such a SMART query looks like (impossible on almost all SD cards and normal USB pendrives):

      Source Code

      1. root@rock64:~# smartctl -a /dev/sda
      2. smartctl 6.6 2016-05-31 r4324 [aarch64-linux-4.4.143-rk3328] (local build)
      3. Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org
      4. === START OF INFORMATION SECTION ===
      5. Model Family: SiliconMotion based SSDs
      6. Device Model: TS120GMTS420
      7. Serial Number: 01226347D88180FE0091
      8. Firmware Version: P1025F8
      9. User Capacity: 120,034,123,776 bytes [120 GB]
      10. Sector Size: 512 bytes logical/physical
      11. Rotation Rate: Solid State Device
      12. Form Factor: M.2
      13. Device is: In smartctl database [for details use: -P show]
      14. ATA Version is: ACS-3 (minor revision not indicated)
      15. SATA Version is: SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)
      16. Local Time is: Sun Aug 5 11:33:09 2018 UTC
      17. SMART support is: Available - device has SMART capability.
      18. SMART support is: Enabled
      19. === START OF READ SMART DATA SECTION ===
      20. SMART Status not supported: Incomplete response, ATA output registers missing
      21. SMART overall-health self-assessment test result: PASSED
      22. Warning: This result is based on an Attribute check.
      23. General SMART Values:
      24. Offline data collection status: (0x02) Offline data collection activity
      25. was completed without error.
      26. Auto Offline Data Collection: Disabled.
      27. Self-test execution status: ( 0) The previous self-test routine completed
      28. without error or no self-test has ever
      29. been run.
      30. Total time to complete Offline
      31. data collection: ( 0) seconds.
      32. Offline data collection
      33. capabilities: (0x71) SMART execute Offline immediate.
      34. No Auto Offline data collection support.
      35. Suspend Offline collection upon new
      36. command.
      37. No Offline surface scan supported.
      38. Self-test supported.
      39. Conveyance Self-test supported.
      40. Selective Self-test supported.
      41. SMART capabilities: (0x0002) Does not save SMART data before
      42. entering power-saving mode.
      43. Supports SMART auto save timer.
      44. Error logging capability: (0x01) Error logging supported.
      45. General Purpose Logging supported.
      46. Short self-test routine
      47. recommended polling time: ( 2) minutes.
      48. Extended self-test routine
      49. recommended polling time: ( 10) minutes.
      50. Conveyance self-test routine
      51. recommended polling time: ( 2) minutes.
      52. SMART Attributes Data Structure revision number: 1
      53. Vendor Specific SMART Attributes with Thresholds:
      54. ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
      55. 1 Raw_Read_Error_Rate 0x0000 100 100 000 Old_age Offline - 0
      56. 5 Reallocated_Sector_Ct 0x0000 100 100 000 Old_age Offline - 0
      57. 9 Power_On_Hours 0x0000 100 100 000 Old_age Offline - 27
      58. 12 Power_Cycle_Count 0x0000 100 100 000 Old_age Offline - 120
      59. 160 Uncorrectable_Error_Cnt 0x0000 100 100 000 Old_age Offline - 0
      60. 161 Valid_Spare_Block_Cnt 0x0000 100 100 000 Old_age Offline - 69
      61. 163 Initial_Bad_Block_Count 0x0000 100 100 000 Old_age Offline - 5
      62. 164 Total_Erase_Count 0x0000 100 100 000 Old_age Offline - 11968
      63. 165 Max_Erase_Count 0x0000 100 100 000 Old_age Offline - 47
      64. 166 Min_Erase_Count 0x0000 100 100 000 Old_age Offline - 8
      65. 167 Average_Erase_Count 0x0000 100 100 000 Old_age Offline - 23
      66. 148 Total_SLC_Erase_Ct 0x0000 100 100 000 Old_age Offline - 9246
      67. 149 Max_SLC_Erase_Ct 0x0000 100 100 000 Old_age Offline - 288
      68. 150 Min_SLC_Erase_Ct 0x0000 100 100 000 Old_age Offline - 167
      69. 151 Average_SLC_Erase_Ct 0x0000 100 100 000 Old_age Offline - 271
      70. 169 Remaining_Lifetime_Perc 0x0000 100 100 000 Old_age Offline - 100
      71. 177 Wear_Leveling_Count 0x0000 100 100 050 Old_age Offline - 3
      72. 181 Program_Fail_Cnt_Total 0x0000 100 100 000 Old_age Offline - 0
      73. 182 Erase_Fail_Count_Total 0x0000 100 100 000 Old_age Offline - 0
      74. 192 Power-Off_Retract_Count 0x0000 100 100 000 Old_age Offline - 24
      75. 194 Temperature_Celsius 0x0000 100 100 000 Old_age Offline - 43
      76. 196 Reallocated_Event_Count 0x0000 100 100 016 Old_age Offline - 0
      77. 199 UDMA_CRC_Error_Count 0x0000 100 100 050 Old_age Offline - 141
      78. 232 Available_Reservd_Space 0x0000 100 100 000 Old_age Offline - 100
      79. 241 Host_Writes_32MiB 0x0000 100 100 000 Old_age Offline - 29727
      80. 242 Host_Reads_32MiB 0x0000 100 100 000 Old_age Offline - 41235
      81. 245 TLC_Writes_32MiB 0x0000 100 100 000 Old_age Offline - 95744
      Display All


      The most important number is attribute 169 on these Transcend SSDs (different attributes with other good SSD vendors):

      Source Code

      1. 169 Remaining_Lifetime_Perc 0x0000 100 100 000 Old_age Offline - 100
      100% so everything fine. Once this value drops below 20% I start to evaluate a replacement. An SD card or an average USB pendrive will simply fail with you having not the slightest chance to predict when this will happen.

      Next information:

      Source Code

      1. 232 Available_Reservd_Space 0x0000 100 100 000 Old_age Offline - 100

      100% reserve space available so nothing to fear. Once reserve space is running out you're in trouble too.

      Next information:

      Source Code

      1. 241 Host_Writes_32MiB 0x0000 100 100 000 Old_age Offline - 29727
      2. 245 TLC_Writes_32MiB 0x0000 100 100 000 Old_age Offline - 95744
      The effect of Write Amplification can be queried. The host wrote 951MiB which endet up to writes at the flash layer of 3GiB. 1:3.2 Write Amplification based on past usage patterns.
    • tkaiser wrote:

      Why would you prefer storage failing suddenly and even loosing data instead?!
      What data do you mean? My data are sitting in 4 reds HDD. Pendrive failure will not have any impact on my HDDs and my NAS is standing side to my desk so replacing pendrive, reinstalling and making conf changes isn't much of a problem. MySQL database which is placed on the same flash as OMV is being backed up daily to HDD so again, I won't loose anything.

      tkaiser wrote:

      This is a M.2 SATA SSD (Transcend TS120GMTS420) in an el cheapo JMS578 USB3 adapter without enclosure but heatsinks (those fast M.2 SSDs overheat badly otherwise). Costs less than 'SLC pendrives' while being way faster at the same time and way more reliable since being able to be queried with SMART.
      This! I've never thought about using an adapter and indeed this solution is much better if you're able to find good and not too costy adapter. Have to take a look at them ;) Thanks for pointing this out!

      tkaiser wrote:

      That's how such a SMART query looks like
      I'm pretty familiar with SMART, monitoring all my HDD and SSD (those sit in my PC) for any alarming changes. As you said, there is no such an option in case of SD cards/USB drives.
      Only time will show how many more months/years my SLC pendrive will last ;)

      Do you think that using flashmemory plugin makes any sense in my case?
    • nbbt wrote:

      This! I've never thought about using an adapter and indeed this solution is much better if you're able to find good and not too costy adapter.
      The one I ordered (some more info) was below 7 bucks (shipping included). I personally can only recommend adapters based on JMicron JMS578 (since supporting UAS, SAT and TRIM) while VIA VL715/VLI716 and ASMedia ASM1351 should be also ok (same feature set but I've only tested a VL716 enclosure and that sucked but no idea whether the USB-C cable was the problem or the enclosure).

      Something with even 2 JMS578 is this little board here: aliexpress.com/store/product/O…/1553371_32789632568.html

      Great to be used inside servers or PCs where USB2 data lines, 5V and GND are available on some pin headers so you just need to 4 short (and shielded) cables to interconnect your mainboard with this thing to be combined with a mSATA SSD and/or even another real HDD.

      nbbt wrote:

      Do you think that using flashmemory plugin makes any sense in my case?
      Makes always sense since due to reducing Write Amplification a lot (even if nobody seems to care about this).

      But you said you have 'my OMV, MySQL database and home directories' on the pendrive so flashmemory plugin will only take care about a small fraction of your writes anyway...
    • nbbt wrote:

      Do you think that using flashmemory plugin makes any sense in my case?
      Using the flashmemory plugin is ok in all cases. I even use it on my systems with SSDs.
      omv 4.1.12 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.11
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • tkaiser wrote:

      The one I ordered (some more info) was below 7 bucks (shipping included). I personally can only recommend adapters based on JMicron JMS578 (since supporting UAS, SAT and TRIM) while VIA VL715/VLI716 and ASMedia ASM1351 should be also ok (same feature set but I've only tested a VL716 enclosure and that sucked but no idea whether the USB-C cable was the problem or the enclosure).

      Something with even 2 JMS578 is this little board here: aliexpress.com/store/product/O…/1553371_32789632568.html
      Following your advice I've ordered an USB internal cable to connect to mobo usb header
      (aliexpress.com/store/product/2…/2837057_32802912476.html?)
      and sata to usb adapter based on the chip you suggested (this one orico.cc/goods.php?id=6358)

      Choosen regular Sata instead of M.2 because I have a spare SSD laying in a drawer which can be used for that purpose. Will see how it will work. Thanks again for your advice!


      tkaiser wrote:

      Makes always sense since due to reducing Write Amplification a lot (even if nobody seems to care about this).

      But you said you have 'my OMV, MySQL database and home directories' on the pendrive so flashmemory plugin will only take care about a small fraction of your writes anyway...

      ryecoaaron wrote:

      Using the flashmemory plugin is ok in all cases. I even use it on my systems with SSDs.
      Flashmemory plugin installed and running. Thanks!