Added first storage option as a RAM disk for Raspberry PI/Odroid users #7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In addition to these changes to blue_hydra.rb, please consider augmenting your main README.md file with this information:
These instructions for configuring a RAM disk are for Debian based distros, but will work with other Linux variants
create RAM disk storage for use with the SQLite database that Blue Hydra uses
sudo mkdir /mnt/blue_hydra
sudo mount -t tmpfs -o rw,size=256M tmpfs /mnt/blue_hydra
for permanently fixed RAM disk in the OS
sudo cp -p -v /etc/fstab /etc/fstab.backup
vi /etc/fstab
add the following line to /etc/fstab
tmpfs /mnt/blue_hydra tmpfs rw,size=256M 0 0
reboot
if persistent storage of the data in blue_hydra.db is desired, then a service can be configured with systemd
sudo vi /lib/systemd/system/blue_hydra_ramdisk-sync.service
add the following to /lib/systemd/system/blue_hydra_ramdisk-sync.service
this assumes that you are running as root
[Unit]
Before=umount.target
[Service]
Type=oneshot
User=root
ExecStartPre=/bin/chown -Rf root /mnt/blue_hydra/
ExecStart=/usr/bin/rsync -ar /etc/blue_hydra/ /mnt/blue_hydra/
ExecStop=/usr/bin/rsync -ar /mnt/blue_hydra/ /etc/blue_hydra/
ExecStopPost=/bin/chown -Rf root /etc/blue_hydra
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
exit vi
sudo systemctl enable blue_hydra_ramdisk-sync.service
reboot
all of the above can be done, so as to mitigate constant writing to an SD card or eMMC module. This type of storage isn't known for its long term reliability.