A quick look into this online suggests that no one has posted any solution to this for the latest version of XBMC.
The main issue as Goldilocks pointed out is XBMC wasn't designed with the intention of making it read only. This point is furthered if you take a look at this thread on the OpenELEC Media Center Forum. The general consensus there is its not possible to make Kodi read only.
The reason according to the user klojum was:
To have OpenELEC work on a readonly device will not happen. Kodi needs to store/update its databases with video information.
The system partition set up as readonly for a reason. All settings go via the 2nd, /storage partition. So removing that, via the cmdline or otherwise, is not an option.
Restoring the system after each reboot is insane. Install OE, make it running to your wishes and make a full backup/image. Restore that in case of trouble
There might be a way round this as people have found workarounds for older versions, but in general I don't think there is any need to.
I can understand as someone who has used Kodi for a couple of years the annoyance of an SD card becoming corrupted. But there are other simpler ways to mitigate the problem that don't included low level code tinkering.
The number one reason an SD card will become corrupted is if there is a sudden power outage. There are couple of reasons as to why this can happen. Either someone disconnects the power to the Pi mid-way through a write to the SD card. Or the system freezes and you have to disconnect the power. Although, I think the second reason is less likely to cause corruption. Or it suggests there is another fault at play.
In the early days of the Pi the power delivery circuit on the board certainly left something to be desired. I can remember the days of causing a system crash simply by plugging in a USB dongle to the Pi whilst it was powered on. If you don't believe me see problems running XBMC on 2011 Raspberry Pi. The other issue is the software in the early days was not fully mature. The Pi was a different take on what a desktop computer could be and ironing out software issues takes time. So, much newer versions of Kodi are less likely to suffer from random system freezes.
To solve the sudden power loss problem power your Pi through some kind of uninterruptible power supply (UPS). A regular UPS would work but there are actually specifically Pi designed UPS's. Like this Uninterrupted Power Supply for Raspberry Pi. If a system freeze does happen it should be something you are prepared for. This means setting up the OS with all of the settings and apps and preferences to your taste and then making an image of the SD card. So if something goes wrong you can just re-image the SD card.
The other reason an SD card will fail is due to it wearing out. However, this isn't a problem I have experienced myself. If you use a high quality SD card from a reputable brand I think you are probably half way there to solving that problem. To minimize SD card wear means ensuring the SD card is doing the absolute minimum. It shouldn't be used as storage space for your vast collection of films e.t.c...
An option that will work with OpenELEC is running it off a USB drive. Of course all of the boot files will have to remain on the SD card. There are a number of tutorials on how to do this. There is one that looks quite easy to follow here, but for completeness I will give you an overview:
The first step is setting up the SD card and USB drive. Using a program like MiniTool Partition Wizard format the SD card as FAT32 with a primary active partition of 150MB or larger, in fact the entire SD card could be formatted as FAT32. Just make sure the partition is set to primary active. It might also be useful to label the SD card as something like SYSTEM so you remember what its for in the future. Then format the entire USB drive as one primary active partition with the filesystem type as EXT4, again its worth labeling it as something like STORAGE.
Once you have downloaded and extracted OpenELEC go to the root folder. And select these files:
openelec.ico
README.md
And copy them to the root of the SD card.
Next from the target
folder copy the files:
KERNEL
SYSTEM
And again paste them into the SD card's root directory.
Then from the 3rdparty/bootloader
folder copy the files:
bootcode.bin
config.txt
fixup.dat
LICENCE.broadcom
start.elf
And paste them into the root directory of the SD card.
The final step is to change the filename of the file KERNEL
on the SD card to kernel.img
.
To create the startup files, in the root directory of the SD card create a file called cmdline.txt
and add the following line to it:
boot=/dev/mmcblk0p1 disk=/dev/sda1 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 ssh
Be sure to close the file with saving it. And from there you are good to go. The source of the information suggested running XBMC off a USB drive increased responsiveness. I'm not so sure about this claim, but you are not going to see any performance degradation as a result of using this method.
As for your media collection I suggest storing that on a second drive whether it is USB or a network location.