We have moved to a new Sailfish OS Forum. Please start new discussions there.

# Jolla-1: Externalising the android_storage to SD-card [answered]

Hi, I would like to externalise the android_storage to SD-card like I did on a XA2 with SFOS 3.0.3.10 as described at the end of https://together.jolla.com/question/203539/guide-externalising-android_storage-and-other-directories-files-to-sd-card/ There I made an entry in /var/lib/lxc/aliendalvik/config lxc.mount.entry = /media/sdcard/<id>/Android data/media/0 none bind,create=dir 0 0</id>

Now I would like the same on a Jolla-1 also with SFOS 3.0.3.10 on which I installed android support. But there is no lxc directory /var/lib/lxc...

Does anybody know where in this case is the config file? Best regards, Uwe.

edit retag reopen delete

### The question has been closed for the following reason "the question is answered, an answer was accepted"by olf close date 2019-07-07 14:00:18.957030

Sort by » oldest newest most voted

@UweLabs, this is exactly what section 2 of the "Guide: Externalising android_storage and other directories / files to SD-card" is about: Externalising android_storage on SailfishOS devices older than the Xperia XA2.
Just use that for your Jolla 1.

The relevant information for the XA2 was contributed by others, later.

more

Thank you very much. I was experimenting with the XA2 lately, so I was somewhat fixed on changing some config files... Now I installed mount-sdcard-1.0-1.noarch.rpm, but I'm not really shure what it does. Do I have to change something in /etc/udev/rules.d/91-mountsd.rules? Or something else? After installing just mount-sdcard-1.0-1.noarch.rpm and restarting Jolla-1 (and doing nothing else) it seem not to work. I tested with (android app) OpenCamera. But the pictures are not going to the sd card (/run/media/nemo/9016-4EF8...) but just to /home/nemo/android_storage/DCIM/OpenCamera. What am I doing wrong?... Best regards, Uwe.

( 2019-07-07 19:17:32 +0300 )edit

Further investigation shows: in /etc/systemd/system there now is mount-sd@.service, But

systemctl status mount-sd@.service


says

Failed to get properties: Unit name mount-sd@.service is not valid.


A dependency job for mount-sd.service failed. See 'journalctl -xe' for details.


Which in turn showns many lines with

QSEECOM: qseecom_ioctl: failed qseecom_receive_req: -512


Best regards, Uwe.

( 2019-07-07 19:41:38 +0300 )edit

Now I installed mount-sdcard-1.0-1.noarch.rpm, but I'm not really shure what it does.

That's described at mount-sdcard's OpenRepos page; specifically bullet point #3 is relevant for you.

Do I have to change something in /etc/udev/rules.d/91-mountsd.rules? Or something else?

No.

After installing just mount-sdcard-1.0-1.noarch.rpm and restarting Jolla-1 (and doing nothing else) it seem not to work.

What does "not work"?
mount-sdcard behaves almost exactly the same as the original SD-card mounting unit by Jolla, except for the aforementioned improvements.

Further investigation shows: in /etc/systemd/system there now is mount-sd@.service,

That is correct.
Being placed there, it is executed instead of the original /lib/systemd/system/mount-sd@.service by systemd.

But systemctl status mount-sd@.servicesays Failed to get properties: Unit name mount-sd@.service is not valid. What am I doing wrong?

The @ denotes an instanciated systemd unit, see systemd manpages.
Specifically mount-sd@.serviceis instanciated with the block device ("partition") it should mount, hence e.g. systemctl status 'mount-sd@mmcblk1p1.service' is the correct command.

If your (partitions on) SD-card really are not mounted (see ls -l /run/media/nemo/), uninstall mount-sdcard to revert to the state before for a first failure analysis. Then reboot and take a look at ls -l /run/media/nemo/ and e.g. systemctl status 'mount-sd@mmcblk1p1.service' again.
If this is looking better than with mount-sdcard, please file an issue report at GitHub and let us continue analysing your issue there.

P.S.: Can I take it for granted that you read and executed section 2 of the "Guide: Externalising android_storage and other directories / files to SD-card" completely and thoroughly (specifically section 2.2)?

( 2019-07-08 00:27:26 +0300 )edit

