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

Revision history [back]

click to hide/show revision 1
initial version

posted 2014-04-25 14:46:10 +0300

How to: Format your uSD-Card to btrfs and share space with android

What I did to share the space of my uSD between nemo and android without getting duplicates with bind-mounts or any other hickup, read carefully and use at your own risk:

  1. format the whole usdcard (mmcblk1 not mmcblk1p1) to btrfs
  2. mount that volume (=0)
  3. create two subvolumes > jolla and android
  4. set the default volume to jolla (the default is what gets mounted when something calls mount /dev/mmcblk1)
  5. stop alien-dalvik and copy everything form /data/sdcard to the new subvolume android (don't move the files, this way you have all basics alien-dalvik needs even after pulling the uSD)
  6. add mounting of that subvolume (android) to the sdcard-mounting-script provided by jolla, to be precise, in the section where it mounts non-fat volumes I added the android volume to be mounted to /data/sdcard
  7. reboot and wait for the device to settle, as soon as your jolla volume is mounted in /media/, you should see /dev/mmcblk1 being mounted to both /media/sdcard/#UUID and /data/sdcard

I did not want to write a detailed guide as I do not want to be responsible for any wrong doings all steps are pretty basic for people knowing their way around the cmdline - you can find every step somewhere here @tjc or in the man-pages of the required tools


detailed cmds use at your own risk

  1. umount /dev/mmcblk1p1 - unmount the card
  2. mkfs.btrfs -f /dev/mmcblk1 - format the card (no need for partition)
  3. mount -o subvolid=0 /dev/mmcblk1 /media/sdcard
  4. cd /media/sdcard
  5. btrfs subvolume create jolla - create folder called jolla
  6. btrfs subvolume create android - create folder called android
  7. btrfs subvolume list . - returns an ID for each subvolume
  8. btrfs subvolume set-default *ID for jolla* /media/sdcard/ - sets jolla to be mounted as default
  9. chown nemo:nemo jolla/ - add -R if needed
  10. chmod 775 jolla/
  11. chmod 777 android/
  12. cp -r -a -v /data/sdcard/* /media/sdcard/android
  13. umount /dev/mmcblk1
  14. edit /usr/sbin/mount-sd.sh add mount -o subvol=android,compress,$MOUNT_OPTS $(DEVNAME) /data/sdcard/ after the btrfs mount (btrfs mount is in line 53, add it just below in a newline)

How to: Format your uSD-Card to btrfs and share space with android

What I did to share the space of my uSD between nemo and android without getting duplicates with bind-mounts or any other hickup, read carefully and use at your own risk:

  1. format the whole usdcard (mmcblk1 not mmcblk1p1) to btrfs
  2. mount that volume (=0)
  3. create two subvolumes > jolla and android
  4. set the default volume to jolla (the default is what gets mounted when something calls mount /dev/mmcblk1)
  5. stop alien-dalvik and copy everything form /data/sdcard to the new subvolume android (don't move the files, this way you have all basics alien-dalvik needs even after pulling the uSD)
  6. add mounting of that subvolume (android) to the sdcard-mounting-script provided by jolla, to be precise, in the section where it mounts non-fat volumes I added the android volume to be mounted to /data/sdcard
  7. reboot and wait for the device to settle, as soon as your jolla volume is mounted in /media/, you should see /dev/mmcblk1 being mounted to both /media/sdcard/#UUID and /data/sdcard

I did not want to write a detailed guide as I do not want to be responsible for any wrong doings all steps are pretty basic for people knowing their way around the cmdline - you can find every step somewhere here @tjc or in the man-pages of the required tools


detailed cmds use at your own risk

  1. umount /dev/mmcblk1p1 - unmount the card
  2. mkfs.btrfs -f /dev/mmcblk1 - format the card (no need for partition)
  3. mount -o subvolid=0 /dev/mmcblk1 /media/sdcard
  4. cd /media/sdcard
  5. btrfs subvolume create jolla - create folder called jolla
  6. btrfs subvolume create android - create folder called android
  7. btrfs subvolume list . - returns an ID for each subvolume
  8. btrfs subvolume set-default *ID for jolla* /media/sdcard/ - sets jolla to be mounted as default
  9. chown nemo:nemo jolla/ - add -R if needed
  10. chmod 775 jolla/
  11. chmod 777 android/
  12. cp -r -a -v /data/sdcard/* /media/sdcard/android
  13. umount /dev/mmcblk1
  14. edit /usr/sbin/mount-sd.sh add mount -o subvol=android,compress,$MOUNT_OPTS $(DEVNAME) /data/sdcard/ after the btrfs mount (btrfs mount is in line 53, add it just below in a newline)

How to: Format your uSD-Card to btrfs and share space with android

Version: 1.0.5.19

What I did to share the space of my uSD between nemo and android without getting duplicates with bind-mounts or any other hickup, read carefully and use at your own risk:

  1. format the whole usdcard (mmcblk1 not mmcblk1p1) to btrfs
  2. mount that volume (=0)
  3. create two subvolumes > jolla and android
  4. set the default volume to jolla (the default is what gets mounted when something calls mount /dev/mmcblk1)
  5. stop alien-dalvik and copy everything form /data/sdcard to the new subvolume android (don't move the files, this way you have all basics alien-dalvik needs even after pulling the uSD)
  6. add mounting of that subvolume (android) to the sdcard-mounting-script provided by jolla, to be precise, in the section where it mounts non-fat volumes I added the android volume to be mounted to /data/sdcard
  7. reboot and wait for the device to settle, as soon as your jolla volume is mounted in /media/, you should see /dev/mmcblk1 being mounted to both /media/sdcard/#UUID and /data/sdcard

I did not want to write a detailed guide as I do not want to be responsible for any wrong doings all steps are pretty basic for people knowing their way around the cmdline - you can find every step somewhere here @tjc or in the man-pages of the required tools


detailed cmds use at your own risk

  1. umount /dev/mmcblk1p1 - unmount the card
  2. mkfs.btrfs -f /dev/mmcblk1 - format the card (no need for partition)
  3. mount -o subvolid=0 /dev/mmcblk1 /media/sdcard
  4. cd /media/sdcard
  5. btrfs subvolume create jolla - create folder called jolla
  6. btrfs subvolume create android - create folder called android
  7. btrfs subvolume list . - returns an ID for each subvolume
  8. btrfs subvolume set-default *ID for jolla* /media/sdcard/ - sets jolla to be mounted as default
  9. chown nemo:nemo jolla/ - add -R if needed
  10. chmod 775 jolla/
  11. chmod 777 android/
  12. cp -r -a -v /data/sdcard/* /media/sdcard/android
  13. umount /dev/mmcblk1
  14. edit /usr/sbin/mount-sd.sh add mount -o subvol=android,compress,$MOUNT_OPTS $(DEVNAME) /data/sdcard/ after the btrfs mount (btrfs mount is in line 53, add it just below in a newline)

How to: Format your uSD-Card to btrfs and share space with android

Version: 1.0.5.19

What I did to share the space of my uSD between nemo and android without getting duplicates with bind-mounts or any other hickup, read carefully and use at your own risk:

  1. format the whole usdcard (mmcblk1 not mmcblk1p1) to btrfs
  2. mount that volume (=0)
  3. create two subvolumes > jolla and android
  4. set the default volume to jolla (the default is what gets mounted when something calls mount /dev/mmcblk1)
  5. stop alien-dalvik and copy everything form /data/sdcard to the new subvolume android (don't move the files, this way you have all basics alien-dalvik needs even after pulling the uSD)
  6. add mounting of that subvolume (android) to the sdcard-mounting-script provided by jolla, to be precise, in the section where it mounts non-fat volumes I added the android volume to be mounted to /data/sdcard
  7. reboot and wait for the device to settle, as soon as your jolla volume is mounted in /media/, you should see /dev/mmcblk1 being mounted to both /media/sdcard/#UUID and /data/sdcard

I did not want to write a detailed guide as I do not want to be responsible for any wrong doings all steps are pretty basic for people knowing their way around the cmdline - you can find every step somewhere here @tjc or in the man-pages of the required tools


detailed cmds use at your own risk

  1. umount /dev/mmcblk1p1 - unmount the card
  2. mkfs.btrfs -f /dev/mmcblk1 - format the card (no need for partition)
  3. mount -o subvolid=0 /dev/mmcblk1 /media/sdcard
  4. cd /media/sdcard
  5. btrfs subvolume create jolla - create folder called jolla
  6. btrfs subvolume create android - create folder called android
  7. btrfs subvolume list . - returns an ID for each subvolume
  8. btrfs subvolume set-default *ID for jolla* /media/sdcard/ - sets jolla to be mounted as default
  9. chown nemo:nemo jolla/ - add -R if needed
  10. chmod 775 jolla/
  11. chmod 777 android/
  12. cp -r -a -v /data/sdcard/* /media/sdcard/android
  13. umount /dev/mmcblk1
  14. edit /usr/sbin/mount-sd.sh add mount -o subvol=android,compress,$MOUNT_OPTS $(DEVNAME) /data/sdcard/ after the btrfs mount (btrfs mount is in line 53, add it just below in a newline)

    *) mount ${DEVNAME} $MNT/${UUID} -o $MOUNT_OPTS || /bin/rmdir $MNT/${UUID} mount -o subvol=android,compress,$MOUNT_OPTS $(DEVNAME) /data/sdcard/ ;;

How to: Format your uSD-Card to btrfs and share space with android

Version: 1.0.5.19

What I did to share the space of my uSD between nemo and android without getting duplicates with bind-mounts or any other hickup, read carefully and use at your own risk:

  1. format the whole usdcard (mmcblk1 not mmcblk1p1) to btrfs
  2. mount that volume (=0)
  3. create two subvolumes > jolla and android
  4. set the default volume to jolla (the default is what gets mounted when something calls mount /dev/mmcblk1)
  5. stop alien-dalvik and copy everything form /data/sdcard to the new subvolume android (don't move the files, this way you have all basics alien-dalvik needs even after pulling the uSD)
  6. add mounting of that subvolume (android) to the sdcard-mounting-script provided by jolla, to be precise, in the section where it mounts non-fat volumes I added the android volume to be mounted to /data/sdcard
  7. reboot and wait for the device to settle, as soon as your jolla volume is mounted in /media/, you should see /dev/mmcblk1 being mounted to both /media/sdcard/#UUID and /data/sdcard

I did not want to write a detailed guide as I do not want to be responsible for any wrong doings all steps are pretty basic for people knowing their way around the cmdline - you can find every step somewhere here @tjc or in the man-pages of the required tools


detailed cmds use at your own risk

  1. umount /dev/mmcblk1p1 - unmount the card
  2. mkfs.btrfs -f /dev/mmcblk1 - format the card (no need for partition)
  3. mount -o subvolid=0 /dev/mmcblk1 /media/sdcard
  4. cd /media/sdcard
  5. btrfs subvolume create jolla - create folder called jolla
  6. btrfs subvolume create android - create folder called android
  7. btrfs subvolume list . - returns an ID for each subvolume
  8. btrfs subvolume set-default *ID for jolla* /media/sdcard/ - sets jolla to be mounted as default
  9. chown nemo:nemo jolla/ - add -R if needed
  10. chmod 775 jolla/
  11. chmod 777 android/
  12. cp -r -a -v /data/sdcard/* /media/sdcard/android
  13. umount /dev/mmcblk1
  14. edit /usr/sbin/mount-sd.sh add mount -o subvol=android,compress,$MOUNT_OPTS $(DEVNAME) /data/sdcard/ after the btrfs mount (btrfs mount is in line 53, add it just below in a newline)

lines look like this

*) 
  mount ${DEVNAME} $MNT/${UUID} -o $MOUNT_OPTS || /bin/rmdir $MNT/${UUID}
  mount -o subvol=android,compress,$MOUNT_OPTS $(DEVNAME) /data/sdcard/
  ;;

;;

How to: Format your uSD-Card to btrfs and share space with android

Version: 1.0.5.19

What I did to share the space of my uSD between nemo and android without getting duplicates with bind-mounts or any other hickup, read carefully and use at your own risk:

  1. format the whole usdcard (mmcblk1 not mmcblk1p1) to btrfs
  2. mount that volume (=0)
  3. create two subvolumes > jolla and android
  4. set the default volume to jolla (the default is what gets mounted when something calls mount /dev/mmcblk1)
  5. stop alien-dalvik and copy everything form /data/sdcard to the new subvolume android (don't move the files, this way you have all basics alien-dalvik needs even after pulling the uSD)
  6. add mounting of that subvolume (android) to the sdcard-mounting-script provided by jolla, to be precise, in the section where it mounts non-fat volumes I added the android volume to be mounted to /data/sdcard
  7. reboot and wait for the device to settle, as soon as your jolla volume is mounted in /media/, you should see /dev/mmcblk1 being mounted to both /media/sdcard/#UUID and /data/sdcard

I did not want to write a detailed guide as I do not want to be responsible for any wrong doings all steps are pretty basic for people knowing their way around the cmdline - you can find every step somewhere here @tjc or in the man-pages of the required tools


detailed cmds use at your own risk

  1. umount /dev/mmcblk1p1 - unmount the card
  2. mkfs.btrfs -f /dev/mmcblk1 - format the card (no need for partition)
  3. mount -o subvolid=0 /dev/mmcblk1 /media/sdcard
  4. cd /media/sdcard
  5. btrfs subvolume create jolla - create folder called jolla
  6. btrfs subvolume create android - create folder called android
  7. btrfs subvolume list . - returns an ID for each subvolume
  8. btrfs subvolume set-default *ID for jolla* /media/sdcard/ - sets jolla to be mounted as default
  9. chown nemo:nemo jolla/ - add -R if needed
  10. chmod 775 jolla/
  11. chmod 777 android/
  12. cp -r -a -v /data/sdcard/* /media/sdcard/android
  13. umount /dev/mmcblk1
  14. edit /usr/sbin/mount-sd.sh add mount -o subvol=android,compress,$MOUNT_OPTS $(DEVNAME) /data/sdcard/ after the btrfs mount (btrfs mount is actually not specified so we go in the line for any other case *) in line 53, add it just below in a newline)

lines look like this

*) 
  mount ${DEVNAME} $MNT/${UUID} -o $MOUNT_OPTS || /bin/rmdir $MNT/${UUID}
  mount -o subvol=android,compress,$MOUNT_OPTS $(DEVNAME) /data/sdcard/
  ;;

How to: Format your uSD-Card to btrfs and share space with android

Version: 1.0.5.19

What I did to share the space of my uSD between nemo and android without getting duplicates with bind-mounts or any other hickup, read carefully and use at your own risk:

  1. format the whole usdcard (mmcblk1 not mmcblk1p1) to btrfs
  2. mount that volume (=0)
  3. create two subvolumes > jolla and android
  4. set the default volume to jolla (the default is what gets mounted when something calls mount /dev/mmcblk1)
  5. stop alien-dalvik and copy everything form /data/sdcard to the new subvolume android (don't move the files, this way you have all basics alien-dalvik needs even after pulling the uSD)
  6. add mounting of that subvolume (android) to the sdcard-mounting-script provided by jolla, to be precise, in the section where it mounts non-fat volumes I added the android volume to be mounted to /data/sdcard
  7. reboot and wait for the device to settle, as soon as your jolla volume is mounted in /media/, you should see /dev/mmcblk1 being mounted to both /media/sdcard/#UUID and /data/sdcard

detailed cmds use at your own risk

  1. umount /dev/mmcblk1p1 - unmount the card
  2. mkfs.btrfs -f /dev/mmcblk1 - format the card (no need for partition)
  3. mount -o subvolid=0 /dev/mmcblk1 /media/sdcard
  4. cd /media/sdcard
  5. btrfs subvolume create jolla - create folder called jolla
  6. btrfs subvolume create android - create folder called android
  7. btrfs subvolume list . - returns an ID for each subvolume
  8. btrfs subvolume set-default *ID for jolla* /media/sdcard/ - sets jolla to be mounted as default
  9. chown nemo:nemo jolla/ - add -R if needed
  10. chmod 775 jolla/
  11. chmod 777 android/
  12. cp -r -a -v /data/sdcard/* /media/sdcard/android
  13. umount /dev/mmcblk1
  14. edit /usr/sbin/mount-sd.sh add mount -o subvol=android,compress,$MOUNT_OPTS $(DEVNAME) ${DEVNAME} /data/sdcard/ after the btrfs mount (btrfs mount is actually not specified so we go in the line for any other case *) in line 53, add it just below in a newline)

lines look like this

*) 
  mount ${DEVNAME} $MNT/${UUID} -o $MOUNT_OPTS || /bin/rmdir $MNT/${UUID}
  mount -o subvol=android,compress,$MOUNT_OPTS $(DEVNAME) ${DEVNAME} /data/sdcard/
  ;;

How to: Format your uSD-Card to btrfs and share space with android

Version: 1.0.5.191.0.7.16

What I did to share the space of my uSD between nemo and android without getting duplicates with bind-mounts or any other hickup, read carefully and use at your own risk:

  1. format the whole usdcard (mmcblk1 not mmcblk1p1) to btrfs
  2. mount that volume (=0)
  3. create two subvolumes > jolla and android
  4. set the default volume to jolla (the default is what gets mounted when something calls mount /dev/mmcblk1)
  5. stop alien-dalvik and copy everything form /data/sdcard /data/media to the new subvolume android (don't move the files, this way you have all basics alien-dalvik needs even after pulling the uSD)
  6. add mounting of that subvolume (android) to the sdcard-mounting-script provided by jolla, to be precise, in the section where it mounts non-fat volumes I added the android volume to be mounted to /data/sdcard
  7. reboot and wait for the device to settle, as soon as your jolla volume is mounted in /media/, you should see /dev/mmcblk1 being mounted to both /media/sdcard/#UUID and /data/sdcard

detailed cmds use at your own risk

first dosystemctl stop aliendalvik.service then follow this list

  1. umount /dev/mmcblk1p1 - unmount the card
  2. mkfs.btrfs -f /dev/mmcblk1 - format the card (no need for partition)
  3. mount -o subvolid=0 /dev/mmcblk1 /media/sdcard
  4. cd /media/sdcard
  5. btrfs subvolume create jolla - create folder called jolla
  6. btrfs subvolume create android - create folder called android
  7. btrfs subvolume list . - returns an ID for each subvolume
  8. btrfs subvolume set-default *ID for jolla* /media/sdcard/ - sets jolla to be mounted as default
  9. chown nemo:nemo jolla/ - add -R if needed
  10. chmod 775 jolla/
  11. chmod 777 android/
  12. cp -r -a -v /data/sdcard/* /data/media/* /media/sdcard/android
  13. umount /dev/mmcblk1
  14. edit /usr/sbin/mount-sd.sh add mount

    create /etc/systemd/system/androidsdcard.service and fill with:

    [Unit] Description=Mount SDCard btrfs subvolume for Android ConditionPathExists=/dev/mmcblk1 ConditionPathIsDirectory=/data/media Requires=local-fs.target Before=aliendalvik.service After=local-fs.target BindsTo=mount-sd@mmcblk1.service

    [Service] Type=oneshot RemainAfterExit=yes ExecStart=/bin/mount -o subvol=android,compress,$MOUNT_OPTS ${DEVNAME} /data/sdcard/ after the btrfs mount (btrfs mount subvol=android,compress,dirsync,noatime,users /dev/mmcblk1 /data/media ExecStop=/bin/sh/ -c 'systemctl stop aliendalvik.service;umount /data/media'

    [Install] WantedBy=local-fs.target aliendalvik.service

  15. systemctl enable androidsdcard.service - the service gets started everytime alien is actually not specified so started

for the future we go in the line for any other case *) in line 53, add it just below in a newline)

lines look like this

*) 
  mount ${DEVNAME} $MNT/${UUID} -o $MOUNT_OPTS || /bin/rmdir $MNT/${UUID}
  mount -o subvol=android,compress,$MOUNT_OPTS ${DEVNAME} /data/sdcard/
  ;;
only need to load the service file to its place and enable it, if something changes I will update the code

How to: Format your uSD-Card to btrfs and share space with android

Version: 1.0.7.16

What I did to share the space of my uSD between nemo and android without getting duplicates with bind-mounts or any other hickup, read carefully and use at your own risk:

  1. format the whole usdcard (mmcblk1 not mmcblk1p1) to btrfs
  2. mount that volume (=0)
  3. create two subvolumes > jolla and android
  4. set the default volume to jolla (the default is what gets mounted when something calls mount /dev/mmcblk1)
  5. stop alien-dalvik and copy everything form /data/media to the new subvolume android (don't move the files, this way you have all basics alien-dalvik needs even after pulling the uSD)
  6. add mounting of that subvolume (android) to the sdcard-mounting-script provided by jolla, to be precise, in the section where it mounts non-fat volumes I added the android volume to be mounted to /data/sdcard
  7. reboot and wait for the device to settle, as soon as your jolla volume is mounted in /media/, you should see /dev/mmcblk1 being mounted to both /media/sdcard/#UUID and /data/sdcard

detailed cmds use at your own risk

first dosystemctl stop aliendalvik.service then follow this list

  1. umount /dev/mmcblk1p1 - unmount the card
  2. mkfs.btrfs -f /dev/mmcblk1 - format the card (no need for partition)
  3. mount -o subvolid=0 /dev/mmcblk1 /media/sdcard
  4. cd /media/sdcard
  5. btrfs subvolume create jolla - create folder called jolla
  6. btrfs subvolume create android - create folder called android
  7. btrfs subvolume list . - returns an ID for each subvolume
  8. btrfs subvolume set-default *ID for jolla* /media/sdcard/ - sets jolla to be mounted as default
  9. chown nemo:nemo jolla/ - add -R if needed
  10. chmod 775 jolla/
  11. chmod 777 android/
  12. cp -r -a -v /data/media/* /media/sdcard/android
  13. umount /dev/mmcblk1
  14. create /etc/systemd/system/androidsdcard.service and fill with:

#

[Unit]
Description=Mount SDCard btrfs subvolume for Android
ConditionPathExists=/dev/mmcblk1
ConditionPathIsDirectory=/data/media
Requires=local-fs.target
Before=aliendalvik.service
After=local-fs.target
BindsTo=mount-sd@mmcblk1.service

BindsTo=mount-sd@mmcblk1.service [Service] Type=oneshot RemainAfterExit=yes ExecStart=/bin/mount -o subvol=android,compress,dirsync,noatime,users /dev/mmcblk1 /data/media ExecStop=/bin/sh/ -c 'systemctl stop aliendalvik.service;umount /data/media'

/data/media' [Install] WantedBy=local-fs.target aliendalvik.service

  • aliendalvik.service

    • systemctl enable enable androidsdcard.service - the the service gets started everytime everytime alien is started

    for the future we only need to load the service file to its place and enable it, if something changes I will update the code

    How to: Format your uSD-Card to btrfs and share space with android

    Version: 1.0.7.16

    This is no beginners guide, you need to know your way around! I try to make everything as foolproof as possible. This version does only apply to the SFOS release with the same version number!

    Understand what to do before you do!

    What I did to share the space of my uSD between nemo and android without getting duplicates with bind-mounts or any other hickup, read carefully and use at your own risk:

    1. format the whole usdcard (mmcblk1 not mmcblk1p1) to btrfs
    2. mount that volume (=0)
    3. create two subvolumes > jolla and android
    4. set the default volume to jolla (the default is what gets mounted when something calls mount /dev/mmcblk1)
    5. stop alien-dalvik and copy everything form /data/media to the new subvolume android (don't move the files, this way you have all basics alien-dalvik needs even after pulling the uSD)
    6. add mounting of a system.service to systemd that mounts and unmounts the subvolume (android) to the sdcard-mounting-script provided by jolla, for android as needed and honours aliendalvik.service The problems to solve are: aliendalvik fuse-mounts its /data/media to /home/nemo/android_storage so you need to make sure everything is mounted before that happens on boot, and stop aliendalvik when the sd gets pulled or the mount needs to be precise, in the section where it mounts non-fat volumes I added the android volume to be mounted to /data/sdcardlifted for any other cause.
    7. reboot and wait for the device to settle, as soon as your jolla volume is mounted in /media/, you should see /dev/mmcblk1 being mounted to both /media/sdcard/#UUID and /data/sdcard/data/media

    detailed cmds use at your own risk

    first dosystemctl stop aliendalvik.service then follow this list

    1. umount /dev/mmcblk1p1 - unmount the card
    2. mkfs.btrfs -f /dev/mmcblk1 - format the card (no need for partition)
    3. mount -o subvolid=0 /dev/mmcblk1 /media/sdcard
    4. cd /media/sdcard
    5. btrfs subvolume create jolla - create folder called jolla
    6. btrfs subvolume create android - create folder called android
    7. btrfs subvolume list . - returns an ID for each subvolume
    8. btrfs subvolume set-default *ID for jolla* /media/sdcard/ - sets jolla to be mounted as default
    9. chown nemo:nemo jolla/ - add -R if needed
    10. chmod 775 jolla/
    11. chmod 777 android/
    12. cp -r -a -v /data/media/* /media/sdcard/android
    13. umount /dev/mmcblk1
    14. create /etc/systemd/system/androidsdcard.service and fill with:

    #

    [Unit]
    Description=Mount SDCard btrfs subvolume for Android
    ConditionPathExists=/dev/mmcblk1
    ConditionPathIsDirectory=/data/media
    Requires=local-fs.target
    Before=aliendalvik.service
    After=local-fs.target
    BindsTo=mount-sd@mmcblk1.service
    
    [Service]
    Type=oneshot
    RemainAfterExit=yes
    ExecStart=/bin/mount -o subvol=android,compress,dirsync,noatime,users /dev/mmcblk1 /data/media
    ExecStop=/bin/sh/ -c 'systemctl stop aliendalvik.service;umount /data/media'
    
    [Install]
    WantedBy=local-fs.target aliendalvik.service
    
    • systemctl enable androidsdcard.service - the service file gets started everytime alien every time aliendalvik is startedstarted and stops aliendalvik when it gets stopped, on boot it prevents aliendalvik from starting if it is not started yet but waits for the local-fs to be settled and actually having a mountpoint

    for the future we only need to load the service file to its place and enable it, if something changes I will update the code

    How to: Format your uSD-Card to btrfs and share space with android

    Version: 1.0.7.16

    This is no beginners guide, you need to know your way around! I try to make everything as foolproof as possible. This version does only apply to the SFOS release with the same version number!

    Understand what to do before you do!

    What I did to share the space of my uSD between nemo and android without getting duplicates with bind-mounts or any other hickup, read carefully and use at your own risk:

    1. format the whole usdcard (mmcblk1 not mmcblk1p1) to btrfs
    2. mount that volume (=0)
    3. create two subvolumes > jolla and android
    4. set the default volume to jolla (the default is what gets mounted when something calls mount /dev/mmcblk1)
    5. stop alien-dalvik and copy everything form /data/media to the new subvolume android (don't move the files, this way you have all basics alien-dalvik needs even after pulling the uSD)
    6. add a system.service to systemd that mounts and unmounts the subvolume for android as needed and honours aliendalvik.service The problems to solve are: aliendalvik fuse-mounts its /data/media to /home/nemo/android_storage so you need to make sure everything is mounted before that happens on boot, and stop aliendalvik when the sd gets pulled or the mount needs to be lifted for any other cause.
    7. reboot and wait for the device to settle, as soon as your jolla volume is mounted in /media/, you should see /dev/mmcblk1 being mounted to both /media/sdcard/#UUID and /data/media

    detailed cmds use at your own risk

    preparing the sdcard, should only be needed once!

    first dosystemctl stop aliendalvik.service then follow this list

    1. umount /dev/mmcblk1p1 - unmount the card
    2. mkfs.btrfs -f /dev/mmcblk1 - format the card (no need for partition)
    3. mount -o subvolid=0 /dev/mmcblk1 /media/sdcard
    4. cd /media/sdcard
    5. btrfs subvolume create jolla - create folder called jolla
    6. btrfs subvolume create android - create folder called android
    7. btrfs subvolume list . - returns an ID for each subvolume
    8. btrfs subvolume set-default *ID for jolla* /media/sdcard/ - sets jolla to be mounted as default
    9. chown nemo:nemo jolla/ - add -R if needed
    10. chmod 775 jolla/
    11. chmod 777 android/
    12. cp -r -a -v /data/media/* /media/sdcard/android
    13. umount /dev/mmcblk1

    preparing the system

    1. create /etc/systemd/system/androidsdcard.service and fill with:

    #

    [Unit]
    Description=Mount SDCard btrfs subvolume for Android
    ConditionPathExists=/dev/mmcblk1
    ConditionPathIsDirectory=/data/media
    Requires=local-fs.target
    Before=aliendalvik.service
    After=local-fs.target
    BindsTo=mount-sd@mmcblk1.service
    
    [Service]
    Type=oneshot
    RemainAfterExit=yes
    ExecStart=/bin/mount -o subvol=android,compress,dirsync,noatime,users /dev/mmcblk1 /data/media
    ExecStop=/bin/sh/ -c 'systemctl stop aliendalvik.service;umount /data/media'
    
    [Install]
    WantedBy=local-fs.target aliendalvik.service
    
    • systemctl enable androidsdcard.service - the service file gets started every time aliendalvik is started and stops aliendalvik when it gets stopped, on boot it prevents aliendalvik from starting if it is not started yet but waits for the local-fs to be settled and actually having a mountpoint

    for the future we only need to load the service file to its place and enable it, if something changes I will update the code

    How to: Format your uSD-Card to btrfs and share space with android

    Version: 1.0.7.16

    This is no beginners guide, you need to know your way around! I try to make everything as foolproof as possible. This version does only apply to the SFOS release with the same version number!

    Understand what to do before you do!

    What I did to share the space of my uSD between nemo and android without getting duplicates with bind-mounts or any other hickup, read carefully and use at your own risk:

    1. format the whole usdcard (mmcblk1 not mmcblk1p1) to btrfs
    2. mount that volume (=0)
    3. create two subvolumes > jolla and android
    4. set the default volume to jolla (the default is what gets mounted when something calls mount /dev/mmcblk1)
    5. stop alien-dalvik and copy everything form /data/media to the new subvolume android (don't move the files, this way you have all basics alien-dalvik needs even after pulling the uSD)
    6. add a system.service to systemd that mounts and unmounts the subvolume for android as needed and honours aliendalvik.service The problems to solve are: aliendalvik fuse-mounts its /data/media to /home/nemo/android_storage so you need to make sure everything is mounted before that happens on boot, and stop aliendalvik when the sd gets pulled or the mount needs to be lifted for any other cause.
    7. reboot and wait for the device to settle, as soon as your jolla volume is mounted in /media/, you should see /dev/mmcblk1 being mounted to both /media/sdcard/#UUID and /data/media

    detailed cmds use at your own risk

    preparing the sdcard, should only be needed once!

    first dosystemctl stop aliendalvik.service then follow this list

    1. umount /dev/mmcblk1p1 - unmount the card
    2. mkfs.btrfs -f /dev/mmcblk1 - format the card (no need for partition)
    3. mount -o subvolid=0 /dev/mmcblk1 /media/sdcard
    4. cd /media/sdcard
    5. btrfs subvolume create jolla - create folder called jolla
    6. btrfs subvolume create android - create folder called android
    7. btrfs subvolume list . - returns an ID for each subvolume
    8. btrfs subvolume set-default *ID for jolla* /media/sdcard/ - sets jolla to be mounted as default
    9. chown nemo:nemo jolla/ - add -R if needed
    10. chmod 775 jolla/
    11. chmod 777 android/
    12. cp -r -a -v /data/media/* /media/sdcard/android
    13. umount /dev/mmcblk1

    preparing the system

    1. create /etc/systemd/system/androidsdcard.service and fill with:

    #

    [Unit]
    Description=Mount SDCard btrfs subvolume for Android
    ConditionPathExists=/dev/mmcblk1
    ConditionPathIsDirectory=/data/media
    Requires=local-fs.target
    Before=aliendalvik.service
    After=local-fs.target
    BindsTo=mount-sd@mmcblk1.service
    
    [Service]
    Type=oneshot
    RemainAfterExit=yes
    ExecStart=/bin/mount -o subvol=android,compress,dirsync,noatime,users /dev/mmcblk1 /data/media
    ExecStop=/bin/sh/ -c 'systemctl stop aliendalvik.service;umount /data/media'
    
    [Install]
    WantedBy=local-fs.target aliendalvik.service
    
    • systemctl enable androidsdcard.service - the service file gets started every time aliendalvik is started and stops aliendalvik when it gets stopped, on boot it prevents aliendalvik from starting if it is not started yet but waits for the local-fs to be settled and actually having a mountpoint

    for the future we only need to load the service file to its place and enable it, if something changes I will update the code

    BACKUP TO SDCARD NOTICE: For copying backups to the sdcard you need to deactivate the service systemctl stop androidsdcard.service as the-vault does not account for other usecases than sdcards get mounted for nemo to /media/sdcard/($UUID)

    How to: Format your uSD-Card to btrfs and share space with android

    Version: 1.0.7.16

    This is no beginners guide, you need to know your way around! I try to make everything as foolproof as possible. This version does only apply to the SFOS release with the same version number!

    Understand what to do before you do!

    What I did to share the space of my uSD between nemo and android without getting duplicates with bind-mounts or any other hickup, read carefully and use at your own risk:

    1. format the whole usdcard (mmcblk1 not mmcblk1p1) to btrfs
    2. mount that volume (=0)
    3. create two subvolumes > jolla and android
    4. set the default volume to jolla (the default is what gets mounted when something calls mount /dev/mmcblk1)
    5. stop alien-dalvik and copy everything form /data/media to the new subvolume android (don't move the files, this way you have all basics alien-dalvik needs even after pulling the uSD)
    6. add a system.service to systemd that mounts and unmounts the subvolume for android as needed and honours aliendalvik.service The problems to solve are: aliendalvik fuse-mounts its /data/media to /home/nemo/android_storage so you need to make sure everything is mounted before that happens on boot, and stop aliendalvik when the sd gets pulled or the mount needs to be lifted for any other cause.
    7. reboot and wait for the device to settle, as soon as your jolla volume is mounted in /media/, you should see /dev/mmcblk1 being mounted to both /media/sdcard/#UUID and /data/media

    detailed cmds use at your own risk

    preparing the sdcard, should only be needed once!

    first dosystemctl stop aliendalvik.service then follow this list

    1. umount /dev/mmcblk1p1 - unmount the card
    2. mkfs.btrfs -f /dev/mmcblk1 - format the card (no need for partition)
    3. mount -o subvolid=0 /dev/mmcblk1 /media/sdcard
    4. cd /media/sdcard
    5. btrfs subvolume create jolla - create folder called jolla
    6. btrfs subvolume create android - create folder called android
    7. btrfs subvolume list . - returns an ID for each subvolume
    8. btrfs subvolume set-default *ID for jolla* /media/sdcard/ - sets jolla to be mounted as default
    9. chown nemo:nemo jolla/ - add -R if needed
    10. chmod 775 jolla/
    11. chmod 777 android/
    12. cp -r -a -v /data/media/* /media/sdcard/android
    13. umount /dev/mmcblk1

    preparing the system

    1. create /etc/systemd/system/androidsdcard.service and fill with:

    #

    [Unit]
    Description=Mount SDCard btrfs subvolume for Android
    ConditionPathExists=/dev/mmcblk1
    ConditionPathIsDirectory=/data/media
    Requires=local-fs.target
    Before=aliendalvik.service
    After=local-fs.target
    BindsTo=mount-sd@mmcblk1.service
    
    [Service]
    Type=oneshot
    RemainAfterExit=yes
    ExecStart=/bin/mount -o subvol=android,compress,dirsync,noatime,users /dev/mmcblk1 /data/media
    ExecStop=/bin/sh/ -c 'systemctl stop aliendalvik.service;umount /data/media'
    
    [Install]
    WantedBy=local-fs.target aliendalvik.service
    
    • systemctl enable androidsdcard.service - the service file gets started every time aliendalvik is started and stops aliendalvik when it gets stopped, on boot it prevents aliendalvik from starting if it is not started yet but waits for the local-fs to be settled and actually having a mountpoint

    for the future we only need to load the service file to its place and enable it, if something changes I will update the code

    BACKUP TO SDCARD NOTICE: For copying backups to the sdcard you need to deactivate the service systemctl stop androidsdcard.service as the-vault does not account for other usecases than sdcards get mounted for nemo to /media/sdcard/($UUID). This only applies for jolla-settings of course you can tar ~/.vault to /media/sdcard/($UUID) yourself

    How to: Format your uSD-Card to btrfs and share space with android

    Version: 1.0.7.16

    currently WIP as alien-dalvik is unable to read or write ~/android_storage this way

    This is no beginners guide, you need to know your way around! I try to make everything as foolproof as possible. This version does only apply to the SFOS release with the same version number!

    Understand what to do before you do!

    What I did to share the space of my uSD between nemo and android without getting duplicates with bind-mounts or any other hickup, read carefully and use at your own risk:

    1. format the whole usdcard (mmcblk1 not mmcblk1p1) to btrfs
    2. mount that volume (=0)
    3. create two subvolumes > jolla and android
    4. set the default volume to jolla (the default is what gets mounted when something calls mount /dev/mmcblk1)
    5. stop alien-dalvik and copy everything form /data/media to the new subvolume android (don't move the files, this way you have all basics alien-dalvik needs even after pulling the uSD)
    6. add a system.service to systemd that mounts and unmounts the subvolume for android as needed and honours aliendalvik.service The problems to solve are: aliendalvik fuse-mounts its /data/media to /home/nemo/android_storage so you need to make sure everything is mounted before that happens on boot, and stop aliendalvik when the sd gets pulled or the mount needs to be lifted for any other cause.
    7. reboot and wait for the device to settle, as soon as your jolla volume is mounted in /media/, you should see /dev/mmcblk1 being mounted to both /media/sdcard/#UUID and /data/media

    detailed cmds use at your own risk

    preparing the sdcard, should only be needed once!

    first dosystemctl stop aliendalvik.service then follow this list

    1. umount /dev/mmcblk1p1 - unmount the card
    2. mkfs.btrfs -f /dev/mmcblk1 - format the card (no need for partition)
    3. mount -o subvolid=0 /dev/mmcblk1 /media/sdcard
    4. cd /media/sdcard
    5. btrfs subvolume create jolla - create folder called jolla
    6. btrfs subvolume create android - create folder called android
    7. btrfs subvolume list . - returns an ID for each subvolume
    8. btrfs subvolume set-default *ID for jolla* /media/sdcard/ - sets jolla to be mounted as default
    9. chown nemo:nemo jolla/ - add -R if needed
    10. chmod 775 jolla/
    11. chmod 777 android/
    12. cp -r -a -v /data/media/* /media/sdcard/android
    13. umount /dev/mmcblk1

    preparing the system

    1. create /etc/systemd/system/androidsdcard.service and fill with:

    #

    [Unit]
    Description=Mount SDCard btrfs subvolume for Android
    ConditionPathExists=/dev/mmcblk1
    ConditionPathIsDirectory=/data/media
    Requires=local-fs.target
    Before=aliendalvik.service
    After=local-fs.target
    BindsTo=mount-sd@mmcblk1.service
    
    [Service]
    Type=oneshot
    RemainAfterExit=yes
    ExecStart=/bin/mount -o subvol=android,compress,dirsync,noatime,users /dev/mmcblk1 /data/media
    ExecStop=/bin/sh/ -c 'systemctl stop aliendalvik.service;umount /data/media'
    
    [Install]
    WantedBy=local-fs.target aliendalvik.service
    
    • systemctl enable androidsdcard.service - the service file gets started every time aliendalvik is started and stops aliendalvik when it gets stopped, on boot it prevents aliendalvik from starting if it is not started yet but waits for the local-fs to be settled and actually having a mountpoint

    for the future we only need to load the service file to its place and enable it, if something changes I will update the code

    BACKUP TO SDCARD NOTICE: For copying backups to the sdcard you need to deactivate the service systemctl stop androidsdcard.service as the-vault does not account for other usecases than sdcards get mounted for nemo to /media/sdcard/($UUID). This only applies for jolla-settings of course you can tar ~/.vault to /media/sdcard/($UUID) yourself

    How to: Format your uSD-Card to btrfs and share space with android

    Version: 1.0.7.16

    currently WIP as alien-dalvik is unable to read or write ~/android_storage this way

    This is no beginners guide, you need to know your way around! I try to make everything as foolproof as possible. This version does only apply to the SFOS release with the same version number!

    Understand what to do before you do!

    What I did to share the space of my uSD between nemo and android without getting duplicates with bind-mounts or any other hickup, read carefully and use at your own risk:

    1. format the whole usdcard (mmcblk1 not mmcblk1p1) to btrfs
    2. mount that volume (=0)
    3. create two subvolumes > jolla and android
    4. set the default volume to jolla (the default is what gets mounted when something calls mount /dev/mmcblk1)
    5. stop alien-dalvik and copy everything form /data/media to the new subvolume android (don't move the files, this way you have all basics alien-dalvik needs even after pulling the uSD)
    6. add a system.service to systemd that mounts and unmounts the subvolume for android as needed and honours aliendalvik.service The problems to solve are: aliendalvik fuse-mounts its /data/media to /home/nemo/android_storage so you need to make sure everything is mounted before that happens on boot, and stop aliendalvik when the sd gets pulled or the mount needs to be lifted for any other cause.
    7. reboot and wait for the device to settle, as soon as your jolla volume is mounted in /media/, you should see /dev/mmcblk1 being mounted to both /media/sdcard/#UUID and /data/media

    detailed cmds use at your own risk

    preparing the sdcard, should only be needed once!

    first dosystemctl stop aliendalvik.service then follow this list

    1. umount /dev/mmcblk1p1 - unmount the card
    2. mkfs.btrfs -f /dev/mmcblk1 - format the card (no need for partition)
    3. mount -o subvolid=0 /dev/mmcblk1 /media/sdcard
    4. cd /media/sdcard
    5. btrfs subvolume create jolla - create folder called jolla
    6. btrfs subvolume create android - create folder called android
    7. btrfs subvolume list . - returns an ID for each subvolume
    8. btrfs subvolume set-default *ID for jolla* /media/sdcard/ - sets jolla to be mounted as default
    9. chown nemo:nemo jolla/ - add -R if needed
    10. chmod 775 jolla/
    11. chmod 777 android/
    12. cp -r -a -v /data/media/* /media/sdcard/android
    13. umount /dev/mmcblk1

    preparing the system

    1. create /etc/systemd/system/androidsdcard.service and fill with:

    #

    [Unit]
    Description=Mount SDCard btrfs subvolume for Android
    ConditionPathExists=/dev/mmcblk1
    ConditionPathIsDirectory=/data/media
    Requires=local-fs.target
    Before=aliendalvik.service
    After=local-fs.target
    After=local-fs.target mount-sd@mmcblk1.service
    BindsTo=mount-sd@mmcblk1.service
    
    [Service]
    Type=oneshot
    RemainAfterExit=yes
    ExecStart=/bin/mount -o subvol=android,compress,dirsync,noatime,users /dev/mmcblk1 /data/media
    ExecStop=/bin/sh/ -c 'systemctl stop aliendalvik.service;umount /data/media'
    
    [Install]
    WantedBy=local-fs.target aliendalvik.service
    
    • systemctl enable androidsdcard.service - the service file gets started every time aliendalvik is started and stops aliendalvik when it gets stopped, on boot it prevents aliendalvik from starting if it is not started yet but waits for the local-fs to be settled and actually having a mountpoint

    for the future we only need to load the service file to its place and enable it, if something changes I will update the code

    For upgrading from previous version: the group and owner of the files have changed, stop aliendalvik.service and chmod media_rw:media_rw -R /data/media/

    BACKUP TO SDCARD NOTICE: For copying backups to the sdcard you need to deactivate the service systemctl stop androidsdcard.service as the-vault does not account for other usecases than sdcards get mounted for nemo to /media/sdcard/($UUID). This only applies for jolla-settings of course you can tar ~/.vault to /media/sdcard/($UUID) yourself

    BACKUP TO SDCARD UPDATE: I updated the service file to inlcude After=local-fs.target mount-sd@mmcblk1.service, if you alter service files you need to remember to update the tree or it wont work (stop service, disable service, update file, systemctl daemon-reload, enable service; I am sure there is an easier way but I don't know it yet)

    How to: Format your uSD-Card to btrfs and share space with android

    Version: 1.0.7.16

    This is no beginners guide, you need to know your way around! I try to make everything as foolproof as possible. This version does only apply to the SFOS release with the same version number!

    Understand what to do before you do!

    What I did to share the space of my uSD between nemo and android without getting duplicates with bind-mounts or any other hickup, read carefully and use at your own risk:

    1. format the whole usdcard (mmcblk1 not mmcblk1p1) to btrfs
    2. mount that volume (=0)
    3. create two subvolumes > jolla and android
    4. set the default volume to jolla (the default is what gets mounted when something calls mount /dev/mmcblk1)
    5. stop alien-dalvik and copy everything form /data/media to the new subvolume android (don't move the files, this way you have all basics alien-dalvik needs even after pulling the uSD)
    6. add a system.service to systemd that mounts and unmounts the subvolume for android as needed and honours aliendalvik.service The problems to solve are: aliendalvik fuse-mounts its /data/media to /home/nemo/android_storage so you need to make sure everything is mounted before that happens on boot, and stop aliendalvik when the sd gets pulled or the mount needs to be lifted for any other cause.
    7. reboot and wait for the device to settle, as soon as your jolla volume is mounted in /media/, you should see /dev/mmcblk1 being mounted to both /media/sdcard/#UUID and /data/media

    detailed cmds use at your own risk

    preparing the sdcard, should only be needed once!

    first dosystemctl stop aliendalvik.service then follow this list

    1. umount /dev/mmcblk1p1 - unmount the card
    2. mkfs.btrfs -f /dev/mmcblk1 - format the card (no need for partition)
    3. mount -o subvolid=0 /dev/mmcblk1 /media/sdcard
    4. cd /media/sdcard
    5. btrfs subvolume create jolla - create folder called jolla
    6. btrfs subvolume create android - create folder called android
    7. btrfs subvolume list . - returns an ID for each subvolume
    8. btrfs subvolume set-default *ID for jolla* /media/sdcard/ - sets jolla to be mounted as default
    9. chown nemo:nemo jolla/ - add -R if needed
    10. chmod 775 jolla/
    11. chmod 777 android/
    12. cp -r -a -v /data/media/* /media/sdcard/android
    13. umount /dev/mmcblk1

    preparing the system

    1. create /etc/systemd/system/androidsdcard.service and fill with:

    #

    [Unit]
    Description=Mount SDCard btrfs subvolume for Android
    ConditionPathExists=/dev/mmcblk1
    ConditionPathIsDirectory=/data/media
    Requires=local-fs.target
    Before=aliendalvik.service
    After=local-fs.target mount-sd@mmcblk1.service
    BindsTo=mount-sd@mmcblk1.service
    
    [Service]
    Type=oneshot
    RemainAfterExit=yes
    ExecStart=/bin/mount -o subvol=android,compress,dirsync,noatime,users /dev/mmcblk1 /data/media
    ExecStop=/bin/sh/ -c 'systemctl stop aliendalvik.service;umount /data/media'
    
    [Install]
    WantedBy=local-fs.target aliendalvik.service
    
    • systemctl enable androidsdcard.service - the service file gets started every time aliendalvik is started and stops aliendalvik when it gets stopped, on boot it prevents aliendalvik from starting if it is not started yet but waits for the local-fs to be settled and actually having a mountpoint

    for the future we only need to load the service file to its place and enable it, if something changes I will update the code

    For upgrading from previous version: the group and owner of the files have changed, stop aliendalvik.service and chmod media_rw:media_rw -R /data/media/

    BACKUP TO SDCARD NOTICE: For copying backups to the sdcard you need to deactivate the service systemctl stop androidsdcard.service as the-vault does not account for other usecases than sdcards get mounted for nemo to /media/sdcard/($UUID). This only applies for jolla-settings of course you can tar ~/.vault to /media/sdcard/($UUID) yourself

    BACKUP TO SDCARD UPDATE: I updated the service file to inlcude After=local-fs.target mount-sd@mmcblk1.service, if you alter service files you need to remember to update the tree or it wont work (stop service, disable service, update file, systemctl daemon-reload, enable service; I am sure there is an easier way but I don't know it yet)

    How to: Format your uSD-Card to btrfs and share space with android

    Version: 1.0.7.16

    This is no beginners guide, you need to know your way around! I try to make everything as foolproof as possible. This version does only apply to the SFOS release with the same version number!

    Understand what to do before you do!

    What I did to share the space of my uSD between nemo and android without getting duplicates with bind-mounts or any other hickup, read carefully and use at your own risk:

    1. format the whole usdcard (mmcblk1 not mmcblk1p1) to btrfs
    2. mount that volume (=0)
    3. create two subvolumes > jolla and android
    4. set the default volume to jolla (the default is what gets mounted when something calls mount /dev/mmcblk1)
    5. stop alien-dalvik and copy everything form /data/media to the new subvolume android (don't move the files, this way you have all basics alien-dalvik needs even after pulling the uSD)
    6. add a system.service to systemd that mounts and unmounts the subvolume for android as needed and honours aliendalvik.service The problems to solve are: aliendalvik fuse-mounts its /data/media to /home/nemo/android_storage so you need to make sure everything is mounted before that happens on boot, and stop aliendalvik when the sd gets pulled or the mount needs to be lifted for any other cause.
    7. reboot and wait for the device to settle, as soon as your jolla volume is mounted in /media/, you should see /dev/mmcblk1 being mounted to both /media/sdcard/#UUID and /data/media

    detailed cmds use at your own risk

    preparing the sdcard, should only be needed once!

    first dosystemctl stop aliendalvik.service then follow this list

    1. umount /dev/mmcblk1p1 - unmount the card
    2. mkfs.btrfs -f /dev/mmcblk1 - format the card (no need for partition)
    3. mount -o subvolid=0 /dev/mmcblk1 /media/sdcard
    4. cd /media/sdcard
    5. btrfs subvolume create jolla - create folder called jolla
    6. btrfs subvolume create android - create folder called android
    7. btrfs subvolume list . - returns an ID for each subvolume
    8. btrfs subvolume set-default *ID for jolla* /media/sdcard/ - sets jolla to be mounted as default
    9. chown nemo:nemo jolla/ - add -R if needed
    10. chmod 775 jolla/
    11. chmod 777 android/
    12. cp -r -a -v /data/media/* /media/sdcard/android
    13. umount /dev/mmcblk1

    preparing the system

    1. create /etc/systemd/system/androidsdcard.service and fill with:

    #

    [Unit]
    Description=Mount SDCard btrfs subvolume for Android
    ConditionPathExists=/dev/mmcblk1
    ConditionPathIsDirectory=/data/media
    Requires=local-fs.target
    Before=aliendalvik.service
    After=local-fs.target mount-sd@mmcblk1.service
    BindsTo=mount-sd@mmcblk1.service
    
    [Service]
    Type=oneshot
    RemainAfterExit=yes
    ExecStart=/bin/mount -o subvol=android,compress,dirsync,noatime,users /dev/mmcblk1 /data/media
    ExecStop=/bin/sh/ -c 'systemctl stop aliendalvik.service;umount /data/media'
    
    [Install]
    WantedBy=local-fs.target aliendalvik.service
    
    • systemctl enable androidsdcard.service - the service file gets started every time aliendalvik is started and stops aliendalvik when it gets stopped, on boot it prevents aliendalvik from starting if it is not started yet but waits for the local-fs to be settled and actually having a mountpointmountpoint (due to the-vault only looking for the biggest mounted sdcard partition we have to wait for mount-sd too to have it read by the-vault first)

    for the future we only need to load the service file to its place and enable it, if something changes I will update the code

    For upgrading from previous version: the group and owner of the files have changed, stop aliendalvik.service and chmod media_rw:media_rw -R /data/media/

    BACKUP TO SDCARD NOTICE: For copying backups to the sdcard you need to deactivate the service systemctl stop androidsdcard.service as the-vault does not account for other usecases than sdcards get mounted for nemo to /media/sdcard/($UUID). This only applies for jolla-settings of course you can tar ~/.vault to /media/sdcard/($UUID) yourself

    BACKUP TO SDCARD UPDATE: I updated the service file to inlcude After=local-fs.target mount-sd@mmcblk1.service, if you alter service files you need to remember to update the tree or it wont work (stop service, disable service, update file, systemctl daemon-reload, enable service; I am sure there is an easier way but I don't know it yet)

    How to: Format your uSD-Card to btrfs and share space with android

    Version: 1.0.7.16

    This is no beginners guide, you need to know your way around! I try to make everything as foolproof as possible. This version does only apply to the SFOS release with the same version number!

    Understand what to do before you do!

    What I did to share the space of my uSD between nemo and android without getting duplicates with bind-mounts or any other hickup, read carefully and use at your own risk:

    1. format the whole usdcard (mmcblk1 not mmcblk1p1) to btrfs
    2. mount that volume (=0)
    3. create two subvolumes > jolla and android
    4. set the default volume to jolla (the default is what gets mounted when something calls mount /dev/mmcblk1)
    5. stop alien-dalvik and copy everything form /data/media to the new subvolume android (don't move the files, this way you have all basics alien-dalvik needs even after pulling the uSD)
    6. add a system.service to systemd that mounts and unmounts the subvolume for android as needed and honours aliendalvik.service The problems to solve are: aliendalvik fuse-mounts its /data/media to /home/nemo/android_storage so you need to make sure everything is mounted before that happens on boot, and stop aliendalvik when the sd gets pulled or the mount needs to be lifted for any other cause.
    7. reboot and wait for the device to settle, as soon as your jolla volume is mounted in /media/, you should see /dev/mmcblk1 being mounted to both /media/sdcard/#UUID and /data/media

    detailed cmds use at your own risk

    preparing the sdcard, should only be needed once!

    first dosystemctl stop aliendalvik.service then follow this list

    1. umount /dev/mmcblk1p1 - unmount the card
    2. mkfs.btrfs -f /dev/mmcblk1 - format the card (no need for partition)
    3. mount -o subvolid=0 /dev/mmcblk1 /media/sdcard
    4. cd /media/sdcard
    5. btrfs subvolume create jolla - create folder called jolla
    6. btrfs subvolume create android - create folder called android
    7. btrfs subvolume list . - returns an ID for each subvolume
    8. btrfs subvolume set-default *ID for jolla* /media/sdcard/ - sets jolla to be mounted as default
    9. chown nemo:nemo jolla/ - add -R if needed
    10. chmod 775 jolla/
    11. chmod 777 android/
    12. cp -r -a -v /data/media/* /media/sdcard/android
    13. umount /dev/mmcblk1

    preparing the system

    1. create /etc/systemd/system/androidsdcard.service and fill with:

    #

    [Unit]
    Description=Mount SDCard btrfs subvolume for Android
    ConditionPathExists=/dev/mmcblk1
    ConditionPathIsDirectory=/data/media
    Requires=local-fs.target
    Before=aliendalvik.service
    After=local-fs.target mount-sd@mmcblk1.service
    BindsTo=mount-sd@mmcblk1.service
    
    [Service]
    Type=oneshot
    RemainAfterExit=yes
    ExecStart=/bin/mount -o subvol=android,compress,dirsync,noatime,users /dev/mmcblk1 /data/media
    ExecStop=/bin/sh/ -c 'systemctl stop aliendalvik.service;umount /data/media'
    
    [Install]
    WantedBy=local-fs.target aliendalvik.service
    
    • systemctl enable androidsdcard.service - the service file gets started every time aliendalvik is started and stops aliendalvik when it gets stopped, on boot it prevents aliendalvik from starting if it is not started yet but waits for the local-fs to be settled and actually having a mountpoint (due to the-vault only looking for the biggest mounted sdcard partition we have to wait for mount-sd too to have it read by the-vault first)

    for the future we only need to load the service file to its place and enable it, if something changes I will update the code

    For upgrading from previous version: the group and owner of the files have changed, stop aliendalvik.service and chmod chown media_rw:media_rw -R /data/media/

    BACKUP TO SDCARD NOTICE: For copying backups to the sdcard you need to deactivate the service systemctl stop androidsdcard.service as the-vault does not account for other usecases than sdcards get mounted for nemo to /media/sdcard/($UUID). This only applies for jolla-settings of course you can tar ~/.vault to /media/sdcard/($UUID) yourself

    BACKUP TO SDCARD UPDATE: I updated the service file to inlcude After=local-fs.target mount-sd@mmcblk1.service, if you alter service files you need to remember to update the tree or it wont work (stop service, disable service, update file, systemctl daemon-reload, enable service; I am sure there is an easier way but I don't know it yet)

    How to: Format your uSD-Card to btrfs and share space with android

    Version: 1.0.7.16>=1.0.7.16

    This is no beginners guide, you need to know your way around! I try to make everything as foolproof as possible. This version does only apply to the SFOS release with the same version number!

    Understand what to do before you do!

    What I did to share the space of my uSD between nemo and android without getting duplicates with bind-mounts or any other hickup, read carefully and use at your own risk:

    1. format the whole usdcard (mmcblk1 not mmcblk1p1) to btrfs
    2. mount that volume (=0)
    3. create two subvolumes > jolla and android
    4. set the default volume to jolla (the default is what gets mounted when something calls mount /dev/mmcblk1)
    5. stop alien-dalvik and copy everything form /data/media to the new subvolume android (don't move the files, this way you have all basics alien-dalvik needs even after pulling the uSD)
    6. add a system.service to systemd that mounts and unmounts the subvolume for android as needed and honours aliendalvik.service The problems to solve are: aliendalvik fuse-mounts its /data/media to /home/nemo/android_storage so you need to make sure everything is mounted before that happens on boot, and stop aliendalvik when the sd gets pulled or the mount needs to be lifted for any other cause.
    7. reboot and wait for the device to settle, as soon as your jolla volume is mounted in /media/, you should see /dev/mmcblk1 being mounted to both /media/sdcard/#UUID and /data/media

    detailed cmds use at your own risk

    preparing the sdcard, should only be needed once!

    first dosystemctl stop aliendalvik.service then follow this list

    1. umount /dev/mmcblk1p1 - unmount the card
    2. mkfs.btrfs -f /dev/mmcblk1 - format the card (no need for partition)
    3. mount -o subvolid=0 /dev/mmcblk1 /media/sdcard
    4. cd /media/sdcard
    5. btrfs subvolume create jolla - create folder called jolla
    6. btrfs subvolume create android - create folder called android
    7. btrfs subvolume list . - returns an ID for each subvolume
    8. btrfs subvolume set-default *ID for jolla* /media/sdcard/ - sets jolla to be mounted as default
    9. chown nemo:nemo jolla/ - add -R if needed
    10. chmod 775 jolla/
    11. chmod 777 android/
    12. cp -r -a -v /data/media/* /media/sdcard/android
    13. umount /dev/mmcblk1

    preparing the system

    1. create /etc/systemd/system/androidsdcard.service and fill with:

    #

    [Unit]
    Description=Mount SDCard btrfs subvolume for Android
    ConditionPathExists=/dev/mmcblk1
    ConditionPathIsDirectory=/data/media
    Requires=local-fs.target
    Before=aliendalvik.service
    After=local-fs.target mount-sd@mmcblk1.service
    BindsTo=mount-sd@mmcblk1.service
    
    [Service]
    Type=oneshot
    RemainAfterExit=yes
    ExecStart=/bin/mount -o subvol=android,compress,dirsync,noatime,users /dev/mmcblk1 /data/media
    ExecStop=/bin/sh/ -c 'systemctl stop aliendalvik.service;umount /data/media'
    
    [Install]
    WantedBy=local-fs.target aliendalvik.service
    
    • systemctl enable androidsdcard.service - the service file gets started every time aliendalvik is started and stops aliendalvik when it gets stopped, on boot it prevents aliendalvik from starting if it is not started yet but waits for the local-fs to be settled and actually having a mountpoint (due to the-vault only looking for the biggest mounted sdcard partition we have to wait for mount-sd too to have it read by the-vault first)

    for the future we only need to load the service file to its place and enable it, if something changes I will update the code

    For upgrading from previous version: the group and owner of the files have changed, stop aliendalvik.service and chown media_rw:media_rw -R /data/media/

    BACKUP TO SDCARD NOTICE: For copying backups to the sdcard you need to deactivate the service systemctl stop androidsdcard.service as the-vault does not account for other usecases than sdcards get mounted for nemo to /media/sdcard/($UUID). This only applies for jolla-settings of course you can tar ~/.vault to /media/sdcard/($UUID) yourself

    BACKUP TO SDCARD UPDATE: I updated the service file to inlcude After=local-fs.target mount-sd@mmcblk1.service, if you alter service files you need to remember to update the tree or it wont work (stop service, disable service, update file, systemctl daemon-reload, enable service; I am sure there is an easier way but I don't know it yet)

    How to: Format your uSD-Card to btrfs and share space with android

    Version: >=1.0.7.16

    This is no beginners guide, you need to know your way around! I try to make everything as foolproof as possible. This version does only apply to the SFOS release with the same version number!

    Understand what to do before you do!

    What I did to share the space of my uSD between nemo and android without getting duplicates with bind-mounts or any other hickup, read carefully and use at your own risk:

    1. format the whole usdcard (mmcblk1 not mmcblk1p1) to btrfs
    2. mount that volume (=0)
    3. create two subvolumes > jolla and android
    4. set the default volume to jolla (the default is what gets mounted when something calls mount /dev/mmcblk1)
    5. stop alien-dalvik and copy everything form /data/media to the new subvolume android (don't move the files, this way you have all basics alien-dalvik needs even after pulling the uSD)
    6. add a system.service to systemd that mounts and unmounts the subvolume for android as needed and honours aliendalvik.service The problems to solve are: aliendalvik fuse-mounts its /data/media to /home/nemo/android_storage so you need to make sure everything is mounted before that happens on boot, and stop aliendalvik when the sd gets pulled or the mount needs to be lifted for any other cause.
    7. reboot and wait for the device to settle, as soon as your jolla volume is mounted in /media/, you should see /dev/mmcblk1 being mounted to both /media/sdcard/#UUID and /data/media

    detailed cmds use at your own risk

    preparing the sdcard, should only be needed once!

    first dosystemctl stop aliendalvik.service then follow this list

    1. umount /dev/mmcblk1p1 - unmount the card
    2. mkfs.btrfs -f /dev/mmcblk1 - format the card (no need for partition)
    3. mount -o subvolid=0 /dev/mmcblk1 /media/sdcard
    4. cd /media/sdcard
    5. btrfs subvolume create jolla - create folder called jolla
    6. btrfs subvolume create android - create folder called android
    7. btrfs subvolume list . - returns an ID for each subvolume
    8. btrfs subvolume set-default *ID for jolla* /media/sdcard/ - sets jolla to be mounted as default
    9. chown nemo:nemo jolla/ - add -R if needed
    10. chmod 775 jolla/
    11. chmod 777 android/
    12. cp -r -a -v /data/media/* /media/sdcard/android
    13. cd ..
    14. umount /dev/mmcblk1

    preparing the system

      • create /etc/systemd/system/androidsdcard.service and fill with:

    #

    [Unit]
    Description=Mount SDCard btrfs subvolume for Android
    ConditionPathExists=/dev/mmcblk1
    ConditionPathIsDirectory=/data/media
    Requires=local-fs.target
    Before=aliendalvik.service
    After=local-fs.target mount-sd@mmcblk1.service
    BindsTo=mount-sd@mmcblk1.service
    
    [Service]
    Type=oneshot
    RemainAfterExit=yes
    ExecStart=/bin/mount -o subvol=android,compress,dirsync,noatime,users /dev/mmcblk1 /data/media
    ExecStop=/bin/sh/ -c 'systemctl stop aliendalvik.service;umount /data/media'
    
    [Install]
    WantedBy=local-fs.target aliendalvik.service
    
    • systemctl enable androidsdcard.service - the service file gets started every time aliendalvik is started and stops aliendalvik when it gets stopped, on boot it prevents aliendalvik from starting if it is not started yet but waits for the local-fs to be settled and actually having a mountpoint (due to the-vault only looking for the biggest mounted sdcard partition we have to wait for mount-sd too to have it read by the-vault first)

    for the future we only need to load the service file to its place and enable it, if something changes I will update the code

    For upgrading from previous version: the group and owner of the files have changed, stop aliendalvik.service and chown media_rw:media_rw -R /data/media/

    BACKUP TO SDCARD NOTICE: For copying backups to the sdcard you need to deactivate the service systemctl stop androidsdcard.service as the-vault does not account for other usecases than sdcards get mounted for nemo to /media/sdcard/($UUID). This only applies for jolla-settings of course you can tar ~/.vault to /media/sdcard/($UUID) yourself

    BACKUP TO SDCARD UPDATE: I updated the service file to inlcude After=local-fs.target mount-sd@mmcblk1.service, if you alter service files you need to remember to update the tree or it wont work (stop service, disable service, update file, systemctl daemon-reload, enable service; I am sure there is an easier way but I don't know it yet)

    How to: Format your uSD-Card to btrfs and share space with android

    Version: >=1.0.7.16=1.1.0.39

    This is no beginners guide, you need to know your way around! I try to make everything as foolproof as possible. This version does only apply to the SFOS release with the same version number!

    Understand what to do before you do!

    What I did to share the space of my uSD between nemo and android without getting duplicates with bind-mounts or any other hickup, read carefully and use at your own risk:

    1. format the whole usdcard (mmcblk1 not mmcblk1p1) to btrfs
    2. mount that volume (=0)
    3. create two subvolumes > jolla and android
    4. set the default volume to jolla (the default is what gets mounted when something calls mount /dev/mmcblk1)
    5. stop alien-dalvik and copy everything form /data/media to the new subvolume android (don't move the files, this way you have all basics alien-dalvik needs even after pulling the uSD)
    6. add a system.service to systemd that mounts and unmounts the subvolume for android as needed and honours aliendalvik.service The problems to solve are: aliendalvik fuse-mounts its /data/media to /home/nemo/android_storage so you need to make sure everything is mounted before that happens on boot, and stop aliendalvik when the sd gets pulled or the mount needs to be lifted for any other cause.
    7. reboot and wait for the device to settle, as soon as your jolla volume is mounted in /media/, you should see /dev/mmcblk1 being mounted to both /media/sdcard/#UUID and /data/media

    detailed cmds use at your own risk

    preparing the sdcard, should only be needed once!

    first dosystemctl stop aliendalvik.service then follow this list

    1. umount /dev/mmcblk1p1 - unmount the card
    2. mkfs.btrfs -f /dev/mmcblk1 - format the card (no need for partition)
    3. mount -o subvolid=0 /dev/mmcblk1 /media/sdcard
    4. cd /media/sdcard
    5. btrfs subvolume create jolla - create folder called jolla
    6. btrfs subvolume create android - create folder called android
    7. btrfs subvolume list . - returns an ID for each subvolume
    8. btrfs subvolume set-default *ID for jolla* /media/sdcard/ - sets jolla to be mounted as default
    9. chown nemo:nemo jolla/ - add -R if needed
    10. chmod 775 jolla/
    11. chmod 777 android/
    12. cp -r -a -v /data/media/* /media/sdcard/android
    13. cd ..
    14. umount /dev/mmcblk1

    preparing the system

    • create /etc/systemd/system/androidsdcard.service and fill with:

    #

    [Unit]
    Description=Mount SDCard btrfs subvolume for Android
    ConditionPathExists=/dev/mmcblk1
    ConditionPathIsDirectory=/data/media
    Requires=local-fs.target
    Before=aliendalvik.service
    After=local-fs.target mount-sd@mmcblk1.service
    BindsTo=mount-sd@mmcblk1.service
    
    [Service]
    Type=oneshot
    RemainAfterExit=yes
    ExecStart=/bin/mount -o subvol=android,compress,dirsync,noatime,users /dev/mmcblk1 /data/media
    ExecStop=/bin/sh/ -c 'systemctl stop aliendalvik.service;umount /data/media'
    
    [Install]
    WantedBy=local-fs.target aliendalvik.service
    
    • systemctl enable androidsdcard.service - the service file gets started every time aliendalvik is started and stops aliendalvik when it gets stopped, on boot it prevents aliendalvik from starting if it is not started yet but waits for the local-fs to be settled and actually having a mountpoint (due to the-vault only looking for the biggest mounted sdcard partition we have to wait for mount-sd too to have it read by the-vault first)

    for the future we only need to load the service file to its place and enable it, if something changes I will update the codecode, update9 went through without anything as the updates do not touch androidsdcard.service as of yet

    For upgrading from previous version: the group and owner of the files have changed, stop aliendalvik.service and chown media_rw:media_rw -R /data/media/

    BACKUP TO SDCARD NOTICE: For copying backups to the sdcard you need to deactivate the service systemctl stop androidsdcard.service as the-vault does not account for other usecases than sdcards get mounted for nemo to /media/sdcard/($UUID). This only applies for jolla-settings of course you can tar ~/.vault to /media/sdcard/($UUID) yourself

    BACKUP TO SDCARD UPDATE: I updated the service file to inlcude After=local-fs.target mount-sd@mmcblk1.service, if you alter service files you need to remember to update the tree or it wont work (stop service, disable service, update file, systemctl daemon-reload, enable service; I am sure there is an easier way but I don't know it yet)

    How to: Format your uSD-Card to btrfs and share space with android

    Version: =1.1.0.39

    This is no beginners guide, you need to know your way around! I try to make everything as foolproof as possible. This version does only apply to the SFOS release with the same version number!

    Understand what to do before you do!

    What I did to share the space of my uSD between nemo and android without getting duplicates with bind-mounts or any other hickup, read carefully and use at your own risk:

    1. format the whole usdcard (mmcblk1 not mmcblk1p1) to btrfs
    2. mount that volume (=0)
    3. create two subvolumes > jolla and android
    4. set the default volume to jolla (the default is what gets mounted when something calls mount /dev/mmcblk1)
    5. stop alien-dalvik and copy everything form /data/media to the new subvolume android (don't move the files, this way you have all basics alien-dalvik needs even after pulling the uSD)
    6. add a system.service to systemd that mounts and unmounts the subvolume for android as needed and honours aliendalvik.service The problems to solve are: aliendalvik fuse-mounts its /data/media to /home/nemo/android_storage so you need to make sure everything is mounted before that happens on boot, and stop aliendalvik when the sd gets pulled or the mount needs to be lifted for any other cause.
    7. reboot and wait for the device to settle, as soon as your jolla volume is mounted in /media/, you should see /dev/mmcblk1 being mounted to both /media/sdcard/#UUID and /data/media

    detailed cmds use at your own risk

    preparing the sdcard, should only be needed once!

    first dosystemctl stop aliendalvik.service then follow this list

    1. umount /dev/mmcblk1p1 - unmount the cardcard might be another /dev or even more than one
    2. mkfs.btrfs -f /dev/mmcblk1 - format the card (no need for partition)
    3. mount -o subvolid=0 /dev/mmcblk1 /media/sdcard
    4. cd /media/sdcard
    5. btrfs subvolume create jolla - create folder called jolla
    6. btrfs subvolume create android - create folder called android
    7. btrfs subvolume list . - returns an ID for each subvolume
    8. btrfs subvolume set-default *ID for jolla* /media/sdcard/ - sets jolla to be mounted as default
    9. chown nemo:nemo jolla/ - add -R if needed
    10. chmod 775 jolla/
    11. chmod 777 android/
    12. cp -r -a -v /data/media/* /media/sdcard/android
    13. cd ..
    14. umount /dev/mmcblk1

    preparing the system

    • create /etc/systemd/system/androidsdcard.service and fill with:

    #

    [Unit]
    Description=Mount SDCard btrfs subvolume for Android
    ConditionPathExists=/dev/mmcblk1
    ConditionPathIsDirectory=/data/media
    Requires=local-fs.target
    Before=aliendalvik.service
    After=local-fs.target mount-sd@mmcblk1.service
    BindsTo=mount-sd@mmcblk1.service
    
    [Service]
    Type=oneshot
    RemainAfterExit=yes
    ExecStart=/bin/mount -o subvol=android,compress,dirsync,noatime,users /dev/mmcblk1 /data/media
    ExecStop=/bin/sh/ -c 'systemctl stop aliendalvik.service;umount /data/media'
    
    [Install]
    WantedBy=local-fs.target aliendalvik.service
    
    • systemctl enable androidsdcard.service - the service file gets started every time aliendalvik is started and stops aliendalvik when it gets stopped, on boot it prevents aliendalvik from starting if it is not started yet but waits for the local-fs to be settled and actually having a mountpoint (due to the-vault only looking for the biggest mounted sdcard partition we have to wait for mount-sd too to have it read by the-vault first)

    for the future we only need to load the service file to its place and enable it, if something changes I will update the code, update9 went through without anything as the updates do not touch androidsdcard.service as of yet

    How to: Format your uSD-Card to btrfs and share space with android

    Version: =1.1.0.391.1.1.27

    This is no beginners guide, you need to know your way around! I try to make everything as foolproof as possible. This version does only apply to the SFOS release with the same version number!

    Understand what to do before you do!

    What I did to share the space of my uSD between nemo and android without getting duplicates with bind-mounts or any other hickup, read carefully and use at your own risk:

    1. format the whole usdcard (mmcblk1 not mmcblk1p1) to btrfs
    2. mount that volume (=0)
    3. create two subvolumes > jolla and android
    4. set the default volume to jolla (the default is what gets mounted when something calls mount /dev/mmcblk1)
    5. stop alien-dalvik and copy everything form /data/media to the new subvolume android (don't move the files, this way you have all basics alien-dalvik needs even after pulling the uSD)
    6. add a system.service to systemd that mounts and unmounts the subvolume for android as needed and honours aliendalvik.service The problems to solve are: aliendalvik fuse-mounts its /data/media to /home/nemo/android_storage so you need to make sure everything is mounted before that happens on boot, and stop aliendalvik when the sd gets pulled or the mount needs to be lifted for any other cause.
    7. reboot and wait for the device to settle, as soon as your jolla volume is mounted in /media/, you should see /dev/mmcblk1 being mounted to both /media/sdcard/#UUID and /data/media

    detailed cmds use at your own risk

    preparing the sdcard, should only be needed once!

    first dosystemctl stop aliendalvik.service then follow this list

    1. umount /dev/mmcblk1p1 - unmount the card might be another /dev or even more than one
    2. mkfs.btrfs -f /dev/mmcblk1 - format the card (no need for partition)
    3. mount -o subvolid=0 /dev/mmcblk1 /media/sdcard
    4. cd /media/sdcard
    5. btrfs subvolume create jolla - create folder called jolla
    6. btrfs subvolume create android - create folder called android
    7. btrfs subvolume list . - returns an ID for each subvolume
    8. btrfs subvolume set-default *ID for jolla* /media/sdcard/ - sets jolla to be mounted as default
    9. chown nemo:nemo jolla/ - add -R if needed
    10. chmod 775 jolla/
    11. chmod 777 android/
    12. cp -r -a -v /data/media/* /media/sdcard/android
    13. cd ..
    14. umount /dev/mmcblk1

    preparing the system

    • create /etc/systemd/system/androidsdcard.service and fill with:

    #

    [Unit]
    Description=Mount SDCard btrfs subvolume for Android
    ConditionPathExists=/dev/mmcblk1
    ConditionPathIsDirectory=/data/media
    Requires=local-fs.target
    Before=aliendalvik.service
    After=local-fs.target mount-sd@mmcblk1.service
    BindsTo=mount-sd@mmcblk1.service
    
    [Service]
    Type=oneshot
    RemainAfterExit=yes
    ExecStart=/bin/mount -o subvol=android,compress,dirsync,noatime,users /dev/mmcblk1 /data/media
    ExecStop=/bin/sh/ -c 'systemctl stop aliendalvik.service;umount /data/media'
    
    [Install]
    WantedBy=local-fs.target aliendalvik.service
    
    • systemctl enable androidsdcard.service - the service file gets started every time aliendalvik is started and stops aliendalvik when it gets stopped, on boot it prevents aliendalvik from starting if it is not started yet but waits for the local-fs to be settled and actually having a mountpoint (due to the-vault only looking for the biggest mounted sdcard partition we have to wait for mount-sd too to have it read by the-vault first)

    for the future we only need to load the service file to its place and enable it, if something changes I will update the code, update9 went through without anything as the updates do not touch androidsdcard.service as of yet

    How to: Format your uSD-Card to btrfs and share space with android

    Version: 1.1.1.27

    This is no beginners guide, you need to know your way around! I try to make everything as foolproof as possible. This version does only apply to the SFOS release with the same version number!

    Understand what to do before you do!

    What I did to share the space of my uSD between nemo and android without getting duplicates with bind-mounts or any other hickup, read carefully and use at your own risk:

    1. format the whole usdcard (mmcblk1 not mmcblk1p1) to btrfs
    2. mount that volume (=0)
    3. create two subvolumes > jolla and android
    4. set the default volume to jolla (the default is what gets mounted when something calls mount /dev/mmcblk1)
    5. stop alien-dalvik and copy everything form /data/media to the new subvolume android (don't move the files, this way you have all basics alien-dalvik needs even after pulling the uSD)
    6. add a system.service to systemd that mounts and unmounts the subvolume for android as needed and honours aliendalvik.service The problems to solve are: aliendalvik fuse-mounts its /data/media to /home/nemo/android_storage so you need to make sure everything is mounted before that happens on boot, and stop aliendalvik when the sd gets pulled or the mount needs to be lifted for any other cause.
    7. reboot and wait for the device to settle, as soon as your jolla volume is mounted in /media/, you should see /dev/mmcblk1 being mounted to both /media/sdcard/#UUID and /data/media

    detailed cmds use at your own risk

    preparing the sdcard, should only be needed once!

    first dosystemctl stop aliendalvik.service then follow this list

    1. umount /dev/mmcblk1p1 - unmount the card might be another /dev or even more than one
    2. mkfs.btrfs -f /dev/mmcblk1 mkfs.btrfs -O ^extref -f /dev/mmcblk1 - format the card (no need for partition)partition) - for now extref (this extends num of hardlinks available) needs to be disabled, even on the device
    3. mount -o subvolid=0 /dev/mmcblk1 /media/sdcard
    4. cd /media/sdcard
    5. btrfs subvolume create jolla - create folder called jolla
    6. btrfs subvolume create android - create folder called android
    7. btrfs subvolume list . - returns an ID for each subvolume
    8. btrfs subvolume set-default *ID for jolla* /media/sdcard/ - sets jolla to be mounted as default
    9. chown nemo:nemo jolla/ - add -R if needed
    10. chmod 775 jolla/
    11. chmod 777 android/
    12. cp -r -a -v /data/media/* /media/sdcard/android
    13. cd ..
    14. umount /dev/mmcblk1

    preparing the system

    • create /etc/systemd/system/androidsdcard.service and fill with:

    #

    [Unit]
    Description=Mount SDCard btrfs subvolume for Android
    ConditionPathExists=/dev/mmcblk1
    ConditionPathIsDirectory=/data/media
    Requires=local-fs.target
    Before=aliendalvik.service
    After=local-fs.target mount-sd@mmcblk1.service
    BindsTo=mount-sd@mmcblk1.service
    
    [Service]
    Type=oneshot
    RemainAfterExit=yes
    ExecStart=/bin/mount -o subvol=android,compress,dirsync,noatime,users /dev/mmcblk1 /data/media
    ExecStop=/bin/sh/ -c 'systemctl stop aliendalvik.service;umount /data/media'
    
    [Install]
    WantedBy=local-fs.target aliendalvik.service
    
    • systemctl enable androidsdcard.service - the service file gets started every time aliendalvik is started and stops aliendalvik when it gets stopped, on boot it prevents aliendalvik from starting if it is not started yet but waits for the local-fs to be settled and actually having a mountpoint (due to the-vault only looking for the biggest mounted sdcard partition we have to wait for mount-sd too to have it read by the-vault first)

    for the future we only need to load the service file to its place and enable it, if something changes I will update the code, update9 went through without anything as the updates do not touch androidsdcard.service as of yet

    How to: Format your uSD-Card to btrfs and share space with android

    Version: 1.1.1.27

    broken in >1.1.2, I will update as soon as I find out how to mount again - for now you need to stop aliendalvik.service & .path and make sure that it is defused then start androidsdcard.service or .mount


    This is no beginners guide, you need to know your way around! I try to make everything as foolproof as possible. This version does only apply to the SFOS release with the same version number!

    Understand what to do before you do!

    What I did to share the space of my uSD between nemo and android without getting duplicates with bind-mounts or any other hickup, read carefully and use at your own risk:

    1. format the whole usdcard (mmcblk1 not mmcblk1p1) to btrfs
    2. mount that volume (=0)
    3. create two subvolumes > jolla and android
    4. set the default volume to jolla (the default is what gets mounted when something calls mount /dev/mmcblk1)
    5. stop alien-dalvik and copy everything form /data/media to the new subvolume android (don't move the files, this way you have all basics alien-dalvik needs even after pulling the uSD)
    6. add a system.service to systemd that mounts and unmounts the subvolume for android as needed and honours aliendalvik.service The problems to solve are: aliendalvik fuse-mounts its /data/media to /home/nemo/android_storage so you need to make sure everything is mounted before that happens on boot, and stop aliendalvik when the sd gets pulled or the mount needs to be lifted for any other cause.
    7. reboot and wait for the device to settle, as soon as your jolla volume is mounted in /media/, you should see /dev/mmcblk1 being mounted to both /media/sdcard/#UUID and /data/media

    detailed cmds use at your own risk

    preparing the sdcard, should only be needed once!

    first dosystemctl stop aliendalvik.service then follow this list

    1. umount /dev/mmcblk1p1 - unmount the card might be another /dev or even more than one
    2. mkfs.btrfs -f /dev/mmcblk1 mkfs.btrfs -O ^extref -f /dev/mmcblk1 - format the card (no need for partition) - for now extref (this extends num of hardlinks available) needs to be disabled, even on the device
    3. mount -o subvolid=0 /dev/mmcblk1 /media/sdcard
    4. cd /media/sdcard
    5. btrfs subvolume create jolla - create folder called jolla
    6. btrfs subvolume create android - create folder called android
    7. btrfs subvolume list . - returns an ID for each subvolume
    8. btrfs subvolume set-default *ID for jolla* /media/sdcard/ - sets jolla to be mounted as default
    9. chown nemo:nemo jolla/ - add -R if needed
    10. chmod 775 jolla/
    11. chmod 777 android/
    12. cp -r -a -v /data/media/* /media/sdcard/android
    13. cd ..
    14. umount /dev/mmcblk1

    preparing the system

    • create /etc/systemd/system/androidsdcard.service and fill with:

    #

    [Unit]
    Description=Mount SDCard btrfs subvolume for Android
    ConditionPathExists=/dev/mmcblk1
    ConditionPathIsDirectory=/data/media
    Requires=local-fs.target
    Before=aliendalvik.service
    After=local-fs.target mount-sd@mmcblk1.service
    BindsTo=mount-sd@mmcblk1.service
    
    [Service]
    Type=oneshot
    RemainAfterExit=yes
    ExecStart=/bin/mount -o subvol=android,compress,dirsync,noatime,users /dev/mmcblk1 /data/media
    ExecStop=/bin/sh/ -c 'systemctl stop aliendalvik.service;umount /data/media'
    
    [Install]
    WantedBy=local-fs.target aliendalvik.service
    
    • systemctl enable androidsdcard.service - the service file gets started every time aliendalvik is started and stops aliendalvik when it gets stopped, on boot it prevents aliendalvik from starting if it is not started yet but waits for the local-fs to be settled and actually having a mountpoint (due to the-vault only looking for the biggest mounted sdcard partition we have to wait for mount-sd too to have it read by the-vault first)

    for the future we only need to load the service file to its place and enable it, if something changes I will update the code, update9 went through without anything as the updates do not touch androidsdcard.service as of yet

    How to: Format your uSD-Card to btrfs and share space with android

    Version: 1.1.1.27

    broken in >1.1.2, I will update as soon as I find out how to mount again - for now you need to stop aliendalvik.service & .path .path, stop androidsdcard.service or .mount and make sure that it is defused then start androidsdcard.service or .mountdefused


    This is no beginners guide, you need to know your way around! I try to make everything as foolproof as possible. This version does only apply to the SFOS release with the same version number!

    Understand what to do before you do!

    What I did to share the space of my uSD between nemo and android without getting duplicates with bind-mounts or any other hickup, read carefully and use at your own risk:

    1. format the whole usdcard (mmcblk1 not mmcblk1p1) to btrfs
    2. mount that volume (=0)
    3. create two subvolumes > jolla and android
    4. set the default volume to jolla (the default is what gets mounted when something calls mount /dev/mmcblk1)
    5. stop alien-dalvik and copy everything form /data/media to the new subvolume android (don't move the files, this way you have all basics alien-dalvik needs even after pulling the uSD)
    6. add a system.service to systemd that mounts and unmounts the subvolume for android as needed and honours aliendalvik.service The problems to solve are: aliendalvik fuse-mounts its /data/media to /home/nemo/android_storage so you need to make sure everything is mounted before that happens on boot, and stop aliendalvik when the sd gets pulled or the mount needs to be lifted for any other cause.
    7. reboot and wait for the device to settle, as soon as your jolla volume is mounted in /media/, you should see /dev/mmcblk1 being mounted to both /media/sdcard/#UUID and /data/media

    detailed cmds use at your own risk

    preparing the sdcard, should only be needed once!

    first dosystemctl stop aliendalvik.service then follow this list

    1. umount /dev/mmcblk1p1 - unmount the card might be another /dev or even more than one
    2. mkfs.btrfs -f /dev/mmcblk1 mkfs.btrfs -O ^extref -f /dev/mmcblk1 - format the card (no need for partition) - for now extref (this extends num of hardlinks available) needs to be disabled, even on the device
    3. mount -o subvolid=0 /dev/mmcblk1 /media/sdcard
    4. cd /media/sdcard
    5. btrfs subvolume create jolla - create folder called jolla
    6. btrfs subvolume create android - create folder called android
    7. btrfs subvolume list . - returns an ID for each subvolume
    8. btrfs subvolume set-default *ID for jolla* /media/sdcard/ - sets jolla to be mounted as default
    9. chown nemo:nemo jolla/ - add -R if needed
    10. chmod 775 jolla/
    11. chmod 777 android/
    12. cp -r -a -v /data/media/* /media/sdcard/android
    13. cd ..
    14. umount /dev/mmcblk1

    preparing the system

    • create /etc/systemd/system/androidsdcard.service and fill with:

    #

    [Unit]
    Description=Mount SDCard btrfs subvolume for Android
    ConditionPathExists=/dev/mmcblk1
    ConditionPathIsDirectory=/data/media
    Requires=local-fs.target
    Before=aliendalvik.service
    After=local-fs.target mount-sd@mmcblk1.service
    BindsTo=mount-sd@mmcblk1.service
    
    [Service]
    Type=oneshot
    RemainAfterExit=yes
    ExecStart=/bin/mount -o subvol=android,compress,dirsync,noatime,users /dev/mmcblk1 /data/media
    ExecStop=/bin/sh/ -c 'systemctl stop aliendalvik.service;umount /data/media'
    
    [Install]
    WantedBy=local-fs.target aliendalvik.service
    
    • systemctl enable androidsdcard.service - the service file gets started every time aliendalvik is started and stops aliendalvik when it gets stopped, on boot it prevents aliendalvik from starting if it is not started yet but waits for the local-fs to be settled and actually having a mountpoint (due to the-vault only looking for the biggest mounted sdcard partition we have to wait for mount-sd too to have it read by the-vault first)

    for the future we only need to load the service file to its place and enable it, if something changes I will update the code, update9 went through without anything as the updates do not touch androidsdcard.service as of yet

    How to: Format your uSD-Card to btrfs and share space with android

    Version: 1.1.1.27

    broken in >1.1.2, I will update as soon as I find out how to mount again - for now you need to stop aliendalvik.service & .path, stop androidsdcard.service or .mount and make sure that it defused


    This is no beginners guide, you need to know your way around! I try to make everything as foolproof as possible. This version does only apply to the SFOS release with the same version number!There are no warranties and for > 1.1.2 you need to alter dalvik files or follow the guide below how to circumvent it.

    Understand what to do before you do!

    What I did to share the space of my uSD between nemo and android without getting duplicates with bind-mounts or any other hickup, read carefully and use at your own risk:

    1. format the whole usdcard (mmcblk1 not mmcblk1p1) to btrfs
    2. mount that volume (=0)
    3. create two subvolumes > jolla and android
    4. set the default volume to jolla (the default is what gets mounted when something calls mount /dev/mmcblk1)
    5. stop alien-dalvik and copy everything form from /data/media to the new subvolume android (don't move the files, this way you have all basics alien-dalvik needs even after pulling the uSD)
    6. add a system.service to systemd that mounts and unmounts the subvolume for android as needed and honours aliendalvik.service The problems to solve are: aliendalvik fuse-mounts its /data/media to /home/nemo/android_storage so you need to make sure everything is mounted before that happens on boot, and stop aliendalvik when the sd gets pulled or the mount needs to be lifted for any other cause.
    7. reboot and wait for the device to settle, as soon as your jolla volume is mounted in /media/, you should see /dev/mmcblk1 being mounted to both /media/sdcard/#UUID and /data/media

    detailed cmds use at your own risk

    preparing the sdcard, should only be needed once!

    first dosystemctl stop aliendalvik.servicealiendalvik.service & systemctl stop aliendalvik.path then follow this list

    1. umount /dev/mmcblk1p1 - unmount the card might be another /dev or even more than one
    2. mkfs.btrfs -f /dev/mmcblk1 mkfs.btrfs -O ^extref -f /dev/mmcblk1 - format the card (no need for partition) - for now extref (this extends num of hardlinks available) needs to be disabled, even on the device
    3. mount -o subvolid=0 /dev/mmcblk1 /media/sdcard
    4. cd /media/sdcard
    5. btrfs subvolume create jolla - create folder called jolla
    6. btrfs subvolume create android - create folder called android
    7. btrfs subvolume list . - returns an ID for each subvolume
    8. btrfs subvolume set-default *ID for jolla* /media/sdcard/ - sets jolla to be mounted as default
    9. chown nemo:nemo jolla/ - add -R if needed
    10. chmod 775 jolla/
    11. chmod 777 android/
    12. cp -r -a -v /data/media/* /media/sdcard/android
    13. cd ..
    14. umount /dev/mmcblk1

    preparing the system

    • create (as in do create not a command) /etc/systemd/system/androidsdcard.service and fill with:

    #

    [Unit]
    Description=Mount SDCard btrfs subvolume for Android
    ConditionPathExists=/dev/mmcblk1
    ConditionPathIsDirectory=/data/media
    Requires=local-fs.target
    Before=aliendalvik.service
    After=local-fs.target mount-sd@mmcblk1.service
    BindsTo=mount-sd@mmcblk1.service
    
    [Service]
    Type=oneshot
    RemainAfterExit=yes
    ExecStart=/bin/mount -o subvol=android,compress,dirsync,noatime,users /dev/mmcblk1 /data/media
    ExecStop=/bin/sh/ -c 'systemctl stop aliendalvik.service;umount /data/media'
    
    [Install]
    WantedBy=local-fs.target aliendalvik.service
    
    • systemctl enable androidsdcard.service - the service file gets started every time aliendalvik is started and stops aliendalvik when it gets stopped, on boot it prevents aliendalvik from starting if it is not started yet but waits for the local-fs to be settled and actually having a mountpoint (due to the-vault only looking for the biggest mounted sdcard partition we have to wait for mount-sd too to have it read by the-vault first)

    for the future we only need to load the service file to its place and enable it, if something changes I will update the code, update9 went through without anything as the updates do not touch androidsdcard.service as of yet


    Version 1.1.2.x

    do everything just like for 1.1.1.27 and additionally move data form the bind section of alien.sh to its rbind section so it survives a reboot too.

    How to: Format your uSD-Card to btrfs and share space with android

    Version: 1.1.1.27


    This is no beginners guide, you need to know your way around! There are no warranties and for > 1.1.2 you need to alter dalvik files or follow the guide below how to circumvent it.

    Understand what to do before you do!

    What I did to share the space of my uSD between nemo and android without getting duplicates with bind-mounts or any other hickup, read carefully and use at your own risk:

    1. format the whole usdcard (mmcblk1 not mmcblk1p1) to btrfs
    2. mount that volume (=0)
    3. create two subvolumes > jolla and android
    4. set the default volume to jolla (the default is what gets mounted when something calls mount /dev/mmcblk1)
    5. stop alien-dalvik and copy everything from /data/media to the new subvolume android (don't move the files, this way you have all basics alien-dalvik needs even after pulling the uSD)
    6. add a system.service to systemd that mounts and unmounts the subvolume for android as needed and honours aliendalvik.service The problems to solve are: aliendalvik fuse-mounts its /data/media to /home/nemo/android_storage so you need to make sure everything is mounted before that happens on boot, and stop aliendalvik when the sd gets pulled or the mount needs to be lifted for any other cause.
    7. reboot and wait for the device to settle, as soon as your jolla volume is mounted in /media/, you should see /dev/mmcblk1 being mounted to both /media/sdcard/#UUID and /data/media

    detailed cmds use at your own risk

    preparing the sdcard, should only be needed once!

    first dosystemctl stop aliendalvik.service & systemctl stop aliendalvik.path then follow this list

    1. umount /dev/mmcblk1p1 - unmount the card might be another /dev or even more than one
    2. mkfs.btrfs -f /dev/mmcblk1 mkfs.btrfs -O ^extref -f /dev/mmcblk1 - format the card (no need for partition) - for now extref (this extends num of hardlinks available) needs to be disabled, even on the device
    3. mount -o subvolid=0 /dev/mmcblk1 /media/sdcard
    4. cd /media/sdcard
    5. btrfs subvolume create jolla - create folder called jolla
    6. btrfs subvolume create android - create folder called android
    7. btrfs subvolume list . - returns an ID for each subvolume
    8. btrfs subvolume set-default *ID for jolla* /media/sdcard/ - sets jolla to be mounted as default
    9. chown nemo:nemo jolla/ - add -R if needed
    10. chmod 775 jolla/
    11. chmod 777 android/
    12. cp -r -a -v /data/media/* /media/sdcard/android
    13. cd ..
    14. umount /dev/mmcblk1

    preparing the system

    • create (as in do create not a command) /etc/systemd/system/androidsdcard.service and fill with:

    #

    [Unit]
    Description=Mount SDCard btrfs subvolume for Android
    ConditionPathExists=/dev/mmcblk1
    ConditionPathIsDirectory=/data/media
    Requires=local-fs.target
    Before=aliendalvik.service
    After=local-fs.target mount-sd@mmcblk1.service
    BindsTo=mount-sd@mmcblk1.service
    
    [Service]
    Type=oneshot
    RemainAfterExit=yes
    ExecStart=/bin/mount -o subvol=android,compress,dirsync,noatime,users /dev/mmcblk1 /data/media
    ExecStop=/bin/sh/ -c 'systemctl stop aliendalvik.service;umount /data/media'
    
    [Install]
    WantedBy=local-fs.target aliendalvik.service
    
    • systemctl enable androidsdcard.service - the service file gets started every time aliendalvik is started and stops aliendalvik when it gets stopped, on boot it prevents aliendalvik from starting if it is not started yet but waits for the local-fs to be settled and actually having a mountpoint (due to the-vault only looking for the biggest mounted sdcard partition we have to wait for mount-sd too to have it read by the-vault first)

    for the future we only need to load the service file to its place and enable it, if something changes I will update the code, update9 went through without anything as the updates do not touch androidsdcard.service as of yet


    Version 1.1.2.x

    do everything just like for 1.1.1.27 and additionally move data form the bind section (line19) of alien.sh /opt/alien/system/script/alien.sh to its rbind section (line26) so it survives a reboot too.

    too. As always, you probably want to save the original file to alien.sh.bak before you start messing around!

    move the value [data] from section

    for d in bin sbin lib usr var etc tmp home vendor data; do
    if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
        echo "mount $ROOT/$d"
        mount --bind /$d $ROOT/$d
    fi
    done
    

    to

    for d in dev sys run; do 
    if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
        echo "mount $ROOT/$d"
        mount --rbind /$d $ROOT/$d
    fi
    done
    

    result looks like

    for d in bin sbin lib usr var etc tmp home vendor; do
    if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
        echo "mount $ROOT/$d"
        mount --bind /$d $ROOT/$d
    fi
    done
    
    for d in dev sys run data; do 
    if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
        echo "mount $ROOT/$d"
        mount --rbind /$d $ROOT/$d
    fi
    done
    

    How to: Format your uSD-Card to btrfs and share space with android

    Version: 1.1.1.27


    This is no beginners guide, you need to know your way around! There are no warranties and for > 1.1.2 you need to alter dalvik files or follow the guide below how to circumvent it.

    Understand what to do before you do!

    What I did to share the space of my uSD between nemo and android without getting duplicates with bind-mounts or any other hickup, read carefully and use at your own risk:

    1. format the whole usdcard (mmcblk1 not mmcblk1p1) to btrfs
    2. mount that volume (=0)
    3. create two subvolumes > jolla and android
    4. set the default volume to jolla (the default is what gets mounted when something calls mount /dev/mmcblk1)
    5. stop alien-dalvik and copy everything from /data/media to the new subvolume android (don't move the files, this way you have all basics alien-dalvik needs even after pulling the uSD)
    6. add a system.service to systemd that mounts and unmounts the subvolume for android as needed and honours aliendalvik.service The problems to solve are: aliendalvik fuse-mounts its /data/media to /home/nemo/android_storage so you need to make sure everything is mounted before that happens on boot, and stop aliendalvik when the sd gets pulled or the mount needs to be lifted for any other cause.
    7. reboot and wait for the device to settle, as soon as your jolla volume is mounted in /media/, you should see /dev/mmcblk1 being mounted to both /media/sdcard/#UUID and /data/media

    detailed cmds use at your own risk

    preparing the sdcard, should only be needed once!

    first dosystemctl stop aliendalvik.service & systemctl stop aliendalvik.path then follow this list

    1. umount /dev/mmcblk1p1 - unmount the card might be another /dev or even more than one
    2. mkfs.btrfs -f /dev/mmcblk1 mkfs.btrfs -O ^extref -f /dev/mmcblk1 - format the card (no need for partition) - for now extref (this extends num of hardlinks available) needs to be disabled, even on the device
    3. mount -o subvolid=0 /dev/mmcblk1 /media/sdcard
    4. cd /media/sdcard
    5. btrfs subvolume create jolla - create folder called jolla
    6. btrfs subvolume create android - create folder called android
    7. btrfs subvolume list . - returns an ID for each subvolume
    8. btrfs subvolume set-default *ID for jolla* /media/sdcard/ - sets jolla to be mounted as default
    9. chown nemo:nemo jolla/ - add -R if needed
    10. chmod 775 jolla/
    11. chmod 777 android/
    12. cp -r -a -v /data/media/* /media/sdcard/android
    13. cd ..
    14. umount /dev/mmcblk1

    preparing the system

    • create (as in do create not a command) /etc/systemd/system/androidsdcard.service and fill with:

    #

    [Unit]
    Description=Mount SDCard btrfs subvolume for Android
    ConditionPathExists=/dev/mmcblk1
    ConditionPathIsDirectory=/data/media
    Requires=local-fs.target
    Before=aliendalvik.service
    After=local-fs.target mount-sd@mmcblk1.service
    BindsTo=mount-sd@mmcblk1.service
    
    [Service]
    Type=oneshot
    RemainAfterExit=yes
    ExecStart=/bin/mount -o subvol=android,compress,dirsync,noatime,users /dev/mmcblk1 /data/media
    ExecStop=/bin/sh/ -c 'systemctl stop aliendalvik.service;umount /data/media'
    
    [Install]
    WantedBy=local-fs.target aliendalvik.service
    
    • systemctl enable androidsdcard.service - the service file gets started every time aliendalvik is started and stops aliendalvik when it gets stopped, on boot it prevents aliendalvik from starting if it is not started yet but waits for the local-fs to be settled and actually having a mountpoint (due to the-vault only looking for the biggest mounted sdcard partition we have to wait for mount-sd too to have it read by the-vault first)

    for the future we only need to load the service file to its place and enable it, if something changes I will update the code, update9 went through without anything as the updates do not touch androidsdcard.service as of yet


    Version 1.1.2.x

    do everything just like for 1.1.1.27 and additionally move data form the bind section (line19) of /opt/alien/system/script/alien.sh to its rbind section (line26) so it survives a reboot too. As always, you probably want to save the original file to alien.sh.bak before you start messing around!

    move the value [data] from section

    for d in bin sbin lib usr var etc tmp home vendor data; do
    if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
        echo "mount $ROOT/$d"
        mount --bind /$d $ROOT/$d
    fi
    done
    

    to

    for d in dev sys run; do 
    if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
        echo "mount $ROOT/$d"
        mount --rbind /$d $ROOT/$d
    fi
    done
    

    result looks like

    for d in bin sbin lib usr var etc tmp home vendor; do
    if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
        echo "mount $ROOT/$d"
        mount --bind /$d $ROOT/$d
    fi
    done
    
    for d in dev sys run data; do 
    if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
        echo "mount $ROOT/$d"
        mount --rbind /$d $ROOT/$d
    fi
    done
    

    Version 1.1.4.x

    please be aware that copying backup to uSD will stop working while aliendalvik is running and therefor the mount is active (you have to stop all of it to be able to restore from or save to uSD - TheVault has mismanagement, also MTP stopped working for me while the mount is active! do everything just like for 1.1.1.27 and additionally move data form the bind section (line19) of /opt/alien/system/script/alien.sh to its rbind section (line26) so it survives a reboot too. As always, you probably want to save the original file to alien.sh.bak before you start messing around!

    move the value [data] from section

    for d in bin sbin lib usr var etc tmp home vendor data; do
    if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
        echo "mount $ROOT/$d"
        mount --bind /$d $ROOT/$d
    fi
    done
    

    to

    for d in dev sys run media; do 
    if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
        echo "mount $ROOT/$d"
        mount --rbind /$d $ROOT/$d
    fi
    done
    

    result looks like

    for d in bin sbin lib usr var etc tmp home vendor; do
    if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
        echo "mount $ROOT/$d"
        mount --bind /$d $ROOT/$d
    fi
    done
    
    for d in dev sys run media data; do 
    if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
        echo "mount $ROOT/$d"
        mount --rbind /$d $ROOT/$d
    fi
    done
    

    How to: Format your uSD-Card to btrfs and share space with android

    UPDATE: As of 1.1.4 copy/recover backup (vault) from uSD stopped working with as it cannot handle having it bind-mount+not being the only subvolume available.

    MTP stopped working completely, tested Debian & Win7.

    Also a problem of proper handling of multi partition/volume uSD cards as is, stopping dalvik & unmounting the android subvolume makes it work though!.

    If you are OK with that go ahead reading this guide.

    Version: 1.1.1.27


    This is no beginners guide, you need to know your way around! There are no warranties and for > 1.1.2 you need to alter dalvik files or follow the guide below how to circumvent it.

    Understand what to do before you do!

    What I did to share the space of my uSD between nemo and android without getting duplicates with bind-mounts or any other hickup, read carefully and use at your own risk:

    1. format the whole usdcard (mmcblk1 not mmcblk1p1) to btrfs
    2. mount that volume (=0)
    3. create two subvolumes > jolla and android
    4. set the default volume to jolla (the default is what gets mounted when something calls mount /dev/mmcblk1)
    5. stop alien-dalvik and copy everything from /data/media to the new subvolume android (don't move the files, this way you have all basics alien-dalvik needs even after pulling the uSD)
    6. add a system.service to systemd that mounts and unmounts the subvolume for android as needed and honours aliendalvik.service The problems to solve are: aliendalvik fuse-mounts its /data/media to /home/nemo/android_storage so you need to make sure everything is mounted before that happens on boot, and stop aliendalvik when the sd gets pulled or the mount needs to be lifted for any other cause.
    7. reboot and wait for the device to settle, as soon as your jolla volume is mounted in /media/, you should see /dev/mmcblk1 being mounted to both /media/sdcard/#UUID and /data/media

    detailed cmds use at your own risk

    preparing the sdcard, should only be needed once!

    first dosystemctl stop aliendalvik.service & systemctl stop aliendalvik.path then follow this list

    1. umount /dev/mmcblk1p1 - unmount the card might be another /dev or even more than one
    2. mkfs.btrfs -f /dev/mmcblk1 mkfs.btrfs -O ^extref -f /dev/mmcblk1 - format the card (no need for partition) - for now extref (this extends num of hardlinks available) needs to be disabled, even on the device
    3. mount -o subvolid=0 /dev/mmcblk1 /media/sdcard
    4. cd /media/sdcard
    5. btrfs subvolume create jolla - create folder called jolla
    6. btrfs subvolume create android - create folder called android
    7. btrfs subvolume list . - returns an ID for each subvolume
    8. btrfs subvolume set-default *ID for jolla* /media/sdcard/ - sets jolla to be mounted as default
    9. chown nemo:nemo jolla/ - add -R if needed
    10. chmod 775 jolla/
    11. chmod 777 android/
    12. cp -r -a -v /data/media/* /media/sdcard/android
    13. cd ..
    14. umount /dev/mmcblk1

    preparing the system

    • create (as in do create not a command) /etc/systemd/system/androidsdcard.service and fill with:

    #

    [Unit]
    Description=Mount SDCard btrfs subvolume for Android
    ConditionPathExists=/dev/mmcblk1
    ConditionPathIsDirectory=/data/media
    Requires=local-fs.target
    Before=aliendalvik.service
    After=local-fs.target mount-sd@mmcblk1.service
    BindsTo=mount-sd@mmcblk1.service
    
    [Service]
    Type=oneshot
    RemainAfterExit=yes
    ExecStart=/bin/mount -o subvol=android,compress,dirsync,noatime,users /dev/mmcblk1 /data/media
    ExecStop=/bin/sh/ -c 'systemctl stop aliendalvik.service;umount /data/media'
    
    [Install]
    WantedBy=local-fs.target aliendalvik.service
    
    • systemctl enable androidsdcard.service - the service file gets started every time aliendalvik is started and stops aliendalvik when it gets stopped, on boot it prevents aliendalvik from starting if it is not started yet but waits for the local-fs to be settled and actually having a mountpoint (due to the-vault only looking for the biggest mounted sdcard partition we have to wait for mount-sd too to have it read by the-vault first)

    for the future we only need to load the service file to its place and enable it, if something changes I will update the code, update9 went through without anything as the updates do not touch androidsdcard.service as of yet


    Version 1.1.2.x

    do everything just like for 1.1.1.27 and additionally move data form the bind section (line19) of /opt/alien/system/script/alien.sh to its rbind section (line26) so it survives a reboot too. As always, you probably want to save the original file to alien.sh.bak before you start messing around!

    move the value [data] from section

    for d in bin sbin lib usr var etc tmp home vendor data; do
    if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
        echo "mount $ROOT/$d"
        mount --bind /$d $ROOT/$d
    fi
    done
    

    to

    for d in dev sys run; do 
    if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
        echo "mount $ROOT/$d"
        mount --rbind /$d $ROOT/$d
    fi
    done
    

    result looks like

    for d in bin sbin lib usr var etc tmp home vendor; do
    if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
        echo "mount $ROOT/$d"
        mount --bind /$d $ROOT/$d
    fi
    done
    
    for d in dev sys run data; do 
    if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
        echo "mount $ROOT/$d"
        mount --rbind /$d $ROOT/$d
    fi
    done
    

    Version 1.1.4.x

    please be aware that copying backup to uSD will stop working while aliendalvik is running and therefor the mount is active (you have to stop all of it to be able to restore from or save to uSD - TheVault has mismanagement, also MTP stopped working for me while the mount is active! do everything just like for 1.1.1.27 and additionally move data form the bind section (line19) of /opt/alien/system/script/alien.sh to its rbind section (line26) so it survives a reboot too. As always, you probably want to save the original file to alien.sh.bak before you start messing around!

    move the value [data] from section

    for d in bin sbin lib usr var etc tmp home vendor data; do
    if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
        echo "mount $ROOT/$d"
        mount --bind /$d $ROOT/$d
    fi
    done
    

    to

    for d in dev sys run media; do 
    if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
        echo "mount $ROOT/$d"
        mount --rbind /$d $ROOT/$d
    fi
    done
    

    result looks like

    for d in bin sbin lib usr var etc tmp home vendor; do
    if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
        echo "mount $ROOT/$d"
        mount --bind /$d $ROOT/$d
    fi
    done
    
    for d in dev sys run media data; do 
    if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
        echo "mount $ROOT/$d"
        mount --rbind /$d $ROOT/$d
    fi
    done
    

    How to: Format your uSD-Card to btrfs and share space with android

    UPDATE: As of 1.1.4 copy/recover backup (vault) from uSD stopped working with as it cannot handle having it bind-mount+not being the only subvolume available.

    MTP stopped working completely, tested Debian & Win7.

    Also a problem of proper handling of multi partition/volume uSD cards as is, stopping dalvik & unmounting the android subvolume makes it work though!.

    If you are OK with that go ahead reading this guide.

    Version: 1.1.1.27


    This is no beginners guide, you need to know your way around! There are no warranties and for > 1.1.2 you need to alter dalvik files or follow the guide below how to circumvent it.

    Understand what to do before you do!

    What I did to share the space of my uSD between nemo and android without getting duplicates with bind-mounts or any other hickup, read carefully and use at your own risk:

    1. format the whole usdcard (mmcblk1 not mmcblk1p1) to btrfs
    2. mount that volume (=0)
    3. create two subvolumes > jolla and android
    4. set the default volume to jolla (the default is what gets mounted when something calls mount /dev/mmcblk1)
    5. stop alien-dalvik and copy everything from /data/media to the new subvolume android (don't move the files, this way you have all basics alien-dalvik needs even after pulling the uSD)
    6. add a system.service to systemd that mounts and unmounts the subvolume for android as needed and honours aliendalvik.service The problems to solve are: aliendalvik fuse-mounts its /data/media to /home/nemo/android_storage so you need to make sure everything is mounted before that happens on boot, and stop aliendalvik when the sd gets pulled or the mount needs to be lifted for any other cause.
    7. reboot and wait for the device to settle, as soon as your jolla volume is mounted in /media/, you should see /dev/mmcblk1 being mounted to both /media/sdcard/#UUID and /data/media

    detailed cmds use at your own risk

    preparing the sdcard, should only be needed once!

    first dosystemctl stop aliendalvik.service & systemctl stop aliendalvik.path then follow this list

    1. umount /dev/mmcblk1p1 - unmount the card might be another /dev or even more than one
    2. mkfs.btrfs -f /dev/mmcblk1 mkfs.btrfs -O ^extref -f /dev/mmcblk1 - format the card (no need for partition) - for now extref (this extends num of hardlinks available) needs to be disabled, even on the device
    3. mount -o subvolid=0 /dev/mmcblk1 /media/sdcard
    4. cd /media/sdcard
    5. btrfs subvolume create jolla - create folder called jolla
    6. btrfs subvolume create android - create folder called android
    7. btrfs subvolume list . - returns an ID for each subvolume
    8. btrfs subvolume set-default *ID for jolla* /media/sdcard/ - sets jolla to be mounted as default
    9. chown nemo:nemo jolla/ - add -R if needed
    10. chmod 775 jolla/
    11. chmod 777 android/
    12. cp -r -a -v /data/media/* /media/sdcard/android
    13. cd ..
    14. umount /dev/mmcblk1

    preparing the system

    • create (as in do create not a command) /etc/systemd/system/androidsdcard.service and fill with:

    #

    [Unit]
    Description=Mount SDCard btrfs subvolume for Android
    ConditionPathExists=/dev/mmcblk1
    ConditionPathIsDirectory=/data/media
    Requires=local-fs.target
    Before=aliendalvik.service
    After=local-fs.target mount-sd@mmcblk1.service
    BindsTo=mount-sd@mmcblk1.service
    
    [Service]
    Type=oneshot
    RemainAfterExit=yes
    ExecStart=/bin/mount -o subvol=android,compress,dirsync,noatime,users /dev/mmcblk1 /data/media
    ExecStop=/bin/sh/ -c 'systemctl stop aliendalvik.service;umount /data/media'
    
    [Install]
    WantedBy=local-fs.target aliendalvik.service
    
    • systemctl enable androidsdcard.service - the service file gets started every time aliendalvik is started and stops aliendalvik when it gets stopped, on boot it prevents aliendalvik from starting if it is not started yet but waits for the local-fs to be settled and actually having a mountpoint (due to the-vault only looking for the biggest mounted sdcard partition we have to wait for mount-sd too to have it read by the-vault first)

    for the future we only need to load the service file to its place and enable it, if something changes I will update the code, update9 went through without anything as the updates do not touch androidsdcard.service as of yet


    Version 1.1.2.x

    do everything just like for 1.1.1.27 and additionally move data form the bind section (line19) of /opt/alien/system/script/alien.sh to its rbind section (line26) so it survives a reboot too. As always, you probably want to save the original file to alien.sh.bak before you start messing around!

    move the value [data] from section

    for d in bin sbin lib usr var etc tmp home vendor data; do
    if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
        echo "mount $ROOT/$d"
        mount --bind /$d $ROOT/$d
    fi
    done
    

    to

    for d in dev sys run; do 
    if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
        echo "mount $ROOT/$d"
        mount --rbind /$d $ROOT/$d
    fi
    done
    

    result looks like

    for d in bin sbin lib usr var etc tmp home vendor; do
    if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
        echo "mount $ROOT/$d"
        mount --bind /$d $ROOT/$d
    fi
    done
    
    for d in dev sys run data; do 
    if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
        echo "mount $ROOT/$d"
        mount --rbind /$d $ROOT/$d
    fi
    done
    

    Version 1.1.4.x>1.1.4.x

    please be aware that copying backup to uSD will stop working while aliendalvik is running and therefor the mount is active (you have to stop all of it to be able to restore from or save to uSD - TheVault has mismanagement, also MTP stopped working for me while the mount is active! do everything just like for 1.1.1.27 and additionally move data form the bind section (line19) of /opt/alien/system/script/alien.sh to its rbind section (line26) so it survives a reboot too. As always, you probably want to save the original file to alien.sh.bak before you start messing around!

    move the value [data] from section

    for d in bin sbin lib usr var etc tmp home vendor data; do
    if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
        echo "mount $ROOT/$d"
        mount --bind /$d $ROOT/$d
    fi
    done
    

    to

    for d in dev sys run media; do 
    if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
        echo "mount $ROOT/$d"
        mount --rbind /$d $ROOT/$d
    fi
    done
    

    result looks like

    for d in bin sbin lib usr var etc tmp home vendor; do
    if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
        echo "mount $ROOT/$d"
        mount --bind /$d $ROOT/$d
    fi
    done
    
    for d in dev sys run media data; do 
    if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
        echo "mount $ROOT/$d"
        mount --rbind /$d $ROOT/$d
    fi
    done
    

    How to: Format your uSD-Card to btrfs and share space with android

    UPDATE:Update: Changed from service to mount. For upgrades it is probably better to disable this hack first and enable it after the upgrade went through (everything was running fine but sailfish-utilities failed stopping android-support, guess I should upgrade to latest release before I role back after a factory-reset, just to give you a heads up - no need to do anything fancy, after upgrading I disabled and then re-enabled the mount and everything is fine again). I also changed the how-to to reflect newest available only, if you need old stuff look into the question's history.

    As of 1.1.4 copy/recover backup (vault) from uSD stopped working with as it cannot handle having it bind-mount+not being the only subvolume available.

    MTP stopped working completely, tested Debian & Win7.

    Also a problem of proper handling of multi partition/volume uSD cards as is, stopping dalvik & unmounting the android subvolume makes it work though!.

    If you are OK with that go ahead reading this guide.

    Version: 1.1.1.27>1.1.4.x


    This is no beginners guide, you need to know your way around! There are no warranties and for > 1.1.21.1.4 you need to alter dalvik files or follow the guide below how to circumvent it. Old stuff in question's history

    Understand what to do before you do!

    What I did to share the space of my uSD between nemo and android without getting duplicates with bind-mounts or any other hickup, read carefully and use at your own risk:

    1. format the whole usdcard (mmcblk1 not mmcblk1p1) to btrfs
    2. mount that volume (=0)
    3. create two subvolumes > jolla and android
    4. set the default volume to jolla (the default is what gets mounted when something calls mount /dev/mmcblk1)
    5. stop alien-dalvik and copy everything from /data/media to the new subvolume android (don't move the files, this way you have all basics alien-dalvik needs even after pulling the uSD)
    6. add a system.service to systemd that mounts and unmounts the subvolume for android as needed and honours aliendalvik.service The problems to solve are: aliendalvik fuse-mounts its /data/media to /home/nemo/android_storage so you need to make sure everything is mounted before that happens on boot, and stop aliendalvik when the sd gets pulled or the mount needs to be lifted for any other cause.
    7. reboot and wait for the device to settle, as soon as your jolla volume is mounted in /media/, you should see /dev/mmcblk1 being mounted to both /media/sdcard/#UUID and /data/media

    detailed cmds use at your own risk

    preparing the sdcard, should only be needed once!

    first dosystemctl stop aliendalvik.service & systemctl stop aliendalvik.path then follow this list

    1. umount /dev/mmcblk1p1 - unmount the card might be another /dev or even more than one
    2. mkfs.btrfs -f /dev/mmcblk1 mkfs.btrfs -O ^extref -f /dev/mmcblk1 - format the card (no need for partition) - for now extref (this extends num of hardlinks available) needs to be disabled, even on the device
    3. mount -o subvolid=0 /dev/mmcblk1 /media/sdcard
    4. cd /media/sdcard
    5. btrfs subvolume create jolla - create folder called jolla
    6. btrfs subvolume create android - create folder called android
    7. btrfs subvolume list . - returns an ID for each subvolume
    8. btrfs subvolume set-default *ID for jolla* /media/sdcard/ - sets jolla to be mounted as default
    9. chown nemo:nemo jolla/ - add -R if needed
    10. chmod 775 jolla/
    11. chmod 777 android/
    12. cp -r -a -v /data/media/* /media/sdcard/android
    13. cd ..
    14. umount /dev/mmcblk1

    preparing the system

    • create (as in do create not a command) /etc/systemd/system/androidsdcard.service/etc/systemd/system/data-media.mount and fill with:

    #

    [Unit]
    Description=Mount SDCard Description=SD card btrfs subvolume for Android
    ConditionPathExists=/dev/mmcblk1
    ConditionPathExists=!/tmp/os-update-running
    ConditionPathIsDirectory=/data/media
    Requires=local-fs.target
    Requires=local-fs.target systemd-user-session.service
    Before=aliendalvik.service
    After=local-fs.target mount-sd@mmcblk1.service
    After=mount-sd@mmcblk1.service
    BindsTo=mount-sd@mmcblk1.service
    
    [Service]
    Type=oneshot
    RemainAfterExit=yes
    ExecStart=/bin/mount -o subvol=android,compress,dirsync,noatime,users /dev/mmcblk1 /data/media
    ExecStop=/bin/sh/ -c 'systemctl stop aliendalvik.service;umount /data/media'
    [Mount]
    What=/dev/mmcblk1
    Where=/data/media
    Options=subvol=android,compress,dirsync,noatime,users
    
    [Install]
    WantedBy=local-fs.target aliendalvik.service
    
    • Second, create /etc/systemd/system/aliendalvik.service.d/sdcard.conf file:

      [Unit] 
      PartOf=data-media.mount
      

      Then run systemctl enable androidsdcard.service - the service data-media.mount.

      • the mount file gets started every time aliendalvik is started and stops aliendalvik when it gets stopped, on boot it prevents aliendalvik from starting if it is not started yet but waits for the local-fs to be settled and actually having a mountpoint (due to the-vault only looking for the biggest mounted sdcard partition we have to wait for mount-sd too to have it read by the-vault first)mountpoint

      for the future we only need to load the service file to its place and enable it, if something changes I will update the code, update9 upgrade went through without anything (see first line for updates) as the updates do not touch androidsdcard.service data-media.mount as of yet


      Steps since Version 1.1.2.x

      do everything just like for 1.1.1.27 and additionally 1.1.4.x (just looks different in 1.1.2.x): move data form the bind section (line19) of /opt/alien/system/script/alien.sh to its rbind section (line26) so it survives a reboot too. As always, you probably want to save the original file to alien.sh.bak before you start messing around!

      move the value [data] from section

      for d in bin sbin lib usr var etc tmp home vendor data; do
      if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
          echo "mount $ROOT/$d"
          mount --bind /$d $ROOT/$d
      fi
      done
      

      to

      for d in dev sys run; run media; do 
      if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
          echo "mount $ROOT/$d"
          mount --rbind /$d $ROOT/$d
      fi
      done
      

      result looks like

      for d in bin sbin lib usr var etc tmp home vendor; do
      if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
          echo "mount $ROOT/$d"
          mount --bind /$d $ROOT/$d
      fi
      done
      
      for d in dev sys run media data; do 
      if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
          echo "mount $ROOT/$d"
          mount --rbind /$d $ROOT/$d
      fi
      done
      

      Version >1.1.4.x

      please be aware that copying backup to uSD will stop working while aliendalvik is running and therefor the mount is active (you have to stop all of it to be able to restore from or save to uSD - TheVault has mismanagement, also MTP stopped working for me while the mount is active! do everything just like for 1.1.1.27 and additionally move data form the bind section (line19) of /opt/alien/system/script/alien.sh to its rbind section (line26) so it survives a reboot too. As always, you probably want to save the original file to alien.sh.bak before you start messing around!

      move the value [data] from section

      for d in bin sbin lib usr var etc tmp home vendor data; do
      if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
          echo "mount $ROOT/$d"
          mount --bind /$d $ROOT/$d
      fi
      done
      

      to

      for d in dev sys run media; do 
      if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
          echo "mount $ROOT/$d"
          mount --rbind /$d $ROOT/$d
      fi
      done
      

      result looks like

      for d in bin sbin lib usr var etc tmp home vendor; do
      if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
          echo "mount $ROOT/$d"
          mount --bind /$d $ROOT/$d
      fi
      done
      
      for d in dev sys run media data; do 
      if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
          echo "mount $ROOT/$d"
          mount --rbind /$d $ROOT/$d
      fi
      done
      

    How to: Format your uSD-Card to btrfs and share space with android

    Update: Changed from service to mount. For upgrades it is probably better to disable this hack first and enable it after the upgrade went through (everything was running fine but sailfish-utilities failed stopping android-support, guess I should upgrade to latest release before I role back after a factory-reset, just to give you a heads up - no need to do anything fancy, after upgrading I disabled and then re-enabled the mount and everything is fine again). I also changed the how-to to reflect newest available only, if you need old stuff look into the question's history.

    As of 1.1.4 copy/recover backup (vault) from uSD stopped working with as it cannot handle having it bind-mount+not being the only subvolume available.

    If you are OK with that go ahead reading this guide.

    Version: >1.1.4.x


    This is no beginners guide, you need to know your way around! There are no warranties and for > 1.1.4 you need to alter dalvik files or follow the guide below how to circumvent it. Old stuff in question's history

    Understand what to do before you do!

    What I did to share the space of my uSD between nemo and android without getting duplicates with bind-mounts or any other hickup, read carefully and use at your own risk:

    1. format the whole usdcard (mmcblk1 not mmcblk1p1) to btrfs
    2. mount that volume (=0)
    3. create two subvolumes > jolla and android
    4. set the default volume to jolla (the default is what gets mounted when something calls mount /dev/mmcblk1)
    5. stop alien-dalvik and copy everything from /data/media to the new subvolume android (don't move the files, this way you have all basics alien-dalvik needs even after pulling the uSD)
    6. add a system.service to systemd that mounts and unmounts the subvolume for android as needed and honours aliendalvik.service The problems to solve are: aliendalvik fuse-mounts its /data/media to /home/nemo/android_storage so you need to make sure everything is mounted before that happens on boot, and stop aliendalvik when the sd gets pulled or the mount needs to be lifted for any other cause.
    7. reboot and wait for the device to settle, as soon as your jolla volume is mounted in /media/, you should see /dev/mmcblk1 being mounted to both /media/sdcard/#UUID and /data/media

    detailed cmds use at your own risk

    preparing the sdcard, should only be needed once!

    first dosystemctl stop aliendalvik.service & systemctl stop aliendalvik.path then follow this list

    1. umount /dev/mmcblk1p1 - unmount the card might be another /dev or even more than one
    2. mkfs.btrfs -f /dev/mmcblk1 mkfs.btrfs -O ^extref -f /dev/mmcblk1 - format the card (no need for partition) - for now extref (this extends num of hardlinks available) needs to be disabled, even on the device
    3. mount -o subvolid=0 /dev/mmcblk1 /media/sdcard
    4. cd /media/sdcard
    5. btrfs subvolume create jolla - create folder called jolla
    6. btrfs subvolume create android - create folder called android
    7. btrfs subvolume list . - returns an ID for each subvolume
    8. btrfs subvolume set-default *ID for jolla* /media/sdcard/ - sets jolla to be mounted as default
    9. chown nemo:nemo jolla/ - add -R if needed
    10. chmod 775 jolla/
    11. chmod 777 android/
    12. cp -r -a -v /data/media/* /media/sdcard/android
    13. cd ..
    14. umount /dev/mmcblk1

    preparing the system

    • create (as in do create not a command) /etc/systemd/system/data-media.mount and fill with:

    #

    [Unit]
    Description=SD card btrfs subvolume for Android
    ConditionPathExists=/dev/mmcblk1
    ConditionPathExists=!/tmp/os-update-running
    ConditionPathIsDirectory=/data/media
    Requires=local-fs.target systemd-user-session.service
    systemd-user-sessions.service
    Before=aliendalvik.service
    After=mount-sd@mmcblk1.service
    BindsTo=mount-sd@mmcblk1.service
    
    [Mount]
    What=/dev/mmcblk1
    Where=/data/media
    Options=subvol=android,compress,dirsync,noatime,users
    
    [Install]
    WantedBy=local-fs.target aliendalvik.service
    

    Second, create /etc/systemd/system/aliendalvik.service.d/sdcard.conf file:

    [Unit] 
    PartOf=data-media.mount
    

    Then run systemctl enable data-media.mount.

    • the mount file gets started every time aliendalvik is started and stops aliendalvik when it gets stopped, on boot it prevents aliendalvik from starting if it is not started yet but waits for the local-fs to be settled and actually having a mountpoint

    for the future we only need to load the service file to its place and enable it, if something changes I will update the code, upgrade went through without anything (see first line for updates) as the updates do not touch data-media.mount as of yet


    Steps since Version 1.1.4.x (just looks different in 1.1.2.x): move data form the bind section (line19) of /opt/alien/system/script/alien.sh to its rbind section (line26) so it survives a reboot too. As always, you probably want to save the original file to alien.sh.bak before you start messing around!

    move the value [data] from section

    for d in bin sbin lib usr var etc tmp home vendor data; do
    if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
        echo "mount $ROOT/$d"
        mount --bind /$d $ROOT/$d
    fi
    done
    

    to

    for d in dev sys run media; do 
    if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
        echo "mount $ROOT/$d"
        mount --rbind /$d $ROOT/$d
    fi
    done
    

    result looks like

    for d in bin sbin lib usr var etc tmp home vendor; do
    if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
        echo "mount $ROOT/$d"
        mount --bind /$d $ROOT/$d
    fi
    done
    
    for d in dev sys run media data; do 
    if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
        echo "mount $ROOT/$d"
        mount --rbind /$d $ROOT/$d
    fi
    done
    

    How to: Format your uSD-Card to btrfs and share space with android

    Update: Changed from service to mount. For upgrades upgrades it is probably better to disable this hack first and enable it after the upgrade went through (everything was running fine but sailfish-utilities failed stopping android-support, guess I should upgrade to latest release before I role back after a factory-reset, just to give you a heads up - no need to do anything fancy, after upgrading I disabled and then re-enabled the mount and everything is fine again). I also changed the how-to to reflect newest available only, if you need old stuff look into the question's history.

    As of 1.1.4 >1.1.4 copy/recover backup (vault) from uSD stopped working with as it cannot handle having it bind-mount+not being the only subvolume available.

    If you are OK with that go ahead reading this guide.

    Version: >1.1.4.x


    This is no beginners guide, you need to know your way around! There are no warranties and for > 1.1.4 you need to alter dalvik files or follow the guide below how to circumvent it. Old stuff in question's history

    Understand what to do before you do!

    What I did to share the space of my uSD between nemo and android without getting duplicates with bind-mounts or any other hickup, read carefully and use at your own risk:

    1. format the whole usdcard (mmcblk1 not mmcblk1p1) to btrfs
    2. mount that volume (=0)
    3. create two subvolumes > jolla and android
    4. set the default volume to jolla (the default is what gets mounted when something calls mount /dev/mmcblk1)
    5. stop alien-dalvik and copy everything from /data/media to the new subvolume android (don't move the files, this way you have all basics alien-dalvik needs even after pulling the uSD)
    6. add a system.service to systemd that mounts and unmounts the subvolume for android as needed and honours aliendalvik.service The problems to solve are: aliendalvik fuse-mounts its /data/media to /home/nemo/android_storage so you need to make sure everything is mounted before that happens on boot, and stop aliendalvik when the sd gets pulled or the mount needs to be lifted for any other cause.
    7. reboot and wait for the device to settle, as soon as your jolla volume is mounted in /media/, you should see /dev/mmcblk1 being mounted to both /media/sdcard/#UUID and /data/media

    detailed cmds use at your own risk

    preparing the sdcard, should only be needed once!

    first dosystemctl stop aliendalvik.service & systemctl stop aliendalvik.path then follow this list

    1. umount /dev/mmcblk1p1 - unmount the card might be another /dev or even more than one
    2. mkfs.btrfs -f /dev/mmcblk1 mkfs.btrfs -O ^extref -f /dev/mmcblk1 - format the card (no need for partition) - for now extref (this extends num of hardlinks available) needs to be disabled, even on the device
    3. mount -o subvolid=0 /dev/mmcblk1 /media/sdcard
    4. cd /media/sdcard
    5. btrfs subvolume create jolla - create folder called jolla
    6. btrfs subvolume create android - create folder called android
    7. btrfs subvolume list . - returns an ID for each subvolume
    8. btrfs subvolume set-default *ID for jolla* /media/sdcard/ - sets jolla to be mounted as default
    9. chown nemo:nemo jolla/ - add -R if needed
    10. chmod 775 jolla/
    11. chmod 777 android/
    12. cp -r -a -v /data/media/* /media/sdcard/android
    13. cd ..
    14. umount /dev/mmcblk1

    preparing the system

    • create (as in do create not a command) /etc/systemd/system/data-media.mount and fill with:

    #

    [Unit]
    Description=SD card btrfs subvolume for Android
    ConditionPathExists=/dev/mmcblk1
    ConditionPathExists=!/tmp/os-update-running
    ConditionPathIsDirectory=/data/media
    Requires=local-fs.target systemd-user-sessions.service
    Before=aliendalvik.service
    After=mount-sd@mmcblk1.service
    BindsTo=mount-sd@mmcblk1.service
    
    [Mount]
    What=/dev/mmcblk1
    Where=/data/media
    Options=subvol=android,compress,dirsync,noatime,users
    
    [Install]
    WantedBy=local-fs.target aliendalvik.service
    

    Second, create /etc/systemd/system/aliendalvik.service.d/sdcard.conf file:

    [Unit] 
    PartOf=data-media.mount
    

    Then run systemctl enable data-media.mount.

    • the mount file gets started every time aliendalvik is started and stops aliendalvik when it gets stopped, on boot it prevents aliendalvik from starting if it is not started yet but waits for the local-fs to be settled and actually having a mountpoint

    for the future we only need to load the service file to its place and enable it, if something changes I will update the code, upgrade went through without anything (see first line for updates) as the updates do not touch data-media.mount as of yet


    Steps since Version 1.1.4.x (just looks different in 1.1.2.x): move data form the bind section (line19) of /opt/alien/system/script/alien.sh to its rbind section (line26) so it survives a reboot too. As always, you probably want to save the original file to alien.sh.bak before you start messing around!

    move the value [data] from section

    for d in bin sbin lib usr var etc tmp home vendor data; do
    if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
        echo "mount $ROOT/$d"
        mount --bind /$d $ROOT/$d
    fi
    done
    

    to

    for d in dev sys run media; do 
    if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
        echo "mount $ROOT/$d"
        mount --rbind /$d $ROOT/$d
    fi
    done
    

    result looks like

    for d in bin sbin lib usr var etc tmp home vendor; do
    if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
        echo "mount $ROOT/$d"
        mount --bind /$d $ROOT/$d
    fi
    done
    
    for d in dev sys run media data; do 
    if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
        echo "mount $ROOT/$d"
        mount --rbind /$d $ROOT/$d
    fi
    done
    

    How to: Format your uSD-Card to btrfs and share space with android

    Update: changes of chrooting in 1.1.7 makes altering alien scripts obsolete, do not alter any files after upgrade, just re-enable the .mount and you should be good to go

    Changed from service to mount. For upgrades it is probably better to disable this hack first and enable it after the upgrade went through (everything was running fine but sailfish-utilities failed stopping android-support, guess I should upgrade to latest release before I role back after a factory-reset, just to give you a heads up - no need to do anything fancy, after upgrading I disabled and then re-enabled the mount and everything is fine again). I also changed the how-to to reflect newest available only, if you need old stuff look into the question's history.

    As of >1.1.4 copy/recover backup (vault) from uSD stopped working with as it cannot handle having it bind-mount+not being the only subvolume available.

    If you are OK with that go ahead reading this guide.

    Version: >1.1.4.x


    This is no beginners guide, you need to know your way around! There are no warranties and for > 1.1.4 you need to alter dalvik files or follow the guide below how to circumvent it. Old stuff in question's history

    Understand what to do before you do!

    What I did to share the space of my uSD between nemo and android without getting duplicates with bind-mounts or any other hickup, read carefully and use at your own risk:

    1. format the whole usdcard (mmcblk1 not mmcblk1p1) to btrfs
    2. mount that volume (=0)
    3. create two subvolumes > jolla and android
    4. set the default volume to jolla (the default is what gets mounted when something calls mount /dev/mmcblk1)
    5. stop alien-dalvik and copy everything from /data/media to the new subvolume android (don't move the files, this way you have all basics alien-dalvik needs even after pulling the uSD)
    6. add a system.service to systemd that mounts and unmounts the subvolume for android as needed and honours aliendalvik.service The problems to solve are: aliendalvik fuse-mounts its /data/media to /home/nemo/android_storage so you need to make sure everything is mounted before that happens on boot, and stop aliendalvik when the sd gets pulled or the mount needs to be lifted for any other cause.
    7. reboot and wait for the device to settle, as soon as your jolla volume is mounted in /media/, you should see /dev/mmcblk1 being mounted to both /media/sdcard/#UUID and /data/media

    detailed cmds use at your own risk

    preparing the sdcard, should only be needed once!

    first dosystemctl stop aliendalvik.service & systemctl stop aliendalvik.path then follow this list

    1. umount /dev/mmcblk1p1 - unmount the card might be another /dev or even more than one
    2. mkfs.btrfs -f /dev/mmcblk1 mkfs.btrfs -O ^extref -f /dev/mmcblk1 - format the card (no need for partition) - for now extref (this extends num of hardlinks available) needs to be disabled, even on the device
    3. mount -o subvolid=0 /dev/mmcblk1 /media/sdcard
    4. cd /media/sdcard
    5. btrfs subvolume create jolla - create folder called jolla
    6. btrfs subvolume create android - create folder called android
    7. btrfs subvolume list . - returns an ID for each subvolume
    8. btrfs subvolume set-default *ID for jolla* /media/sdcard/ - sets jolla to be mounted as default
    9. chown nemo:nemo jolla/ - add -R if needed
    10. chmod 775 jolla/
    11. chmod 777 android/
    12. cp -r -a -v /data/media/* /media/sdcard/android
    13. cd ..
    14. umount /dev/mmcblk1

    preparing the system

    • create (as in do create not a command) /etc/systemd/system/data-media.mount and fill with:

    #

    [Unit]
    Description=SD card btrfs subvolume for Android
    ConditionPathExists=/dev/mmcblk1
    ConditionPathExists=!/tmp/os-update-running
    ConditionPathIsDirectory=/data/media
    Requires=local-fs.target systemd-user-sessions.service
    Before=aliendalvik.service
    After=mount-sd@mmcblk1.service
    BindsTo=mount-sd@mmcblk1.service
    
    [Mount]
    What=/dev/mmcblk1
    Where=/data/media
    Options=subvol=android,compress,dirsync,noatime,users
    
    [Install]
    WantedBy=local-fs.target aliendalvik.service
    

    Second, create /etc/systemd/system/aliendalvik.service.d/sdcard.conf file:

    [Unit] 
    PartOf=data-media.mount
    

    Then run systemctl enable data-media.mount.

    • the mount file gets started every time aliendalvik is started and stops aliendalvik when it gets stopped, on boot it prevents aliendalvik from starting if it is not started yet but waits for the local-fs to be settled and actually having a mountpoint

    for the future we only need to load the service file to its place and enable it, if something changes I will update the code, upgrade went through without anything (see first line for updates) as the updates do not touch data-media.mount as of yet


    part below is obsolete for >1.1.7 new chroot'ing of data

    Steps since Version 1.1.4.x (just looks different in 1.1.2.x): move data form the bind section (line19) of /opt/alien/system/script/alien.sh to its rbind section (line26) so it survives a reboot too. As always, you probably want to save the original file to alien.sh.bak before you start messing around!

    move the value [data] from section

    for d in bin sbin lib usr var etc tmp home vendor data; do
    if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
        echo "mount $ROOT/$d"
        mount --bind /$d $ROOT/$d
    fi
    done
    

    to

    for d in dev sys run media; do 
    if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
        echo "mount $ROOT/$d"
        mount --rbind /$d $ROOT/$d
    fi
    done
    

    result looks like

    for d in bin sbin lib usr var etc tmp home vendor; do
    if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
        echo "mount $ROOT/$d"
        mount --bind /$d $ROOT/$d
    fi
    done
    
    for d in dev sys run media data; do 
    if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
        echo "mount $ROOT/$d"
        mount --rbind /$d $ROOT/$d
    fi
    done
    

    How to: Format your uSD-Card to btrfs and share space with android

    Update: no changes needed for upgrading to 1.1.9.x, even the-vault seems to work fine now, not tested MTP as of chrooting yet. Old stuff in 1.1.7 makes altering alien scripts obsolete, do not alter any files after upgrade, just re-enable the .mount and you should be good to go

    Changed from servicequestion's history to mount. For upgrades it is probably better to disable this hack first and enable it after the upgrade went through (everything was running fine but sailfish-utilities failed stopping android-support, guess I should upgrade to latest release before I role back after a factory-reset, just to give you a heads up - no need to do anything fancy, after upgrading I disabled and then re-enabled the mount and everything is fine again). I also changed the how-to to reflect newest available only, if you need old stuff look into the question's history.

    As of >1.1.4 copy/recover backup (vault) from uSD stopped working with as it cannot handle having it bind-mount+not being the only subvolume available.

    If you are OK with that go ahead reading this guide.

    Version: >1.1.4.x>1.1.7.x


    This is no beginners guide, you need to know your way around! There are no warranties and for > 1.1.4 you need to alter dalvik files or follow the guide below how to circumvent it.around! Old stuff in question's history

    Understand what to do before you do!

    What I did to share the space of my uSD between nemo and android without getting duplicates with bind-mounts or any other hickup, read carefully and use at your own risk:

    1. format the whole usdcard (mmcblk1 not mmcblk1p1) to btrfs
    2. mount that volume (=0)
    3. create two subvolumes > jolla and android
    4. set the default volume to jolla (the default is what gets mounted when something calls mount /dev/mmcblk1)
    5. stop alien-dalvik and copy everything from /data/media to the new subvolume android (don't move the files, this way you have all basics alien-dalvik needs even after pulling the uSD)
    6. add a system.service to systemd that mounts and unmounts the subvolume for android as needed and honours aliendalvik.service The problems to solve are: aliendalvik fuse-mounts its /data/media to /home/nemo/android_storage so you need to make sure everything is mounted before that happens on boot, and stop aliendalvik when the sd gets pulled or the mount needs to be lifted for any other cause.
    7. reboot and wait for the device to settle, as soon as your jolla volume is mounted in /media/, you should see /dev/mmcblk1 being mounted to both /media/sdcard/#UUID and /data/media

    detailed cmds use at your own risk

    preparing the sdcard, should only be needed once!

    first dosystemctl stop aliendalvik.service & systemctl stop aliendalvik.path then follow this list

    1. umount /dev/mmcblk1p1 - unmount the card might be another /dev or even more than one
    2. mkfs.btrfs -f /dev/mmcblk1 mkfs.btrfs -O ^extref -f /dev/mmcblk1 - format the card (no need for partition) - for now extref (this extends num of hardlinks available) needs to be disabled, even on the device
    3. mount -o subvolid=0 /dev/mmcblk1 /media/sdcard
    4. cd /media/sdcard
    5. btrfs subvolume create jolla - create folder called jolla
    6. btrfs subvolume create android - create folder called android
    7. btrfs subvolume list . - returns an ID for each subvolume
    8. btrfs subvolume set-default *ID for jolla* /media/sdcard/ - sets jolla to be mounted as default
    9. chown nemo:nemo jolla/ - add -R if needed
    10. chmod 775 jolla/
    11. chmod 777 android/
    12. cp -r -a -v /data/media/* /media/sdcard/android
    13. cd ..
    14. umount /dev/mmcblk1

    preparing the system

    • create (as in do create not a command) /etc/systemd/system/data-media.mount and fill with:

    #

    [Unit]
    Description=SD card btrfs subvolume for Android
    ConditionPathExists=/dev/mmcblk1
    ConditionPathExists=!/tmp/os-update-running
    ConditionPathIsDirectory=/data/media
    Requires=local-fs.target systemd-user-sessions.service
    Before=aliendalvik.service
    After=mount-sd@mmcblk1.service
    BindsTo=mount-sd@mmcblk1.service
    
    [Mount]
    What=/dev/mmcblk1
    Where=/data/media
    Options=subvol=android,compress,dirsync,noatime,users
    
    [Install]
    WantedBy=local-fs.target aliendalvik.service
    

    Second, create /etc/systemd/system/aliendalvik.service.d/sdcard.conf file:

    [Unit] 
    PartOf=data-media.mount
    

    Then run systemctl enable data-media.mount.

    • the mount file gets started every time aliendalvik is started and stops aliendalvik when it gets stopped, on boot it prevents aliendalvik from starting if it is not started yet but waits for the local-fs to be settled and actually having a mountpoint

    for the future we only need to load the service file to its place and enable it, if something changes I will update the code, upgrade went through without anything (see first line for updates) as the updates do not touch data-media.mount as of yet


    part below is obsolete for >1.1.7 new chroot'ing of data

    Steps since Version 1.1.4.x (just looks different in 1.1.2.x): move data form the bind section (line19) of /opt/alien/system/script/alien.sh to its rbind section (line26) so it survives a reboot too. As always, you probably want to save the original file to alien.sh.bak before you start messing around!

    move the value [data] from section

    for d in bin sbin lib usr var etc tmp home vendor data; do
    if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
        echo "mount $ROOT/$d"
        mount --bind /$d $ROOT/$d
    fi
    done
    

    to

    for d in dev sys run media; do 
    if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
        echo "mount $ROOT/$d"
        mount --rbind /$d $ROOT/$d
    fi
    done
    

    result looks like

    for d in bin sbin lib usr var etc tmp home vendor; do
    if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
        echo "mount $ROOT/$d"
        mount --bind /$d $ROOT/$d
    fi
    done
    
    for d in dev sys run media data; do 
    if [ "" == "$(grep $ROOT/$d /proc/mounts)" ]; then
        echo "mount $ROOT/$d"
        mount --rbind /$d $ROOT/$d
    fi
    done
    

    How to: Format your uSD-Card to btrfs and share space with android

    Update: no changes needed for upgrading to 1.1.9.x, even the-vault seems to work fine now, 2.0.0.x, MTP on Win10 broken (but that is not tested MTP as of yet. my fault!) Old stuff in question's history

    If you are OK with that go ahead reading this guide.

    Version: >1.1.7.x>1.1.9.x


    This is no beginners guide, you need to know your way around!

    Understand what to do before you do!

    What I did to share the space of my uSD between nemo and android without getting duplicates with bind-mounts or any other hickup, read carefully and use at your own risk:

    1. format the whole usdcard (mmcblk1 not mmcblk1p1) to btrfs
    2. mount that volume (=0)
    3. create two subvolumes > jolla and android
    4. set the default volume to jolla (the default is what gets mounted when something calls mount /dev/mmcblk1)
    5. stop alien-dalvik and copy everything from /data/media to the new subvolume android (don't move the files, this way you have all basics alien-dalvik needs even after pulling the uSD)
    6. add a system.service to systemd that mounts and unmounts the subvolume for android as needed and honours aliendalvik.service The problems to solve are: aliendalvik fuse-mounts its /data/media to /home/nemo/android_storage so you need to make sure everything is mounted before that happens on boot, and stop aliendalvik when the sd gets pulled or the mount needs to be lifted for any other cause.
    7. reboot and wait for the device to settle, as soon as your jolla volume is mounted in /media/, you should see /dev/mmcblk1 being mounted to both /media/sdcard/#UUID and /data/media

    detailed cmds use at your own risk

    preparing the sdcard, should only be needed once!

    first dosystemctl stop aliendalvik.service & systemctl stop aliendalvik.path then follow this list

    1. umount /dev/mmcblk1p1 - unmount the card might be another /dev or even more than one
    2. mkfs.btrfs -f /dev/mmcblk1 mkfs.btrfs -O ^extref -f /dev/mmcblk1 - format the card (no need for partition) - for now extref (this extends num of hardlinks available) needs to be disabled, even on the device
    3. mount -o subvolid=0 /dev/mmcblk1 /media/sdcard
    4. cd /media/sdcard
    5. btrfs subvolume create jolla - create folder called jolla
    6. btrfs subvolume create android - create folder called android
    7. btrfs subvolume list . - returns an ID for each subvolume
    8. btrfs subvolume set-default *ID for jolla* /media/sdcard/ - sets jolla to be mounted as default
    9. chown nemo:nemo jolla/ - add -R if needed
    10. chmod 775 jolla/
    11. chmod 777 android/
    12. cp -r -a -v /data/media/* /media/sdcard/android
    13. cd ..
    14. umount /dev/mmcblk1

    preparing the system

    • create (as in do create not a command) /etc/systemd/system/data-media.mount and fill with:

    #

    [Unit]
    Description=SD card btrfs subvolume for Android
    ConditionPathExists=/dev/mmcblk1
    ConditionPathExists=!/tmp/os-update-running
    ConditionPathIsDirectory=/data/media
    Requires=local-fs.target systemd-user-sessions.service
    Before=aliendalvik.service
    After=mount-sd@mmcblk1.service
    BindsTo=mount-sd@mmcblk1.service
    
    [Mount]
    What=/dev/mmcblk1
    Where=/data/media
    Options=subvol=android,compress,dirsync,noatime,users
    
    [Install]
    WantedBy=local-fs.target aliendalvik.service
    

    Second, create /etc/systemd/system/aliendalvik.service.d/sdcard.conf file:

    [Unit] 
    PartOf=data-media.mount
    

    Then run systemctl enable data-media.mount.

    • the mount file gets started every time aliendalvik is started and stops aliendalvik when it gets stopped, on boot it prevents aliendalvik from starting if it is not started yet but waits for the local-fs to be settled and actually having a mountpoint

    for the future we only need to load the service file to its place and enable it, if something changes I will update the code, upgrade went through without anything (see first line for updates) as the updates do not touch data-media.mount as of yet

    How to: Format your uSD-Card to btrfs and share space with android

    Update:Update: JollaC not working due to missing btrfs support no changes needed for upgrading to 2.0.0.x, MTP on Win10 broken (but that is not my fault!) Old stuff in question's history

    If you are OK with that go ahead reading this guide.

    Version: >1.1.9.x


    This is no beginners guide, you need to know your way around!

    Understand what to do before you do!

    What I did to share the space of my uSD between nemo and android without getting duplicates with bind-mounts or any other hickup, read carefully and use at your own risk:

    1. format the whole usdcard (mmcblk1 not mmcblk1p1) to btrfs
    2. mount that volume (=0)
    3. create two subvolumes > jolla and android
    4. set the default volume to jolla (the default is what gets mounted when something calls mount /dev/mmcblk1)
    5. stop alien-dalvik and copy everything from /data/media to the new subvolume android (don't move the files, this way you have all basics alien-dalvik needs even after pulling the uSD)
    6. add a system.service to systemd that mounts and unmounts the subvolume for android as needed and honours aliendalvik.service The problems to solve are: aliendalvik fuse-mounts its /data/media to /home/nemo/android_storage so you need to make sure everything is mounted before that happens on boot, and stop aliendalvik when the sd gets pulled or the mount needs to be lifted for any other cause.
    7. reboot and wait for the device to settle, as soon as your jolla volume is mounted in /media/, you should see /dev/mmcblk1 being mounted to both /media/sdcard/#UUID and /data/media

    detailed cmds use at your own risk

    preparing the sdcard, should only be needed once!

    first dosystemctl stop aliendalvik.service & systemctl stop aliendalvik.path then follow this list

    1. umount /dev/mmcblk1p1 - unmount the card might be another /dev or even more than one
    2. mkfs.btrfs -f /dev/mmcblk1 mkfs.btrfs -O ^extref -f /dev/mmcblk1 - format the card (no need for partition) - for now extref (this extends num of hardlinks available) needs to be disabled, even on the device
    3. mount -o subvolid=0 /dev/mmcblk1 /media/sdcard
    4. cd /media/sdcard
    5. btrfs subvolume create jolla - create folder called jolla
    6. btrfs subvolume create android - create folder called android
    7. btrfs subvolume list . - returns an ID for each subvolume
    8. btrfs subvolume set-default *ID for jolla* /media/sdcard/ - sets jolla to be mounted as default
    9. chown nemo:nemo jolla/ - add -R if needed
    10. chmod 775 jolla/
    11. chmod 777 android/
    12. cp -r -a -v /data/media/* /media/sdcard/android
    13. cd ..
    14. umount /dev/mmcblk1

    preparing the system

    • create (as in do create not a command) /etc/systemd/system/data-media.mount and fill with:

    #

    [Unit]
    Description=SD card btrfs subvolume for Android
    ConditionPathExists=/dev/mmcblk1
    ConditionPathExists=!/tmp/os-update-running
    ConditionPathIsDirectory=/data/media
    Requires=local-fs.target systemd-user-sessions.service
    Before=aliendalvik.service
    After=mount-sd@mmcblk1.service
    BindsTo=mount-sd@mmcblk1.service
    
    [Mount]
    What=/dev/mmcblk1
    Where=/data/media
    Options=subvol=android,compress,dirsync,noatime,users
    
    [Install]
    WantedBy=local-fs.target aliendalvik.service
    

    Second, create /etc/systemd/system/aliendalvik.service.d/sdcard.conf file:

    [Unit] 
    PartOf=data-media.mount
    

    Then run systemctl enable data-media.mount.

    • the mount file gets started every time aliendalvik is started and stops aliendalvik when it gets stopped, on boot it prevents aliendalvik from starting if it is not started yet but waits for the local-fs to be settled and actually having a mountpoint

    for the future we only need to load the service file to its place and enable it, if something changes I will update the code, upgrade went through without anything (see first line for updates) as the updates do not touch data-media.mount as of yet

    How to: Format your uSD-Card to btrfs and share space with android

    Update: For JollaC not working see https://together.jolla.com/question/40802/how-to-format-your-usd-card-to-btrfs-and-share-space-with-android/?answer=140223#post-id-140223 things changed due to missing btrfs supportsupport and android mounting has changed a bit Old stuff in question's history

    If you are OK with that becoming root and follow a step by step guide on your own account, go ahead reading this guide.

    Version: >1.1.9.x


    This is no beginners guide, you need to know your way around!

    Understand what to do before you do!

    What I did to share the space of my uSD between nemo and android without getting duplicates with bind-mounts or any other hickup, read carefully and use at your own risk:

    1. format the whole usdcard (mmcblk1 not mmcblk1p1) to btrfs
    2. mount that volume (=0)
    3. create two subvolumes > jolla and android
    4. set the default volume to jolla (the default is what gets mounted when something calls mount /dev/mmcblk1)
    5. stop alien-dalvik and copy everything from /data/media to the new subvolume android (don't move the files, this way you have all basics alien-dalvik needs even after pulling the uSD)
    6. add a system.service to systemd that mounts and unmounts the subvolume for android as needed and honours aliendalvik.service The problems to solve are: aliendalvik fuse-mounts its /data/media to /home/nemo/android_storage so you need to make sure everything is mounted before that happens on boot, and stop aliendalvik when the sd gets pulled or the mount needs to be lifted for any other cause.
    7. reboot and wait for the device to settle, as soon as your jolla volume is mounted in /media/, you should see /dev/mmcblk1 being mounted to both /media/sdcard/#UUID and /data/media

    detailed cmds use at your own risk

    preparing the sdcard, should only be needed once!

    first dosystemctl stop aliendalvik.service & systemctl stop aliendalvik.path then follow this list

    1. umount /dev/mmcblk1p1 - unmount the card might be another /dev or even more than one
    2. mkfs.btrfs -f /dev/mmcblk1 mkfs.btrfs -O ^extref -f /dev/mmcblk1 - format the card (no need for partition) - for now extref (this extends num of hardlinks available) needs to be disabled, even on the device
    3. mount -o subvolid=0 /dev/mmcblk1 /media/sdcard
    4. cd /media/sdcard
    5. btrfs subvolume create jolla - create folder called jolla
    6. btrfs subvolume create android - create folder called android
    7. btrfs subvolume list . - returns an ID for each subvolume
    8. btrfs subvolume set-default *ID for jolla* /media/sdcard/ - sets jolla to be mounted as default
    9. chown nemo:nemo jolla/ - add -R if needed
    10. chmod 775 jolla/
    11. chmod 777 android/
    12. cp -r -a -v /data/media/* /media/sdcard/android
    13. cd ..
    14. umount /dev/mmcblk1

    preparing the system

    • create (as in do create not a command) /etc/systemd/system/data-media.mount and fill with:

    #

    [Unit]
    Description=SD card btrfs subvolume for Android
    ConditionPathExists=/dev/mmcblk1
    ConditionPathExists=!/tmp/os-update-running
    ConditionPathIsDirectory=/data/media
    Requires=local-fs.target systemd-user-sessions.service
    Before=aliendalvik.service
    After=mount-sd@mmcblk1.service
    BindsTo=mount-sd@mmcblk1.service
    
    [Mount]
    What=/dev/mmcblk1
    Where=/data/media
    Options=subvol=android,compress,dirsync,noatime,users
    
    [Install]
    WantedBy=local-fs.target aliendalvik.service
    

    Second, create /etc/systemd/system/aliendalvik.service.d/sdcard.conf file:

    [Unit] 
    PartOf=data-media.mount
    

    Then run systemctl enable data-media.mount.

    • the mount file gets started every time aliendalvik is started and stops aliendalvik when it gets stopped, on boot it prevents aliendalvik from starting if it is not started yet but waits for the local-fs to be settled and actually having a mountpoint

    for the future we only need to load the service file to its place and enable it, if something changes I will update the code, upgrade went through without anything (see first line for updates) as the updates do not touch data-media.mount as of yet

    How to: Format your uSD-Card to btrfs and share space with android

    Update: For JollaC see https://together.jolla.com/question/40802/how-to-format-your-usd-card-to-btrfs-and-share-space-with-android/?answer=140223#post-id-140223 at the bottom, things changed due to missing btrfs support and android mounting has changed a bitbit too Old stuff in question's history

    If you are OK with becoming root and follow a step by step guide on your own account, go ahead reading this guide.

    Version: >1.1.9.x


    This is no beginners guide, you need to know your way around!

    Understand what to do before you do!

    What I did to share the space of my uSD between nemo and android without getting duplicates with bind-mounts or any other hickup, read carefully and use at your own risk:

    1. format the whole usdcard (mmcblk1 not mmcblk1p1) to btrfs
    2. mount that volume (=0)
    3. create two subvolumes > jolla and android
    4. set the default volume to jolla (the default is what gets mounted when something calls mount /dev/mmcblk1)
    5. stop alien-dalvik and copy everything from /data/media to the new subvolume android (don't move the files, this way you have all basics alien-dalvik needs even after pulling the uSD)
    6. add a system.service to systemd that mounts and unmounts the subvolume for android as needed and honours aliendalvik.service The problems to solve are: aliendalvik fuse-mounts its /data/media to /home/nemo/android_storage so you need to make sure everything is mounted before that happens on boot, and stop aliendalvik when the sd gets pulled or the mount needs to be lifted for any other cause.
    7. reboot and wait for the device to settle, as soon as your jolla volume is mounted in /media/, you should see /dev/mmcblk1 being mounted to both /media/sdcard/#UUID and /data/media

    detailed cmds use at your own risk

    preparing the sdcard, should only be needed once!

    first dosystemctl stop aliendalvik.service & systemctl stop aliendalvik.path then follow this list

    1. umount /dev/mmcblk1p1 - unmount the card might be another /dev or even more than one
    2. mkfs.btrfs -f /dev/mmcblk1 mkfs.btrfs -O ^extref -f /dev/mmcblk1 - format the card (no need for partition) - for now extref (this extends num of hardlinks available) needs to be disabled, even on the device
    3. mount -o subvolid=0 /dev/mmcblk1 /media/sdcard
    4. cd /media/sdcard
    5. btrfs subvolume create jolla - create folder called jolla
    6. btrfs subvolume create android - create folder called android
    7. btrfs subvolume list . - returns an ID for each subvolume
    8. btrfs subvolume set-default *ID for jolla* /media/sdcard/ - sets jolla to be mounted as default
    9. chown nemo:nemo jolla/ - add -R if needed
    10. chmod 775 jolla/
    11. chmod 777 android/
    12. cp -r -a -v /data/media/* /media/sdcard/android
    13. cd ..
    14. umount /dev/mmcblk1

    preparing the system

    • create (as in do create not a command) /etc/systemd/system/data-media.mount and fill with:

    #

    [Unit]
    Description=SD card btrfs subvolume for Android
    ConditionPathExists=/dev/mmcblk1
    ConditionPathExists=!/tmp/os-update-running
    ConditionPathIsDirectory=/data/media
    Requires=local-fs.target systemd-user-sessions.service
    Before=aliendalvik.service
    After=mount-sd@mmcblk1.service
    BindsTo=mount-sd@mmcblk1.service
    
    [Mount]
    What=/dev/mmcblk1
    Where=/data/media
    Options=subvol=android,compress,dirsync,noatime,users
    
    [Install]
    WantedBy=local-fs.target aliendalvik.service
    

    Second, create /etc/systemd/system/aliendalvik.service.d/sdcard.conf file:

    [Unit] 
    PartOf=data-media.mount
    

    Then run systemctl enable data-media.mount.

    • the mount file gets started every time aliendalvik is started and stops aliendalvik when it gets stopped, on boot it prevents aliendalvik from starting if it is not started yet but waits for the local-fs to be settled and actually having a mountpoint

    for the future we only need to load the service file to its place and enable it, if something changes I will update the code, upgrade went through without anything (see first line for updates) as the updates do not touch data-media.mount as of yet


    Jolla C

    This has major differences with the original solution for Jolla1 https://together.jolla.com/question/40802/how-to-format-your-usd-card-to-btrfs-and-share-space-with-android/?answer=140223#post-id-140223

    1. The SDcard is formatted to ext4 instead of btrfs (as there is no btrfs support on JollaC yet). I also kept a conventional partition layout (to make it more likely other systems can easily mount the card. although they need to support ext4).
    2. The android directory that is overlaid (bind-mount) is /home/nemo/android_storage instead of /data/media. Which is actually a good thing as now Alien is having symlinks instead of mounting in circles.
    3. Bind mounts are used, instead of btrfs subvolume mounts. The Android directory is hidden in an attempt to prevent tracker indexing the files twice.

    New instructions for JollaC are as follows:

    preparing the sdcard should only be needed once!

    Note: some ext4 formatted uSD cards did not show up or rendered unmountable on JollaC, best fit is to format on device

    first dosystemctl stop aliendalvik.service then follow this list

    1. umount /dev/mmcblk1p1 - unmount the card might be another /dev or even more than one
    2. mkfs.ext4 /dev/mmcblk1p1 - format the card
    3. mount /dev/mmcblk1p1 /media/sdcard
    4. cd /media/sdcard
    5. mkdir .android - create folder called .android - this is hidden (starts with a dot) so it does not appear in directory listings
    6. I like to create a file on the card to remind me what I have done: so create a file called Android.README and fill it with:

      Android files are contained in a hidden directory called .android

      See https://together.jolla.com/question/40802/how-to-format-your-usd-card-to-btrfs-and-share-space-with-android/

    7. I also like to create a file with a unique name to let me easily check that Android apps are seeing the expected SD card. Something like: touch .android/GRC-128GB-SD.android

    8. chown -R nemo:nemo .android/
    9. chmod -R a=rwX .android/
    10. cp -r -a -v /home/nemo/android_storage/* /media/sdcard/.android
    11. cd ..
    12. umount /dev/mmcblk1p1

    preparing the system

    • The next step requires knowing the Filesystem UUID for the SDcard filesystem. You can get it using lsblk -no UUID /dev/mmcblk1p1. The UUID is a string like 12345678-9abc-def0-1234-56789abcdef0. This string must be used instead of the string UUID-HERE in the file below (two occurrences). You can also find the UUID in the folder the uSD is mounted to as it follows that scheme (in /media/sdcard/ the folder of the currently mounted uSD).
    • create (as in do create not a command) /etc/systemd/system/home-nemo-android_storage.mount and fill with:

    #

    [Unit]
    Description=SD card bind mount for Android
    ConditionPathExists=/dev/mmcblk1p1
    ConditionPathExists=!/tmp/os-update-running
    ConditionPathIsDirectory=/home/nemo/android_storage/
    ConditionPathIsMountPoint=/media/sdcard/UUID-HERE/
    Requires=local-fs.target systemd-user-sessions.service
    Before=aliendalvik.service
    After=mount-sd@mmcblk1p1.service
    BindsTo=mount-sd@mmcblk1p1.service
    
    [Mount]
    What=/media/sdcard/UUID-HERE/.android/
    Where=/home/nemo/android_storage/
    Type=none
    Options=bind
    
    [Install]
    WantedBy=local-fs.target aliendalvik.service
    

    Then run systemctl enable home-nemo-android_storage.mount.

    • the mount file gets started every time aliendalvik is started and stops aliendalvik when it gets stopped, on boot it prevents aliendalvik from starting if it is not started yet but waits for the local-fs to be settled and actually having a mountpoint

    • If you put a different SD card in, the mount file will do nothing (because the UUID does not match). The original /home/nemo/android_storage will be used. You can repeat the steps from the top, of course, for the new card.

    How to: Format your uSD-Card to btrfs and share space with android

    Update: For JollaC see at the bottom, things changed due to missing btrfs support and android mounting has changed a bit too Old stuff in question's history

    If you are OK with becoming root and follow a step by step guide on your own account, go ahead reading this guide.

    Version: >1.1.9.x


    This is no beginners guide, you need to know your way around!

    Understand what to do before you do!

    What I did to share the space of my uSD between nemo and android without getting duplicates with bind-mounts or any other hickup, read carefully and use at your own risk:

    1. format the whole usdcard (mmcblk1 not mmcblk1p1) to btrfs
    2. mount that volume (=0)
    3. create two subvolumes > jolla and android
    4. set the default volume to jolla (the default is what gets mounted when something calls mount /dev/mmcblk1)
    5. stop alien-dalvik and copy everything from /data/media to the new subvolume android (don't move the files, this way you have all basics alien-dalvik needs even after pulling the uSD)
    6. add a system.service to systemd that mounts and unmounts the subvolume for android as needed and honours aliendalvik.service The problems to solve are: aliendalvik fuse-mounts its /data/media to /home/nemo/android_storage so you need to make sure everything is mounted before that happens on boot, and stop aliendalvik when the sd gets pulled or the mount needs to be lifted for any other cause.
    7. reboot and wait for the device to settle, as soon as your jolla volume is mounted in /media/, you should see /dev/mmcblk1 being mounted to both /media/sdcard/#UUID and /data/media

    detailed cmds use at your own risk

    preparing the sdcard, should only be needed once!

    first dosystemctl stop aliendalvik.service & systemctl stop aliendalvik.path then follow this list

    1. umount /dev/mmcblk1p1 - unmount the card might be another /dev or even more than one
    2. mkfs.btrfs -f /dev/mmcblk1 mkfs.btrfs -O ^extref -f /dev/mmcblk1 - format the card (no need for partition) - for now extref (this extends num of hardlinks available) needs to be disabled, even on the device
    3. mount -o subvolid=0 /dev/mmcblk1 /media/sdcard
    4. cd /media/sdcard
    5. btrfs subvolume create jolla - create folder called jolla
    6. btrfs subvolume create android - create folder called android
    7. btrfs subvolume list . - returns an ID for each subvolume
    8. btrfs subvolume set-default *ID for jolla* /media/sdcard/ - sets jolla to be mounted as default
    9. chown nemo:nemo jolla/ - add -R if needed
    10. chmod 775 jolla/
    11. chmod 777 android/
    12. cp -r -a -v /data/media/* /media/sdcard/android
    13. cd ..
    14. umount /dev/mmcblk1

    preparing the system

    • create (as in do create not a command) /etc/systemd/system/data-media.mount and fill with:

    #

    [Unit]
    Description=SD card btrfs subvolume for Android
    ConditionPathExists=/dev/mmcblk1
    ConditionPathExists=!/tmp/os-update-running
    ConditionPathIsDirectory=/data/media
    Requires=local-fs.target systemd-user-sessions.service
    Before=aliendalvik.service
    After=mount-sd@mmcblk1.service
    BindsTo=mount-sd@mmcblk1.service
    
    [Mount]
    What=/dev/mmcblk1
    Where=/data/media
    Options=subvol=android,compress,dirsync,noatime,users
    
    [Install]
    WantedBy=local-fs.target aliendalvik.service
    

    Second, create /etc/systemd/system/aliendalvik.service.d/sdcard.conf file:

    [Unit] 
    PartOf=data-media.mount
    

    Then run systemctl enable data-media.mount.

    • the mount file gets started every time aliendalvik is started and stops aliendalvik when it gets stopped, on boot it prevents aliendalvik from starting if it is not started yet but waits for the local-fs to be settled and actually having a mountpoint

    for the future we only need to load the service file to its place and enable it, if something changes I will update the code, upgrade went through without anything (see first line for updates) as the updates do not touch data-media.mount as of yet


    Jolla C

    This has major differences with the original solution for Jolla1 https://together.jolla.com/question/40802/how-to-format-your-usd-card-to-btrfs-and-share-space-with-android/?answer=140223#post-id-140223

    1. The SDcard is formatted to ext4 instead of btrfs (as there is no btrfs support on JollaC yet). I also kept a conventional partition layout (to make it more likely other systems can easily mount the card. although they need to support ext4).
    2. The android directory that is overlaid (bind-mount) is /home/nemo/android_storage instead of /data/media. Which is actually a good thing as now Alien is having symlinks instead of mounting in circles.
    3. Bind mounts are used, instead of btrfs subvolume mounts. The Android directory is hidden in an attempt to prevent tracker indexing the files twice.

    New instructions for JollaC are as follows:

    preparing the sdcard should only be needed once!

    Note: some ext4 formatted uSD cards did not show up or rendered unmountable on JollaC, best fit is to format on device

    first dosystemctl stop aliendalvik.service then follow this list

    1. umount /dev/mmcblk1p1 - unmount the card might be another /dev or even more than one
    2. mkfs.ext4 /dev/mmcblk1p1 - format the card
    3. mount /dev/mmcblk1p1 /media/sdcard
    4. cd /media/sdcard
    5. mkdir .android - create folder called .android - this is hidden (starts with a dot) so it does not appear in directory listings
    6. I like to create a file on the card to remind me what I have done: so create a file called Android.README and fill it with:

      Android files are contained in a hidden directory called .android

      See https://together.jolla.com/question/40802/how-to-format-your-usd-card-to-btrfs-and-share-space-with-android/

    7. I also like to create a file with a unique name to let me easily check that Android apps are seeing the expected SD card. Something like: touch .android/GRC-128GB-SD.android

    8. chown -R nemo:nemo .android/
    9. chmod -R a=rwX .android/
    10. cp -r -a -v /home/nemo/android_storage/* /media/sdcard/.android
    11. cd ..
    12. umount /dev/mmcblk1p1

    preparing the system

    • The next step requires knowing the Filesystem UUID for the SDcard filesystem. You can get it using lsblk -no UUID /dev/mmcblk1p1. The UUID is a string like 12345678-9abc-def0-1234-56789abcdef0. This string must be used instead of the string UUID-HERE in the file below (two occurrences). You can also find the UUID in the folder the uSD is mounted to as it follows that scheme (in /media/sdcard/ the folder of the currently mounted uSD).
    • create (as in do create not a command) /etc/systemd/system/home-nemo-android_storage.mount and fill with:

    #

    [Unit]
    Description=SD card bind mount for Android
    ConditionPathExists=/dev/mmcblk1p1
    ConditionPathExists=!/tmp/os-update-running
    ConditionPathIsDirectory=/home/nemo/android_storage/
    ConditionPathIsMountPoint=/media/sdcard/UUID-HERE/
    Requires=local-fs.target systemd-user-sessions.service
    Before=aliendalvik.service
    After=mount-sd@mmcblk1p1.service
    BindsTo=mount-sd@mmcblk1p1.service
    
    [Mount]
    What=/media/sdcard/UUID-HERE/.android/
    Where=/home/nemo/android_storage/
    Type=none
    Options=bind
    
    [Install]
    WantedBy=local-fs.target aliendalvik.service
    

    Then run systemctl enable home-nemo-android_storage.mount.

    • the mount file gets started every time aliendalvik is started and stops aliendalvik when it gets stopped, on boot it prevents aliendalvik from starting if it is not started yet but waits for the local-fs to be settled and actually having a mountpoint

    • If you put a different SD card in, the mount file will do nothing (because the UUID does not match). The original /home/nemo/android_storage will be used. You can repeat the steps from the top, of course, for the new card.