Sample Header Ad - 728x90

How can I mount an ext4-formatted SD card with correct permissions (with root)?

9 votes
4 answers
29796 views
I see some mentions here of creating an ext4-formatted SD card, but no guide. This closely-related question suggests there is no way to do it, but my question differs in that my phone is specifically rooted. I formatted my card as ext4 (GUID partition-table); my Cyanogenmod phone mounted it at /mnt/fuse/sdcard1. I followed instructions here to mount the card at /storage/sdcard1, by creating the following script at /data/local/userinit.sh #!/system/bin/sh REALMNT=/mnt/fuse/sdcard1_real if ! [ -d "$REALMNT" ]; then mkdir "$REALMNT" || exit 1 fi mount -t ext4 /dev/block/mmcblk1p1 "$REALMNT" sdcard "$REALMNT" /storage/sdcard1 1023 1023 & I restarted and attempting to copy a file (using ES File Explorer) and paste it into its parent directory, which failed: /storage/sdcard1/foo/bar.mp3: open failed: EACCES (Permission denied). I can actually play the file fine, so I *can* open it. FWIW, when I try copying from the original mount point (/mnt/fuse/sdcard1), I get a slightly different error: Failed to copy the file bar.mp3 I'm using a Samsung Galaxy S3 with Cyanogenmod 10.2.0-i9300. ==EDIT== su ls -l /mnt/fuse drwxrwxr-x media_rw media_rw 2014-03-04 22:08 sdcard1 That was all. There is no sdcard1_real in this directory, so I suppose the script is failing? ==EDIT2== I tried modifying the script to troubleshoot. The script begins fine, but then fails on mkdir "$REALMNT" with the error /data/local/userinit.sh: : not found. ==EDIT3== I know that the script doesn't work, so fixing it might solve my question, but I thought the following was interesting. I formatted my SD card in my Linux computer, and transferred some files to it. Oddly enough, permission errors only occur in the subdirectories that I created. In the root of the partition (via /storage/sdcard1), I already have write permission.
Asked by Sparhawk (335 rep)
Mar 4, 2014, 11:29 AM
Last activity: May 9, 2020, 02:05 PM