First of all, thank you very much for your help. I started from scratch: I uninstalled mount-sd (rpm -e ...). Then in the guide I went through 2.1 in which I first created the directory .android-sdcard on /run/media/nemo/9016-4EF8. As next step I did 2.2, changed the script platform_envsetup.sh to

MEDIA_STORAGE=/run/media/nemo/9016-4EF8/.android-sdcard

I did not what is described in 2.2.1 since my Jolla-1 is BTRFS (as df -Th says) and assuming android is 4.1.2 (btw: how can I determing the version?).

In 2.3 (Finishing up) I rebooted the system and tested with mount | fgrep mmcblk1:

 /dev/mmcblk1p1 on /run/media/nemo/9016-4EF8 type vfat (rw,nosuid,nodev,relatime,uid=100000,gid=100000,fmask=002                                                            2,dmask=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,showexec,utf8,flush,errors=remount-ro,uhelper=udisks2)


in which I see an error ..?..

and mount -t fuse:

/dev/fuse on /opt/alien/home/nemo/android_storage type fuse (rw,nosuid,nodev,relatime,user_id=1023,group_id=1023,default_permissions,allow_other)
/dev/fuse on /home/nemo/android_storage type fuse (rw,nosuid,nodev,relatime,user_id=1023,group_id=1023,default_permissions,allow_other)


systemctl status mount-sd@mmcblk1p1.service looks good.

Directory /home/nemo/android_storage is empty (becouse it's redirected to the sdcard?).

BUT: When I take a picture with OpenCamera it is saved to /home/nemo/android_storage/DCIM/OpenCamera (DCOM/OpenCamere ist new created). The picture is not found at /run/media/nemo/9016-4EF8/.android-sdcard/android_storage/DCIM/OpenCamera. In settings of OpenCamera I'm not able to set this path. It just changed auotatically back to /run/media/nemo/9016-4EF8/.android-sdcard/android_storage/DCIM/OpenCamera.

Do I have to install mount-sdcard-1.0-1.noarch.rpm again?

Best regards, Uwe.

( 2019-07-08 18:43:37 +0300 )edit

I uninstalled mount-sd (rpm -e ...).

Did you also delete the /etc/systemd/system/mount-sd.service you created by renaming?

Then in the guide I went through 2.1 in which I first created the directory .android-sdcard on /run/media/nemo/9016-4EF8.

This is not what section 2.1 says!
Mind to use cd /data and cp -av media /run/media/nemo/XXXXXXXX/.android-sdcard # for BTRFS-using devices on a Jolla 1, but all other lines and their order are equally important.

[And] did 2.2 [...]

This is looking fine.

I did not what is described in 2.2.1 since my Jolla-1 is BTRFS (as df -Th says) and assuming android is 4.1.2

Good.

(btw: how can I determing the version?).

E.g. per CPU Info from F-Droid.

In 2.3 (Finishing up) I rebooted the system and tested with mount | fgrep mmcblk1:

Which is looking fine.

in which I see an error ..?..

No, you don't!

and mount -t fuse:

Looking fine, too.

Directory /home/nemo/android_storage is empty (becouse it's redirected to the sdcard?).

No.
That would only be the case, if you left out (parts of) section 2.1 and/or section 2(.0) (or its fuse-mount failed, whis not the case here).

BUT: When I take a picture with OpenCamera it is saved to /home/nemo/android_storage/DCIM/OpenCamera (DCOM/OpenCamere ist new created).

This is also how it should be.

Which is a wrong path.
The correct one would be in this case, /run/media/nemo/9016-4EF8/.android-sdcard/DCIM/OpenCamera.

In settings of OpenCamera I'm not able to set this path.

There is no reason to do that.

It just changed auotatically back to /run/media/nemo/9016-4EF8/.android-sdcard/android_storage/DCIM/OpenCamera.

Which "it"?

Do I have to install mount-sdcard-1.0-1.noarch.rpm again?

Sigh.

P.S.: Can I take it for granted that you read and executed section 2 of the "Guide: Externalising android_storage and other directories / files to SD-card" completely and thoroughly (specifically section 2.2)?

Obviously neither "completely" or "thoroughly". 😞

But it looks like you done after performing sections 2(.0) and 2.1.

( 2019-07-08 22:55:49 +0300 )edit