Ubuntu – Mount /home directory from SD card in Ubuntu Touch


Much like one might mount /home from a second drive or partition on a desktop computer, is it possible to mount /home from an SD card in Ubuntu Touch?

I know lots of locations are bind mounted in Ubuntu Touch, I know changes to /etc/fstab don't persist after reboots (though I don't understand how or why this could be!) but really I'm not very experienced with this sort of thing and I can't seem to get anywhere..

If it helps, the main reasons I want to do this (apart from just because it flaming well ought to be possible!) are that the onboard storage space on my device (a BQ Aquaris Ubuntu Edition) is awfully limited and also to make it easier for me to be able to switch devices and so forth in the future.

Best Answer

There are way too many existing symlinks in /home/phablet/.local to make feasible symlinking the whole /home/phablet directory structure. I tried, but received a bunch of permission denied errors and figured it would probably break things anyhow if I managed to do it.

What does work, however, is doing the following:

  • Copying each of the subdir of /home/phablet to /media/phablet/*<sdcardname>* (e.g. cp -R Pictures/ /media/phablet/*sdcardname*)
  • Renaming each of the original subdir to .bak (e.g., mv Documents/ Documents.bak)
  • Creating symlink for each of the subdir (ln -s /media/phablet/*sdcardname*/Music Music)

And if you have any podcasts courtesy of the excellent application Podbird, you can delete the podcast directory under /home/phablet/.local/share/com.mikeasoft.podbird and create a symlink to wherever you want to store it on your sd card. For example:

mkdir -p /home/phablet/*sdcardname*/.local/share/com.mikeasoft.podbird/podcasts 
ln -s /home/phablet/*sdcardname*/.local/share/com.mikeasoft.podbird/podcasts /home/phablet/.local/share/com.mikeasoft.podbird/podcasts

Hope this helps others. Long live the penguin!

Related Question