SUSE Support

Here When You Need Us

Autoyast Fails to Set GRUB2 Bootloader Password

This document (7023468) is provided subject to the disclaimer at the end of this document.


SUSE Linux Enterprise Server 15 (SLES 15)
SUSE Linux Enterprise Server 12 Service Pack 3 (SLES 12 SP3)
SUSE Linux Enterprise Server 12 Service Pack 2 (SLES 12 SP2)


Created an AutoYaST control file as follows: In yast open the Autoinstallation Configuration, select system then bootloader, edit, and select the option to Protect Boot Loader with Password, and set the password, add all of the other settings, and save it. Use the saved AutoYaST control file to install a system. No password is set in /boot/grub2/grub.cfg.

Use the autoyast generated profile generates the error: Details: key not found: "partitions"

After the server is installed, you can manually run yast bootloader > Bootloader Options > Protect Bootloader with Password and correctly set the password. However AutoYaST does not set the password.


1. Run yast bootloader > Bootloader Options > Protect Bootloader with Password > Finish and quit yast to generate the /etc/grub.d/42_password file on a working server.
2. Add the /etc/grub.d/42_password file to your autoyast control file under the <files> tag.
3. Include an init script to rebuild the /boot/grub2/grub.cfg file with the /etc/grub.d/42_password and settings.
4. By default a password is needed only if you want to edit the grub menu configuration at boot because set unrestricted_menu="y". If you want to force a password prompt on each menu entry every time you boot the server, change from set unrestricted_menu="y" to set unrestricted_menu="n" in /etc/grub.d/42_password.

The follow is an example of the steps above applied to an autoyast control file.
  <files config:type="list">
      <file_contents><![CDATA[ #! /bin/sh
exec tail -n +3 $0
# File created by YaST and next YaST run probably overwrite it
set superusers="root"
password_pbkdf2 root
export superusers
set unrestricted_menu="y"
export unrestricted_menu
    <init-scripts config:type="list">
sed -i -e 's/showopts/ showopts/g' /etc/default/grub
grub2-mkconfig -o /boot/grub2/grub.cfg


The autoyast control file does not incorporate the bootloader password file automatically.


This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:7023468
  • Creation Date: 23-Oct-2018
  • Modified Date:03-Mar-2020
    • SUSE Linux Enterprise Server

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.