Ubuntu Core 18 can not find init

I have created a Core 18 image for our PC, here the json file:

{
“type”: “model”,
“series”: “16”,
“model”: “stealth-demo”,
“architecture”: “amd64”,
“base”: “core18”,
“kernel”: “pc-kernel=18”,
“gadget”: “pc=18”,
“authority-id”: “xhmfBp3zLFaGnZWriwXk7LAIesOMfk2T”,
“brand-id”: “xhmfBp3zLFaGnZWriwXk7LAIesOMfk2T”,
“timestamp”: “2019-04-11T07:58:27+00:00”,
“required-snaps”: [“ros-foundation-kinetic-canvas” ]
}

I have no problem, booting this image on VirtualBox or Multipass.

When I install it on the real computer, I use the dual USB technique, I boot from USB using a 18.04 install USB boot, choose Try Ubuntu and then use a terminal
to dd the image onto the disk.

The image then boot fine, I can go thru the first boot initialization sequence, no problem.
If I reboot the machine, the second reboot works most of the time but after that each time I reboot, the image fails to boot and can not find init.!

Here the error image:

I’m a bit lost on what is happening here.

That seems odd. @ogra, @ondra, ever seen anything like this?

sure … half a page above it likely says “writable partition not found” or something along these lines …

first step should be to take a look at /dev/disk/by-label if there is a “writable” (from the spawned initramfs shell)

yes there is a partition /dev/disk/by-label/writable

ls -l gives me this:
lrwxrwxrwx . 1 10 writable -> …/…/sdb3
lrwxrwxrwx . 1 . 10 writable -> …/…/sda2

So there is a second disk but we are not using it (yet) and the system should be all on sda, I’m wondering why sdB is being used.

Update, since Core18 was trying to access sdb, I disable sdb in the Bios as a test. Now it boots every single time.
So the next question: is there anything special I should do to build an Core18 image that can handle two physical disks?

Thanks for helping, it’s now working enough we can start testing our robot.

don’t give the second disc a partition with a writable label.

I don’t think I did that but I might have done some test on this disk before (hence the “writable” label might be there). I will do a full reformat and try again.

1 Like

@kyrofa @rvincent25 I have seen this quite a few times.
But’s let’s try if this is same issue, was this second boot of the device? Are you super sure first boot completed successfully?
I see this when following happens:

  • first boot fails, so snapd uninstalls core and kernel snaps, which means it removes symboling links in /var/lib/snapd/snaps pointing to not yet installed snaps in /var/lib/snapd/seed/snaps.
  • when device tries to boot second time, not initrd is looking for core snap at /var/lib/snapd/snaps
    but it ain’t there because snapd removed symlink because of failed boot

Your screenshot points to this because I can see that initrd is failing to see core and kernel snap…

@ondra, yes that was the problem. Our computer came pre-installed with ubuntu on the other partition.
Reformatting the other disks made the problem go away. Issue resolved.

1 Like