command line - Android: Cannot read from external storage and cannot create folder in /storage/sdcard0 -
i have mounted external ext4 hardrive device tree /dev/block/sda1 /storage/emulated/legacy. mainactivity trying access file under /legacy/data/abc.txt. cannot it. owner of /legacy/data root.
also, mainactivity tries create folder under /storage/sdcard0/results called folderx using foldername.mkdir(), cannot. /storage/sdcard0/results owned root.
i have changed permission on both these folders using chmod 777. suspect problem root owner , mainactivity runs different user. dont know owner should changed to.
any ideas?
formatting external ntfs hard drive use on cht rvp
mkfs -t ext4 /location/of/hdd
edit platform.xml in /system/etc/permisssions: reference http://technofaq.org/posts/2014/04/fixing-external-sd-card-write-issue-on-android-kitkat/ add additional group definition external storage permissions : <group gid="media_rw" />
save changes file restart device
mount formatted hard drive on cht rvp: mount -t ext4 /dev/block/sda1 /storage/sdcard1
/* /dev/block device tree, /storage/sdcard1 location mounting hard drive
change owner of /storage/sdcard1 media_rw:
chown -r media_rw:media_rw /storage/sdcard1
change permissions:
chmod -r 777 /storage/sdcard1
and done. should able read/write external hard drive.
Comments
Post a Comment