Ubuntu touch – /etc/fstab resets after every restart
I have just received the Meizu MX4 Ubuntu edition and have already started hacking it. Managed to use davfs2 to mount remote drives ok, but anything I add to /etc/fstab is automatically removed every time the phone is restarted. Is this a bug or a deliberate security feature?
Is there a workaround? – was thinking of having a script run after startup, grep /etc/fstab and append line(s) that are missing, then mount drives. Is there a better solution?
We can use /lib/init/fstab
. But before we should set a system partition as writable:
sudo android-gadget-service enable writable
After rebooting we can edit /lib/init/fstab
with sudo nano
or sudo vim
, for example we can add this string:
/dev/mmcblk1p2 /home/phablet/mnt/sd ext2 defaults,noatime,nodiratime,errors=remount-ro 0 2
to mount ext2 partition on sd card. Then, we make system partition read-only again: sudo rm /userdata/.writable_image
and reboot.
Of course, after getting new OTA we should repeat it again.
Standard /etc/fstab
is mystical in ubuntu-touch, mounting (binding) to tmpfs and seems is generated on-the-fly or just in starting. But /lib/init/fstab
works well.