Requires rooted phone.
/system/etc/install-recovery.sh file created by Link2SD using external SD card with 2 FAT32 primary partitions:
#!/system/bin/sh
#added by link2sd
LOG=/data/link2sd-install-recovery.log
echo "$(date) mounting..." > $LOG
mount -t vfat -o rw,uid=1000,gid=1000,umask=133,dmask=0002 /dev/block/vold/179:34 /data/sdext2 1>>$LOG 2>>$LOG
mount -t vfat -o rw,uid=1000,gid=1000,umask=133,dmask=0002 /dev/block/mmcblk1p2 /data/sdext2 1>>$LOG 2>>$LOG
mount >> $LOG
echo "$(date) mount finished" >> $LOG
modifed file:
#!/system/bin/sh
#added by link2sd
LOG=/data/link2sd-install-recovery.log
echo "$(date) mounting..." > $LOG
mount -t vfat -o rw,uid=1000,gid=1015,umask=133,dmask=0002 /dev/block/mmcblk0p19 /data/sdext2 1>>$LOG 2>>$LOG
mount >> $LOG
echo "$(date) mount finished" >> $LOG
The GID of 1015 is sdcard_rw, read/write group id. Otherwise 1000:system would not allow normal apps to write to /mnt/sdcard, which is also mounting the same partition - for some reason this affects its permissions/ownership also.
Note that with SD card being FAT32, it by itself does not store any permissions and ownership - the mounting point determines those.
If creating this file manually, /data/sdext2 folder must be created too, with
RWE-R E-R E permissions, Owner
ROOT and Group
ROOT.
Taken from
http://www.modaco.com/topic/356349-using-link2sd-to-use-internal-sd-as-extsd/
UPDATE: The permissions are still somehow being applied, specifically to
/mtn/sdcard/Android/data/ program folders, without giving them write access. Didn't bother trying other things - just created a ext4 partition on the external SD card.