Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local disk boot failed: Missing mandatory option for class #1351

Open
BeingGod opened this issue Sep 13, 2021 · 5 comments
Open

Local disk boot failed: Missing mandatory option for class #1351

BeingGod opened this issue Sep 13, 2021 · 5 comments

Comments

@BeingGod
Copy link

BeingGod commented Sep 13, 2021

When I try to use warewulf to make stateful system, I meet a problem of boot failed. It may be /boot/grub2/grub.cfg missing some options. It’s OK when I try to boot system by PXE.

I follow below commands:

# Add GRUB2 bootloader and re-assemble VNFS image
[sms]# yum -y --installroot=$CHROOT install grub2 [sms]# wwvnfs --chroot $CHROOT

# Select (and customize) appropriate parted layout example
[sms]# cp /etc/warewulf/filesystem/examples/gpt_example.cmds /etc/warewulf/filesystem/gpt.cmds [sms]# wwsh provision set --filesystem=gpt "${compute_regex}"
[sms]# wwsh provision set --bootloader=sda "${compute_regex}"

Description: It have no boot options for Linux System. And missing mandatory option for `class`.
OS: CentOS 8.3
Kernel: 4.18.0-240
Version: ohpc 2.1

@juanmac17
Copy link

Hi, I have the same problem with Rocky_linux+Warewulf stateful installation.

@percyj-vcu
Copy link

I am having the same issue as above.

@surinco
Copy link

surinco commented Nov 24, 2021

Hi, I have had the same problem.
The error I get as mentioned above is:

image
missing mandatory option for 'class'

When I looked closely at the grub file (type e to change the grub file at boot or look in /boot/grub2/grub.cfg) there is a bug in the first line as follows:

image
there is a --class with nothing after it, basically two --class one after the other

my solution was when the compute node is provisioned the first time and before restarting, login and change the grub file and remove the extra --class.

This is a temporary fix, for a more permanent solution I cannot find the /boot/grub2/grub.cfg in the vnfs image on the master node. I have 10s of nodes to provision and it will be a hassle to change every single grub file manually.

I am not sure, but I beleive the grub.cfg file is created when the PXE boots and the node is being provisioned. There is probably a bug somewhere in the ohpc-warewulf or the grub2 scripts.

Someone with a better knowledge of ohpc should comment on this.

Hope this helps.

@j2322
Copy link

j2322 commented Feb 9, 2022

TL:DR: add GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)" to $CHROOT/etc/default/grub

In line 31 in /etc/grub.d/10_linux from the grub2-tools package (which should have also provided /etc/default/grub but for some reason did not)

if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
  ...
  CLASS="--class $(eval $(grep '^ID_LIKE=\|^ID=' /etc/os-release) ; [ -n "${ID_LIKE}" ] && echo ${ID_LIKE} || echo ${ID}) ${CLASS}"
else
  ...
  CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1|LC_ALL=C sed 's,[^[:alnum:]_],_,g') ${CLASS}"
fi

The grep doesn't work in the first half, in Rocky at least, the line is PLATFORM_ID="platform:el8" in /etc/os-release. As for the second half, GRUB_DISTRIBUTOR is usually set in the /etc/default/grub file but because it isn't installed it doesn't get set. Either way you get the empty "--class" argument. Really don't know where the fault lies, but just setting the GRUB_DISTRIBUTOR variable in /etc/default/grub in the image solved it for me.

@luciandf
Copy link

luciandf commented Feb 9, 2022

I am trying to run some nodes stateful but there is no grub file in $CHROOT/etc/default/. Also as soon as I add the
wwsh provision set --filesystem=gpt "${compute_regex}" command, I get an error at boot: /newroot/sbin/init could not be verified

Before that I get the /dev/sda is not ready error. How can I make /dev/sda ready at boot? If I boot stateless, /dev/sda appears in lsblk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants