How exactly does linode boot a disk?
I am following these custom image instructions https://www.linode.com/docs/products/compute/compute-instances/guides/install-a-custom-distribution/.
I was able to boot a custom gentoo install, but I started with an "ext4" system disk, rather than "raw". Everything worked, except that grub-install needed the "--force" option since it didn't find an MBR on the system disk. I am wondering:
What is the difference between "raw" and "ext4" when creating linode disks - are "ext4" disks preformatted with "ext4" and if so, will they become equivalent to "raw" disks if I delete the disk/filesystem metadata?
How does linode boot a disk? Specifically I'm interested in grub boot… does the linode system simply search for /boot/grub and use the files it finds in there? Based on trial and error I've determined that an MBR is not necessary, so I'm curious to know exactly what is going on in the background.
LISH seems to be unable to display GNU screen based interfaces such as the GRUB boot menu. On the other hand, GLISH will display the GRUB boot menu successfully but will not respond to arrow key based navigation. If I have LISH and GLISH open at the same time the LISH terminal will successfully register the arrow key based navigation and I can see the response in the GLISH window. After I trigger a system boot in this manner (with separate LISH and GLISH terminals) the output is different - LISH prints some dmesg style output but never prints a login prompt, but GLISH prints some more typical boot data output and eventually gives me a login prompt. Can this be fixed? What am I doing wrong? I did modify grub.cfg in the manner suggested by the "Configure Lish Access" section of the above link.
Linode is a great service - Thanks!!!
1 Reply
Glad to hear you were able to get your custom image of Gentoo working. As with most things Linux, there's more than one way to achieve your goal. The process outlined in the guide is just the way that works for most custom distros.
Now, onto your questions:
"1. What is the difference between "raw" and "ext4" when creating linode disks - are "ext4" disks preformatted with "ext4" and if so, will they become equivalent to "raw" disks if I delete the disk/filesystem metadata?"
An ext4 disk is one that has an ext4 filesystem created on it already. If your distro is one that uses ext4 then it should be compatible. If you're using one that is not compatible (FreeBSD uses ZFS for example) then you'll want to use a raw disk, which doesn't have a file system on it when the disk is created.
I don't know for sure if your ext4 disk would become equivalent to a raw disk if you wipe the metadata. If getting a raw disk is your goal though, you're probably better off just creating a new raw disk and deleting the one that you were going to wipe.
"2. How does linode boot a disk? Specifically I'm interested in grub boot… does the linode system simply search for /boot/grub and use the files it finds in there? Based on trial and error I've determined that an MBR is not necessary, so I'm curious to know exactly what is going on in the background."
Correct - the boot process skips the BIOS and boot information is passed directly to the instance using qemu options, negating the need for an MBR, although you can still use one.
If you've selected GRUB2 as your kernel, qemu loads a GRUB image as the "kernel" and GRUB uses the info on your instance's grub.cfg
file to start the rest of the boot process. Again, this process skips the MBR but still uses GRUB allowing you to boot with a custom or distribution-supplied kernel.
"3. LISH seems to be unable to display GNU screen based interfaces such as the GRUB boot menu. On the other hand, GLISH will display the GRUB boot menu successfully but will not respond to arrow key based navigation. If I have LISH and GLISH open at the same time the LISH terminal will successfully register the arrow key based navigation and I can see the response in the GLISH window. After I trigger a system boot in this manner (with separate LISH and GLISH terminals) the output is different - LISH prints some dmesg style output but never prints a login prompt, but GLISH prints some more typical boot data output and eventually gives me a login prompt. Can this be fixed? What am I doing wrong? I did modify grub.cfg in the manner suggested by the "Configure Lish Access" section of the above link."
It's hard for me to say why Lish may be acting this way. Generally, Lish will print dmesg
output during the boot process and supply a login prompt when your instance has fully booted. I can say from my recent experience with installing FreeBSD, Lish was seemingly non-functional after boot but I was able to log in via SSH. After a few minutes of updates, I checked Lish again and the login prompt was visible.
It's worth noting that Weblish itself is a screen
session. If you press CTRL+A then D, you will detach the session and drop back to the host, allowing you to run commands like help
, version
, and jobs
.
Since you installed your custom distribution in a way that differs from the suggested process, it may be worth following the instructions in the guide to see if you get a different outcome with regards to Lish.