This is an old revision of the document!
FlashMemory Plugin For OMV7
Summary
The FlashMemory Plugin was designed to make booting from USB thumbdrives and SD-cards feasible and a practical
alternative to booting from a hard drive or SSD. In addition to the relative low cost, using USB thumbdrives
enable easy OS backup
options, quick recovery from boot drive failure and it saves a SATA port for a
data storage drive.
This plugin is REQUIRED, for a flash media boot drive, or it will have a short life. For an in-depth explanation see; Why is the FlashMemory Plugin Required?
Prerequisites
- This procedure applies to amd64 ISO installations only. The FlashMemory Plugin is installed by default, during scripted installs. (R-PI's, Armbian Boards, the 32bit install, and the Alternate 64bit install.)
- OMV-Extras must be installed. (See the following.)
Installation
For OMV7; installing OMV-Extras is accomplished by copying
and pasting the following wget command, on your server's command line, as root:
wget -O - https://github.com/OpenMediaVault-Plugin-Developers/packages/raw/master/install | bash
Highlight the line above and hit ctrl+c. In an SSH client like PuTTY, a right mouse click will paste the line in.
Note: If you're unsure of how to get on the command line, see this reference for → installing and using PuTTY.
When the script is complete, OMV-Extra's will be installed and activated.
With OMV extra's installed, there are two choices to install the FlashMemory Plugin:
1. Installation on the command line:
apt-get install openmediavault-flashmemory
Again, paste the above into a PuTTY session command line, as described above.
2. Installation within the GUI:
The Flashmemory plugin can now be found under, System, Plugins. Find openmediavault-flashmemory 7.X, highlight it and install.
Configuration
Configuration is not necessary. When installed, the Flashmemory plugin is working as designed.
Why is the FlashMemory Plugin Required?
Wear Leveling
Flash memory drives, like USB thumb drives and SD cards, are solid state, but their memory cells can only handle a limited number of writes before they wear out. When too many cells can no longer be written or erased, the drive’s controller may switch it to ‘read-only’ mode, meaning you can’t save new data, and the drive’s useful life is over.
To make flash drives last longer, modern drives use “wear leveling.” This is a clever system used by the drive’s controller that spreads writes across all the memory cells, so no single spot gets worn out too quickly. Instead of reusing the same cells over and over, the controller picks cells that have been used less, even if they’re not next to each other. This keeps the drive working reliably for a long time.
A larger drive, like a 64GB USB compared to a 32GB one, can last longer because it has more cells to share the wear. For example, a drive twice as large might last about twice as long for the same amount of writing. However, larger drives take longer to back up and they create bigger backup files. For a boot drive, a 16GB to 32GB drive is a good balance of lifespan, cost, and backup convenience.
The Purpose of the Plugin
Most writes to OMV's boot drive are entries being appended to log files. While log file entries are very small writes, that may be as little at 80 bytes, they occur on a regular basis. A write operation to a flash device is done in writable “blocks” that are, typically, 2KB or 4KB minimum regardless of how small the write may be. This results in what is called “write amplification” where numerous large segments (2 to 4KB) of the drive are written to record very small amounts of data (+/- 80 bytes). The end result is writing all of the available blocks of the flash device rapidly, to exhaustion, where it will go read-only.
The primary purpose of the Flash Memory Plugin is to reduce the frequency of writes to flash media by consolidating very small writes into one, larger, bulk write that is flushed to the boot drive on shutdown. This dramatically reduces the number of blocks physically written to the Flash Device. The plugin can reduce the number of blocks written to the Flash drive by, potentially, an order of magnitude or 1/10th the amount that would otherwise be written. By extension, a drive of a given size might last up to 10 times longer than it would without the Flash Media plugin.
It's worth noting that SSD's would benefit from the FlashMemory plugin as well.
Source Code
A Closing Note
We, who support the openmediavault project, hope you’ve found this guide to be useful and that you’ll find your openmediavault server to be efficient, easy to use, and enjoyable.
If you found this plugin guide to be helpful, please consider a modest donation to support the hosting costs of this server.
OMV-Extras.org
Venmo: ryecoaaron