OH’s start script fixes the permissions of all of its main files (i.e. files in conf and userdata) so that the openhab user can read and write to them. This was implemented to mitigate the hundreds of file permission problems people used to inundate the forum with because they created a conf file using their regular user and didn’t give the openhab user permission to read it. This has been the case since version 1.7 or 1.8.
You can modify the start script to skip the chown step. You would need to create a copy of start.sh and then mount that into the container over the existing start.sh. If you do so you need to be very diligent to keep the files in your conf and userdata folders so that the openhab user inside the container (i.e. user id 9001, group id 9001 by default unless you pass a different UID/GID to the container using environment variables).
It should still happen almost instantly. The only thing I can think of that would make it take longer than a few seconds even on a RPi 2 with the slowest media I can think of is if the media itself is failing.
A chown shuld take no longer than that. But the fact it takes 20 secs in just that directory is also anomolous. I’d expect 20 secs for the entire /, not just the OH folder.
This is a reasonable amount of time.
For comparison, on my RPi 1 B it takes less than 20 seconds to run a find on the entire file system (72484 files). And I think I’m running with a cheap class 4 SD card (i.e. not fast). On my a RPi 0W it takes 22 seconds but has more than 10k more files.