When trying to use my CAT S42G TWRP build to back up my phone, I realized that I forgot to add lines in the file system tab for the sdcard, so I could back the phone up to it. Fortunately, that is pretty easy to do, like so:
# Add external sdcard
/sdcard auto /dev/block/mmcblk1p1 flags=display=sdcard
/usb_otg auto /dev/block/sda1 flags=display="USB OTG";storage;wipeingui;removable
If you want to see it in place, you can look at the commit here:
https://gitlab.com/alaskalinuxuser/device_cat_s42g/-/commit/d70f81bcc4b23484d82cc9ab66163cb258653210
And you can download the latest build here:
https://www.mediafire.com/file/h5k6juq7tu9gush/recovery_catS42_sd_TWRP.img/file
I haven’t tried the OTG USB drive yet, as I didn’t have an OTG cable for this phone. Perhaps I can get one later and give that a test. In case you are wondering, how did I know what to add to the fstab to make that work? Well, I cheated.
When the phone was on, in the ROM (custom or stock, it doesn’t matter), using the same kernel that I used for my TWRP build (very important), I put in an sdcard. If you do the same, you can read dmesg, or watch the /dev/block/ folder to see what “shows up”. That will be what your kernel automatically assigns to the sdcard every time you have it in.
Then, for the fstab format, the location to mount it should be standard, which for Android is /sdcard. The filesystem should be fat or vfat, but easier is just to choose auto, in case someone decides to use ext 2,3,4, etc. Then, as typical in an fstab file, you have the device location that we saw by watching /dev/block. Finally, you add any flags, which is pretty basic, as all Android phones typically use the flags I enabled. Only if you have a special need would you use some other flag.
Linux – keep it simple.