After numerous update push (yes … I am a resin newbie), I destroyed yet another SD card, so I want to try running resin on the Raspberry, from a PiDrive. I was wondering if someone already tried?
So, if you have any tips or working script to share, you are welcome. Otherwise, my PiDrive is underway, and I will try to migrate using the Adafruit script … modify it as, aside /boot, there are 5 other partitions to move and reconfigure …and post it here when under control. Any interest from the community fro that type of solution? If so, have a look at WDlabs solution for Raspberry (zero, compute, 3 …)
I copied resin.img on SD and on HD, and modified the cmdline.txt on SD boot partition to point root=/dev/sda2
It seems to boot correctly, register on the portal, then it loops on the portal with the following messages:
“
02.02.18 18:21:52 (+0100) Downloading application 'registry2.resin.io/smartcan/431af0b92f06fe25854f715e5c16a7050bc3c4e0’
02.02.18 18:26:46 (+0100) Failed to download application ‘registry2.resin.io/smartcan/431af0b92f06fe25854f715e5c16a7050bc3c4e0’ due to ‘failed to register layer: Error processing tar file(exit status 1): write /usr/local/luajit/lib/libluajit-5.1.so.2.1.0: no space left on device’
”
I have no clue what can be the issue… still searching… sorry, but if you have any tips to share, don’t hesitate;-)
Already found resin-raspberrypi/layers/meta-resin-raspberrypi/recipes-support/hostapp-update-hooks/files/99-rpi-bootloader which will be modify (script, I think, used to switch between images):
It implements explicit SD partition swap ( between /dev/mmcblk0p2 and /dev/mmcblk0p3 ) and just swapping 2 and 3 . I proposed a mod on github.
… but is there a fstab file? (I found 12 in running image) and is there a first boot script to expand partitions? I continue searching for a full working scenario with my PiDrive
The problem with your setup is pretty hard to fix: you will be having two devices with each having the same file system labels. Basically there will be two resin-rootA, two resin-boot etc. This is a very bad idea because it will race at runtime when mounting them. I would recommend you to look into raspberrypi USB boot. That’s what you are actually interested in and would be the cleanest solution. Otherwise you can try a hack where you keep the boot partition only on sd (and remove all the others) and the exactly opposite on the HDD.
Having only the /boot on the SD card, and reformatting the resin-boot on HD. (Easily done on any computer as this partition is FAT)
Do you think it is enough to run from HD? As I said, I found explicit reference of /dev/mmcblk0p2 and 3 (resin-rootA and resin-rootB), so I think code needs some modification, even if running in USB boot mode. As this beeing evaluated and planned into some next releases?
By experience, Raspberry SD cards have a limited lifespan … specifically when developing and pushing new releases … A HD is for me a must if you want to be running as IoT device
@agherzan, I am IN to help you on that, offcourse!
I don’t know if I can already do something now, otherwise, ping me when something is ready for alpha/beta testing and if I will do my best to get this enhancement integrated ASAP
I can edit /boot/commandline.txt to start with, but I will need some guidance to get it done or help on your github?!?
OK, thanks for all infos, it is clearer, I have 3 focal points (Boot with Partition Label, resize Data Partitiona dn switch root partitions).
I did a first quick test for step 1, so copyed the full image on HD, reformatted resin-boot, and copy/modified files from resin-boot on a FAT formatted (named resin-boot) SD card. new cmdline.txt:
But, it doesn’t boot! So, as of now, still looking to get it working this way (was OK with root=/dev/sda2 ), but would not be uniform so still searching…
I submitted 2 pull request on github, but will have to fix last issues to be fully fonctionnal. Now: boot and root partition switching would be using unified notations / partition labels.
(Have been misled by PartUUID and UUID exemples, sorry!)
So it only expands partition #6 (resin-data) but not partition #4 (extended partition that includes resin-data) so … it blocks the process … at least when achieved on the HD … seems
Would it be possible for you to set up a device where this issue is reproduced (i.e. data partition not expanding while the device has booted from usb) , and then grant support access to the device so that we can have a look?