1

I need this for my Raspberry PI Ubuntu Core installation. I want to be able to remove SD card after system boot. Now, if I remove it, all squashfs mounts disappear and system stops working properly. If snaps copied to RAM and started from there, I can unmount and remove SD card successfuly (as it works in TinyCore Linux, for example).

So, when I boot Ubuntu Core, it mounts all .snap files during boot as squashfs filesystems to /dev/loop devices from hard drive. I want to adjust this process. Before mounting, I want to copy snap files to ram drive and then mount them from RAM drive. So, during boot I want to create ram drive:

mkdir /mnt/ramdisk
mount -t tmpfs -o size=512m tmpfs /mnt/ramdisk

Then I want to copy all .snap files from /writable/system-data/var/lib/snapd/snaps to /mnt/ramdisk and then mount them to /dev/loop[0..9].

In which boot script can I insert my code for this?

  • What about booting the whole system to a RAM disk? Would that be too large? See askubuntu.com/questions/829917/… – Byte Commander Dec 27 '16 at 13:33
  • Thanks for an advice. But how to add 'toram' GRUB boot option to Ubuntu Core for Raspberry PI image? Does it use GRUB as a boot manager ? – Andrey Germanov Dec 27 '16 at 13:37
  • I don't know the details of Ubuntu Core for Raspberries, but I believe that it has to use GRUB or another boot loader which is capable of passing kernel parameters at boot. You'd have to find that out yourself. – Byte Commander Dec 27 '16 at 13:39
  • The raspberry Pi pros hang out at raspberrypi.stackexchange.com a very useful site for the Pi hobbyist. – Elder Geek Dec 27 '16 at 13:43
  • Thanks, but this question is more specific for 'Ubuntu Core', does not matter for desktop or Raspberry PI. I want to load all .snap images to RAM drive during boot, and then mount them from RAM drive. – Andrey Germanov Dec 27 '16 at 13:47

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.