a1ive grub2 notes

Command list


Same as "test"


Load ACPI Table

Modern BIOS systems typically implement ACPI and define various tables to describe the interface between ACPI-compliant operating systems and firmware. In some cases, the tables provided by default apply only to certain operating systems, and it may be necessary to replace some of them.

In general, this command replaces the root system description pointer (RSDP) in the extended BIOS data area to point to the new table. If you use the –no-ebda option, only GRUB gets the new table, but GRUB's EFI emulation can use the new table.

  • --exclude = TABLE1, TABLE2, ..., -x do not load the list
  • --load-only = TABLE1, TABLE2, ..., -n load list
  • --v1, -1 import version 1 tables into the operating system
  • --v2, -2 Import version 2 and 3 tables into the operating system
  • --oemid = STRING, -o set OEMID of RSDP, XSDT and RSDT
  • --oemtable = STRING, -t set OEMTABLE ID for RSDP, XSDT and RSDT
  • --oemtablerev = n, -r set OEMTABLE version of RSDP, XSDT and RSDT
  • --oemtablecreator = STRING, -c Set OEMTABLE creator for RSDP, XSDT and RSDT.
  • --oemtablecreatorrev = n, -d Set the OEMTABLE creator version of RSDP, XSDT, and RSDT.
  • --no-ebda, -e Do not update EBDA. It can prevent some BIOS from crashing and has no effect on the OS that cannot receive RSDP from GRUB.
  • --slic, -s Load as SLIC, automatically modify OEMID and OEMTABLE ID.
  • --msdm display / load MSDM tables

appleloader CMDLINE

Apple legacy boot loader.

authenticate [userlist]

Check if the user is listed in the user list or in the value of the variable “superusers"

If Superuser is empty, this command returns true.

background_color COLOR

Set the background color of the active terminal

You can only change the background color when using "gfxterm". This command sets the color of the blank area without text. The text background color is controlled by the environment variables color_normal, color_highlight, menu_color_normal, menu_color_highlight.

background_image [OPTIONS] [FILE]

Set a background image for the active terminal

By default the image will be stretched to fill the entire screen (--mode = stretch)

Without parameters, the currently loaded background image will be deleted.

  • --mode = stretch / normal, -m set the background image mode to stretch or normal


Print traceback information

badram ADDR1, MASK1 [, ADDR2, MASK2 [,…]]

Shield bad memory

This command tells the memory manager that the specified area of ​​RAM should be filtered out. As long as the loaded kernel gets its memory map from GRUB, it remains valid after the kernel is loaded. The kernels that support this feature usually include Linux, GNU Mach, FreeBSD kernel and Multiboot kernel.

The syntax is the same as that provided by Memtest86 +: a list of address / mask pairs. Given a page-aligned address and a base address / mask pair, if all bits of the page-aligned address enabled by the mask match the base address, it means that the page will be filtered.

blocklist FILE

Print the block list of the file

blscfg FILE

Import BootLoaderSpec (BLS) configuration

bls_import FILE

Same as "blscfg"


Start the loaded operating system

btrfs-info DEVICE

Show device btrfs partition information

btrfs-mount-subvol DEVICE DIRECTORY SUBVOL

Set the btrfs device DIRECTORY directory as the mount point of the subvolume SUBVOL

btrfs-list-subvols [OPTIONS] DEVICE

Show all subvolumes on device DEVICE

  • --output = VARIABLE, -o save output as a variable
  • --path-only, -p only show the paths of subvolumes
  • --id-only, -i show only the ids of the subvolumes

btrfs-get-default-subvol [OPTIONS] DEVICE

Show default subvolume on device DEVICE

  • Same parameters as btrfs-list-subvols


Show text file content

  • --dos allow DOS format line breaks (CR-LF)
  • --set = VARIABLE, -s save the contents to a variable

chainloader [–force | –bpb] FILE [ADDR]

Start another bootloader, the default load address is 0x7c00


Launch EFI executable

Warning: Use this command may cause security issues

  • --alt, -a use GRUB 2's built-in EFI loader
  • --text, -t Convert to text mode before starting EFI
  • --boot, -b execute boot immediately

checktime minute hour day month day_of_week

Check whether the current time meets the requirements, if yes, returns 0, otherwise returns 1. The syntax is similar to cron under unix.

symbol significance Example
\ * Any value (note the asterisk escape) \ *
, List multiple values 10,20,30
- Range value 5-45
/ Step value 10/5


Clear Screen


Clear the current menu

Warning: Be sure to disable before using this command ESC export grub_disable_esc = 1

cmosclean byte: bit

Clear the value of the CMOS bit: byte: bit

Only available on platforms that support CMOS.


Show raw CMOS data

cmostest byte: bit

Test the value of CMOS at byte: bit

If the bit is set, true (0) is returned, otherwise non-zero.


Compare two files

If the two files have different sizes, the sizes are displayed separately. If the size is the same but the data is different, the first different position and data will be displayed. If they are identical, there is no output.


Enter the GRUB command line

configfile FILE

Load GRUB2 configuration file


Calculate the CRC32 check code of the file

cpuid [OPTIONS]

Checking CPU characteristics

Without parameters, the default parameter is -l. If the CPU supports this feature, it returns 0.

  • --long-mode, -l Check if the CPU supports 64-bit long mode
  • --pae, -p Check if the CPU supports physical address extension (PAE)

cryptomount DEVICE | -u UUID | -a | -b

Mount the encryption device (supports LUKS / geli), in some cases you need to enter the password interactively

  • --uuid, -u mount device by UUID
  • --all, -a mount all devices
  • --boot, -b mount all devices marked with "boot"

cutmem FROM [K | M | G] TO [K | M | G]

Delete all memory areas in the specified range

date [OPTIONS] [[year-] month-day] [hour: minute [: second]]

Show / set current time

  • --set = VARIABLE, -s save time to variable

decrement VARIABLE

Decrement the value of a variable by one

devicetree FILE

Load device tree blob (.dtb)