Why not save a lot of hassle and buy a cheap ssd and a usb to sata adapter ? That will remove the hassle of failing SD-cards once an for all. How to set this up can be found here for Raspberry 2B v1.2, 3A+, 3B, and 3B+, and here for the Rasperry Pi 4, even on the 4 you need a sdcard AND an ssd...