[Xperia Tablet Z Q&A, Help & Troubleshooting] ernieg92:
I'm having problems with my external storage (sdcard1). It was working fine unrooted, but now that I'm rooted I'm unable to use it. Depending upon which path I follow (using ES Explorer in root mode), I get the message "file.txt cannot be deleted" or "read-only file system". I have no problems writing to the card in Linux or Windows.

For troubleshooting, I try to create a Folder and then a File. I previously added a test folder and test file via Windows Explorer.

Path selected via ES Explorer: /storage/sdcard1/

Try to add folder, received error message: The folder(file) will not be created. Sorry operation failed.

Try to delete test file(folder), receive error message: test1.txt cannot be deleted.

Path selected via ES Explorer: /storage/removable/sdcard1 ('sdcard1' in /storage/removable/ symlinks to /storage/sdcard1/)

Try to add folder received error message: The folder(file) will not be created. Sorry operation failed.

Try to delete test file(folder, receive error message: read-only filesystem

Also, in adb shell, trying to create or delete a file results in 'rm: Test1: Read-only file system' error message. However, mount shows it is a rw filesystem.

As a novice, it looks like the wrong group is assigned to the sdcard1, compared to the permissions of platform.xml. For example, a complete directory listing of /storage/sdcard1/ shows the group owner to be sdcard_r. While platform.xml lists that group under anything with "EXTERNAL_STORAGE" in the name, it is missing from "WRITE_MEDIA_STORAGE". I suppose I could add that group and see if it fixes things, but the whole "ro filesystem" message has me wondering.

Some code (I truncated some of it to shorten the post).....

root@SGP311:/ # pwd
/
root@SGP311:/ # ls -la
drwxr-xr-x root root 1972-02-11 01:23 acct
drwxrwx--- system cache 1972-02-11 01:23 cache
lrwxrwxrwx root root 1969-12-31 18:00 charger -> /sbin/healthd
lrwxrwxrwx root root 1972-02-11 01:23 etc -> /system/etc
-rw-r--r-- root root 47853 1969-12-31 18:00 file_contexts
drwxrwx--x system system 1972-02-11 01:23 firmware
-rw-r--r-- root root 475 1969-12-31 18:00 fstab
-rw-r----- root root 1445 1969-12-31 18:00 fstab.qcom
drwxr-xr-x root root 1969-12-31 18:00 lta-label
drwxrwxr-x root system 1972-02-11 01:23 mnt
lrwxrwxrwx root root 1972-02-11 01:23 sdcard -> /storage/emulated/legacy
lrwxrwxrwx root root 1972-02-11 01:23 sdcard1 -> /storage/sdcard1
drwxr-x--x root sdcard_r 1972-02-11 01:23 storage
dr-xr-xr-x root root 1972-02-11 01:23 sys
drwxr-xr-x root root 2015-07-26 17:39 system
lrwxrwxrwx root root 1972-02-11 01:23 usbdisk -> /storage/usbdisk
lrwxrwxrwx root root 1972-02-11 01:23 vendor -> /system/vendor
root@SGP311:/ # cd storage/
root@SGP311:/storage # ls -la
d---r-x--- root sdcard_r 2015-07-31 17:45 emulated
d---r-x--- system removable_rw 1972-02-11 01:23 removable
lrwxrwxrwx root root 1972-02-11 01:23 sdcard0 -> /storage/emulated/legacy
drwxrwx--x root sdcard_r 1969-12-31 18:00 sdcard1
drwx------ system system 1972-02-11 01:23 usbdisk
root@SGP311:/storage # cd sdcard1
root@SGP311:/storage/sdcard1 # ls -la
lstat './.android_secure' failed: Permission denied
drwxrwx--x root sdcard_r 2015-07-29 20:26 Android
drwxrwx--- root sdcard_r 2015-07-29 20:28 DCIM
drwxrwx--- root sdcard_r 2015-07-29 21:20 Documents
lstat './LOST.DIR' failed: I/O error
drwxrwx--- root sdcard_r 2015-07-29 20:29 Media
drwxrwx--- root sdcard_r 2015-07-27 20:47 Misc
drwxrwx--- root sdcard_r 2015-07-29 21:34 Music
drwxrwx--- root sdcard_r 2015-07-29 21:28 OpenVPN
drwxrwx--- root sdcard_r 2015-07-29 21:28 Pictures
drwxrwx--- root sdcard_r 2015-07-31 17:20 Test1
drwxrwx--- root sdcard_r 2015-07-30 00:23 Videos
drwxrwx--- root sdcard_r 2009-01-02 12:00 XZDualRecovery
drwxrwx--- root sdcard_r 2015-07-29 20:28 bluetooth
-rwxrwx--- root sdcard_r 145 2015-07-29 20:34 customized-capability.xml
drwxrwx--- root sdcard_r 2015-07-30 02:00 data
-rwxrwx--- root sdcard_r 14335 2015-07-29 20:34 default-capability.xml
drwxrwx--- root sdcard_r 2015-07-29 21:21 downloads
drwxrwx--- root sdcard_r 2015-07-29 21:27 mysword
-rwxrwx--- root sdcard_r 0 2015-07-31 17:21 test1.txt
root@SGP311:/storage/sdcard1 #

Output from mount....

root@SGP311:/storage/sdcard1 # mount
rootfs / rootfs ro,seclabel,relatime 0 0
tmpfs /dev tmpfs rw,seclabel,nosuid,relatime,mode=755 0 0
devpts /dev/pts devpts rw,seclabel,relatime,mode=600 0 0
none /dev/cpuctl cgroup rw,relatime,cpu 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,seclabel,relatime 0 0
selinuxfs /sys/fs/selinux selinuxfs rw,relatime 0 0
/sys/kernel/debug /sys/kernel/debug debugfs rw,relatime 0 0
none /sys/fs/cgroup tmpfs rw,seclabel,relatime,mode=750,gid=1000 0 0
none /acct cgroup rw,relatime,cpuacct 0 0
tmpfs /mnt/asec tmpfs rw,seclabel,relatime,mode=755,gid=1000 0 0
tmpfs /mnt/obb tmpfs rw,seclabel,relatime,mode=755,gid=1000 0 0
/dev/block/platform/msm_sdcc.1/by-name/system /system ext4 ro,seclabel,relatime,data=ordered 0 0
/dev/block/loop0 /system/odex squashfs ro,seclabel,relatime 0 0
/dev/block/platform/msm_sdcc.1/by-name/userdata /data ext4 rw,seclabel,nosuid,nodev,relatime,discard,noauto_da_alloc,data=ordered 0 0
/dev/block/vold/179:34 /data/sdext2 ext2 rw,seclabel,relatime 0 0
/dev/block/platform/msm_sdcc.1/by-name/apps_log /mnt/idd ext4 rw,seclabel,nosuid,nodev,noexec,noatime,discard,nobarrier,data=ordered 0 0
/dev/block/platform/msm_sdcc.1/by-name/cache /cache ext4 rw,seclabel,nosuid,nodev,noatime,discard,data=ordered 0 0
/dev/block/platform/msm_sdcc.1/by-name/LTALabel /lta-label ext4 ro,context=u:object_r:lta_label:s0,nosuid,nodev,noexec,noatime,data=ordered 0 0
tmpfs /mnt/qcks tmpfs rw,seclabel,relatime,mode=770,uid=1000,gid=1000 0 0
/dev/fuse /mnt/shell/emulated fuse rw,nosuid,nodev,noexec,relatime,user_id=1023,group_id=1023,default_permissions,allow_other,allow_utime_grp 0 0
tmpfs /storage/emulated tmpfs rw,seclabel,nosuid,nodev,relatime,mode=050,gid=1028 0 0
/dev/block/vold/179:33 /mnt/media_rw/sdcard1 vfat ro,dirsync,nosuid,nodev,noexec,relatime,uid=1023,gid=1023,fmask=0007,dmask=0007,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/block/vold/179:33 /mnt/secure/asec vfat ro,dirsync,nosuid,nodev,noexec,relatime,uid=1023,gid=1023,fmask=0007,dmask=0007,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/fuse /storage/sdcard1 fuse rw,nosuid,nodev,noexec,relatime,user_id=1023,group_id=1023,default_permissions,allow_other,allow_utime_grp 0 0
/dev/fuse /storage/emulated/0 fuse rw,nosuid,nodev,noexec,relatime,user_id=1023,group_id=1023,default_permissions,allow_other,allow_utime_grp 0 0
/dev/fuse /storage/emulated/0/Android/obb fuse rw,nosuid,nodev,noexec,relatime,user_id=1023,group_id=1023,default_permissions,allow_other,allow_utime_grp 0 0
/dev/fuse /storage/emulated/legacy fuse rw,nosuid,nodev,noexec,relatime,user_id=1023,group_id=1023,default_permissions,allow_other,allow_utime_grp 0 0
/dev/fuse /storage/emulated/legacy/Android/obb fuse rw,nosuid,nodev,noexec,relatime,user_id=1023,group_id=1023,default_permissions,allow_other,allow_utime_grp 0 0
root@SGP311:/storage/sdcard1 #

Relevant sections of platform.xml....

<permission name="android.permission.READ_EXTERNAL_STORAGE" >
<group gid="sdcard_r" />
</permission>

<permission name="android.permission.WRITE_EXTERNAL_STORAGE" >
<group gid="sdcard_r" />
<group gid="sdcard_rw" />
<group gid="media_rw" />
</permission>

<permission name="android.permission.ACCESS_ALL_EXTERNAL_STORAGE" >
<group gid="sdcard_r" />
<group gid="sdcard_rw" />
<group gid="sdcard_all" />
</permission>

<permission name="android.permission.WRITE_MEDIA_STORAGE" >
<group gid="media_rw" />
</permission>

<permission name="android.permission.ACCESS_MTP" >
<group gid="mtp" />
</permission>

I've included what I think is the relevant code. Just to rule it out, this is a brand new SD card. I replaced my last one because I thought there was a problem with it writing. Can someone help me figure this out? Thanks.