It is a continuation of the question

We (me and Irfan Latif) are trying to give access for root apps and use the following code to mount an internal sd card

mount -o rw,remount /
mkdir /my_sdcard
mount -t vfat /dev/block/vold/179:8 /my_sdcard

The mount command shows me

/dev/block/vold/179:8 /my_sdcard vfat rw,dirsync,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

even if I use mount -o uid=0,gid=0 ... or mount -o fmask=0000,dmask=0000 ...

This means that any app has no access to /my_sdcard but su -c 'ls /my_sdcard' shows the list of files

How can I change the permissions of the partition?

  • Try with some other mount binary e.g. busybox. May be /system/bin/mount is not forwarding mount options with syscall to kernel. If that too doesn't work, then most probably uid/gid would be hard-coded in kernel for vfat driver. – Irfan Latif Aug 27 '19 at 13:37
  • @IrfanLatif I have installed it to /system/xbin/mount, neither -o uid=0,gid=0 nor -o fmask=0000,dmask=0000 helps, mount shows the same output – miduja Aug 28 '19 at 9:46
  • @IrfanLatif what can we try next? – miduja Aug 28 '19 at 13:49
  • Looks like your OEM has modified vfat driver to always set uid/gid to 1023. Try with -t msdos or -t sdfat if drivers supported by kernel. Check from /proc/filesystems. Or add 1023 to your supplementary group e.g. using setpriv. Or try bindfs. Something might work if you are lucky. – Irfan Latif Aug 28 '19 at 15:43
  • @IrfanLatif for some reason -t msdos shows "Device or resource busy", however it is not mounted. How can I use setprivfrom busybox? – miduja Aug 29 '19 at 8:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.