View Single Post
Posts: 204 | Thanked: 443 times | Joined on Jul 2012 @ Germany - Potsdam
#2462
Originally Posted by rannari View Post
I formatted my sdxc 64Gb card to Btrfs -filesystem in Jolla. Everything went okay and after manual mounting happily moved all my music and pic files back to card from /home/nemo/...

I also changed the /usr/sbin/mount-sd.sh script according instructions in Jollausers.forum (it might be also here in TMO) and now the mounting of btrfs-card does not fail when rebooting.

Jolla SD card

I still have to make a soft link from sdcard to Music and Picture folders to be able to use them with Media or Gallery. Maybe some update will fix this one.
I also did the btrfs format to the sdcard. And I did the changes to the /usr/sbin/mount-sd.sh too. But I did one step more. The android vm uses /data/sdcard for some data files (ex. osmand uses it for maps). It is not possible to use symbolic links to the real sdcard, because android could not handle this. A rebind ist useable, but it needs an unmount at shutdown or reboot and this can be done in /usr/sbin/mount-sd.sh.

What I did:

unmount the sdcard
format the sdcard with btrfs
create a directory .android on the sdcard (hidden directory prevents gallary from displaying all that android stuff)
copy all directories from /data/sdcard to /run/user/100000/media/sdcard/.android
did the chown 100xx:100xx to the copied directories like in /data/sdcard
delete all from /data/sdcard, I don't need it, because I will bind the .android directory to this path

after that I modified the /usr/sbin/mount-sd.sh
Code:
#!/bin/bash

SDCARD=/dev/sdcard
DEF_UID=$(grep "^UID_MIN" /etc/login.defs |  tr -s " " | cut -d " " -f2)
DEF_GID=$(grep "^GID_MIN" /etc/login.defs |  tr -s " " | cut -d " " -f2)
DEVICEUSER=$(getent passwd $DEF_UID | sed 's/:.*//')
MNT=/run/user/$DEF_UID/media/sdcard

if [ "$ACTION" = "add" ]; then
	if [ -b /dev/mmcblk1p1 ]; then
		ln -sf /dev/mmcblk1p1 $SDCARD
	elif [ -b /dev/mmcblk1 ]; then
		ln -sf /dev/mmcblk1 $SDCARD
	else 
		exit $?
	fi	
	su $DEVICEUSER -c "mkdir -p $MNT"
	# mount $SDCARD $MNT -o uid=$DEF_UID,gid=$DEF_GID
	case "${ID_FS_TYPE}" in
		vfat|ntfs|exfat)
			mount $SDCARD $MNT -o uid=$DEF_UID,gid=$DEF_GID
                        mount -o bind /run/user/100000/media/sdcard/.android /data/sdcard
			;;
		*)
			mount $SDCARD $MNT
			chown $DEVICEUSER: $MNT
                        mount -o bind /run/user/100000/media/sdcard/.android /data/sdcard
			;;
	esac
else
        umount /data/sdcard
	umount $SDCARD

	if [ $? = 0 ]; then
		rm -f $SDCARD
	else
		umount -l $MNT
		rm -f $SDCARD
	fi
fi
I added the two "mount -o bind" and the "unmount /data/sdcard" line to the for btrfs modified script.

At last I did a
ACTION="add"; . /usr/sbin/mount-sd.sh

Everything is working since two days. I did some reboots and had no problems. All android stuff for the sdcard now sits on the real sdcard and osmand puts all maps to the real sdcard. I got 4GB back from jolla internal memory (before 6GB used, now 2GB used).

Try at your own risk and don't forget what you have done at the next system update ;-)
 

The Following 2 Users Say Thank You to meemorph For This Useful Post: