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?

karel
  • 114,770
  • What about booting the whole system to a RAM disk? Would that be too large? See https://askubuntu.com/questions/829917/can-i-boot-a-live-usb-fully-to-ram-allowing-me-to-remove-the-disk – 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 http://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
  • or not all .snap, files, but only part of them, it allows to manage RAM usage better. – Andrey Germanov Dec 27 '16 at 13:51
  • No ideas anymore ? – Andrey Germanov Dec 29 '16 at 13:37

0 Answers0