Add media_check to detect incorrectly initialised Raspberry Pi SD card and avoid file/partition corruption