0

Is there a way to install own libertine container in the custom directory or partition? I think the main size (volume) of container installation belongs to directory like this:

/home/phablet/.cache/libertine-container/my-container/rootfs

Of course it will be helpful to know a list of other file locations of own container like:

~/.local/share/libertine/ContainersConfig.json
~/.cache/libertine-container/my-container
~/.cache/my-container
~/.local/share/libertine-container/user-data/my-container
~/.local/share/libertine-container/user-data/my-container/.cach/libertine-container/my-container

I see now only way with using mount --bind.., but in doing that we have several problems here with /etc/fstab editing or using /etc/rc.local or upstart script to automount on device starting.

So, second question is that: if I use mount --bind.. for binding /home/phablet/.cache/libertine-container/my-container/rootfs manually from time to time, then will I have a trouble with correct work of libertine scope (like as described there)?

Vladimir
  • 207
  • Your intent is to create a non-libertine container for libertine to use? I would not recommend it. Would it be possible to make whatever changes you need to a libertine-managed container? – Larry Price Nov 30 '16 at 15:44
  • Larry, my idea is to place rootfs of particular libertine container on SD card and use it with mount --bind. And I've solved this problem. So, I'll present my answer. – Vladimir Dec 03 '16 at 09:37

1 Answers1

1

Before our actions we should have SD card with ext2/3/4 partition. In Ubuntu Touch it can be represented as /dev/mmcblk1p2 (in my case). If we want permanent mounting, we can’t use /etc/fstab/ but we can use /lib/init/fstab as I pointed in answer there. Permanent mounting of SD in Ubuntu Touch is not convenient and not stable. Sometimes, because of error in file system on ext2 partition, I had got problems with booting of Ubuntu Touch. Perhaps, shooting down of device doesn't perform dismounting correctly. So, I decided to mount SD card and to use Libertine container on it from time to time.

At first, I created new container with name sd-container as usual in internal disk space: /home/phablet/.cache/libertine-container/sd-container. Then, I mounted ext2 partition on SD with such command:

sudo mount /dev/mmcblk1p2 /home/phablet/mnt/sd -t ext2 -o defaults,noatime,nodiratime,errors=remount-ro

then I made directory /home/phablet/mnt/sd/sd-container/ and made copy of rootfs of sd-container to ext2 partition on SD:

cd /home/phablet/.cache/libertine-container/sd-container
rsync -aAXvH ./ /home/phablet/mnt/sd/sd-container/

After this preparing I made script to mount ext2 partition on SD and to bind rootfs (sdgo.sh):

#!/bin/sh
sudo mount /dev/mmcblk1p2 /home/phablet/mnt/sd -t ext2 -o defaults,noatime,nodiratime,errors=remount-ro
sudo mount --bind  /home/phablet/mnt/sd/sd-container/rootfs /home/phablet/.cache/libertine-container/sd-container/rootfs
restart unity8-dash

and script to stop playng with this (sdstop.sh):

#!/bin/sh
sudo umount /home/phablet/.cache/libertine-container/sd-container/rootfs
sudo umount /dev/mmcblk1p2
restart unity8-dash

Finally, after I run sdgo.sh unity8-dash restarts, and I can see new SD-container scope and its applications under Desktop App Scope. I can run or install new applications as usual. But rootfs of this container is situated on SD card! When I want to stop I run sdstop.sh and SD-container scope disappears. And small original rootfs (hidden by this binding) remains on internal disk space without changes.

Conclusion: I have rootfs of Libertine container on SD card and possibility to switch on/off it and its scope when I want.

Vladimir
  • 207