I would like to make system raspbian USB Flash drive non writeable. To avoid any corruptions.
Is there way to manually install Openhab on second non system USB flash drive to enable writes there? Is there any docs regarding this topic exist?
The best way to achieve this is to mount tempfs to store stuff that must be written like stuff in /var/logs and such. Then remount /as read only. Finally you need to modify all the cron jobs that must write to the file system persistently like fakehwclock to remount / as re, do its thing, then remount as ro.
With oh there is a bunch of other stuff it needs to write to that needs to be persisted too so you can’t put everything in a tmpfs and/or you need a way to periodically copy the stuff out of the tmpfs to the thing drive. So at best you are reducing the writes, not eliminating them.
Frankly, it can be made to work but it will work much better with less work if you use a hdd instead of a thumb drive.
And in any case you should have a good backup and restore procedure because even with a ro file system or an external HDD that doesn’t wear out with writes, failures can and will happen.
I highly recommend you focus your effort on this and not worry about the thumb drive wearing out. It will be less work, more reliable, and consists of work you need to do anyway.
Today I’ve made bootable device on ordinary HDD 3,5", just to be sure it will work.
All goes well! I will proceed in this direction.