OK!
I’ve implemented a mechanism based in udev-managed dynamic bind-mounts. The mechanism can be enabled by setting the right envar in the config file (zynthian_envars.sh):
export ZYNTHIAN_DYNAMIC_MEDIA_BIND=1
and updating the system config with:
update_zynthian_sys.sh
Once enabled, the system will detect when external storage is connected and will look for any of these directories:
- soundfonts
- collections
- zynthian-my-data
bind-mounting them and overlapping the directories in the internal storage.
When the external storage is disconnected, the internal storage directories will be “restored” again.
The script:
move_data_to_external_storage.sh
move all data in these 3 directories to the external storage, leaving the empty directory tree in the internal storage and enabling the dynamic-media-bind mechanism.
Important Notes:
- Before running the script, ensure you have enough free space in the external storage. Currently it’s not checking this at all.
- Unplugging the external storage while using soundfonts stored in it is not a good idea. Most probably you will crash the engines. Perhaps you crash the UI too. This should be tested and improved as needed. If you want to be sure, clean all your chains before unplugging.
When all this is well tested, i would add the options to webconf.
Enjoy!