I try to use an MicroSD card containing a chroot environment which I can break, e.g. by installing software, without damaging the OS on my bq Aquaris E4.5 Ubuntu Edition, however I can not let the filesystem being auto-mounted and use the chroot at the same time.

  • ext4 and similiar filesystems do not get mounted by ciborium → by default the sd card is not mounted when using ext4, an error is indicated and I am asked to format the disk as vfat
  • vfat does not support the execute permission → I cannot run programs of the chroot when the chroot is saved on a vfat partition
  • To me there is no known way to start a script automatically on startup (I have found this while searching for an answer) without changing the file-system which is by default intentionally mounted as read-only → I can not easily create a mount script executed on startup

So I wonder whether there is a way to auto-mount an MicroSD-card which can be used to store an chroot without modifying the write-protected parts of the phone.

share|improve this question
    
You can call to the script in /etc/rc.local. But previously you need remount loop0 like rw because it is only read. (sudo mount /dev/loop0 / -o remount, rw) – Gelux Jun 9 '16 at 8:34

I have ext2 partition on my sd card and I want automount for this partition. Here is my solution for Ubuntu Touch BQ Aquaris m10.

At first, we make a system partition writable:

sudo touch /userdata/.writable_image

After doing this system will reboot. Then, we edit /lib/init/fstab:

sudo nano /lib/init/fstab

and add this string in bottom:

/dev/mmcblk1p2  /home/phablet/mnt/sd      ext2            defaults,noatime,nodiratime,errors=remount-ro 0 2

Then, we make system partition read-only again:

sudo rm /userdata/.writable_image

And rebooting:

sudo shutdown -r now

It works!

share|improve this answer
    
I haven't tested it, but it requires changing the root fs. As far as I have read, this is discouraged beacause it can lead to undefined behaviour in case of updates - a reflash of the device might become necessary, and I would prefer to avoid that case. So I do not want to change my root fs - there is a reason why it is read-only. – paulusASol Dec 4 '16 at 20:19
    
Some changing in rootfs can be done without problems. Please, read carefully comments before answer and the answer of Larry Price in this topic concerning it. Larry (as far I understand) is from Canonical Team. – Vladimir Dec 5 '16 at 2:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.