- Grub cmdline linux default параметры
- Углубление в параметры ядра. Часть 1: загрузочные параметры
- Знакомство с параметрами ядра
- Загрузочные параметры ядра
- 1. Универсальный способ—обновление загрузочных параметров через утилиту grubby
- Преимущества grubby
- Работа с grubby
- 2. Дистрибутивы Linux с Legacy GRUB
- Конфигурация GRUB
- Работа с конфигурацией GRUB
- 3. Дистрибутивы Linux с загрузчиком GRUB2
- Понимание конфигурации GRUB2
- Работа с конфигурацией GRUB2
- 4. Для инстансов EC2 на Ubuntu 14.04 / 16.04 / 18.04 / 20.04
Grub cmdline linux default параметры
The program grub-mkconfig (see Invoking grub-mkconfig) generates grub.cfg files suitable for most cases. It is suitable for use when upgrading a distribution, and will discover available kernels and attempt to generate menu entries for them.
grub-mkconfig does have some limitations. While adding extra custom menu entries to the end of the list can be done by editing /etc/grub.d/40_custom or creating /boot/grub/custom.cfg , changing the order of menu entries or changing their titles may require making complex changes to shell scripts stored in /etc/grub.d/ . This may be improved in the future. In the meantime, those who feel that it would be easier to write grub.cfg directly are encouraged to do so (see Booting, and Shell-like scripting), and to disable any system provided by their distribution to automatically run grub-mkconfig .
The file /etc/default/grub controls the operation of grub-mkconfig . It is sourced by a shell script, and so must be valid POSIX shell input; normally, it will just be a sequence of ‘ KEY=value ’ lines, but if the value contains spaces or other special characters then it must be quoted. For example:
Valid keys in /etc/default/grub are as follows:
The default menu entry. This may be a number, in which case it identifies the Nth entry in the generated menu counted from zero, or the title of a menu entry, or the special string ‘ saved ’. Using the id may be useful if you want to set a menu entry as the default even though there may be a variable number of entries before it.
For example, if you have:
then you can make this the default using:
Previously it was documented the way to use entry title. While this still works it’s not recommended since titles often contain unstable device names and may be translated
If you set this to ‘ saved ’, then the default menu entry will be that saved by ‘ GRUB_SAVEDEFAULT ’ or grub-set-default . This relies on the environment block, which may not be available in all situations (see Environment block).
The default is ‘ 0 ’.
If this option is set to ‘ true ’, then, when an entry is selected, save it as a new default entry for use by future runs of GRUB. This is only useful if ‘ GRUB_DEFAULT=saved ’; it is a separate option because ‘ GRUB_DEFAULT=saved ’ is useful without this option, in conjunction with grub-set-default . Unset by default. This option relies on the environment block, which may not be available in all situations (see Environment block).
Boot the default entry this many seconds after the menu is displayed, unless a key is pressed. The default is ‘ 5 ’. Set to ‘ 0 ’ to boot immediately without displaying the menu, or to ‘ -1 ’ to wait indefinitely.
If ‘ GRUB_TIMEOUT_STYLE ’ is set to ‘ countdown ’ or ‘ hidden ’, the timeout is instead counted before the menu is displayed.
If this option is unset or set to ‘ menu ’, then GRUB will display the menu and then wait for the timeout set by ‘ GRUB_TIMEOUT ’ to expire before booting the default entry. Pressing a key interrupts the timeout.
If this option is set to ‘ countdown ’ or ‘ hidden ’, then, before displaying the menu, GRUB will wait for the timeout set by ‘ GRUB_TIMEOUT ’ to expire. If ESC or F4 are pressed, or SHIFT is held down during that time, it will display the menu and wait for input. If a hotkey associated with a menu entry is pressed, it will boot the associated menu entry immediately. If the timeout expires before either of these happens, it will boot the default entry. In the ‘ countdown ’ case, it will show a one-line indication of the remaining time.
‘ GRUB_DEFAULT_BUTTON ’ ‘ GRUB_TIMEOUT_BUTTON ’ ‘ GRUB_TIMEOUT_STYLE_BUTTON ’ ‘ GRUB_BUTTON_CMOS_ADDRESS ’
Variants of the corresponding variables without the ‘ _BUTTON ’ suffix, used to support vendor-specific power buttons. See Vendor power-on keys.
Set by distributors of GRUB to their identifying name. This is used to generate more informative menu entry titles.
Select the terminal input device. You may select multiple devices here, separated by spaces.
Valid terminal input names depend on the platform, but may include ‘ console ’ (native platform console), ‘ serial ’ (serial terminal), ‘ serial_
’ (serial terminal with explicit port selection), ‘ at_keyboard ’ (PC AT keyboard), or ‘ usb_keyboard ’ (USB keyboard using the HID Boot Protocol, for cases where the firmware does not handle this).
The default is to use the platform’s native terminal input.
Select the terminal output device. You may select multiple devices here, separated by spaces.
Valid terminal output names depend on the platform, but may include ‘ console ’ (native platform console), ‘ serial ’ (serial terminal), ‘ serial_
’ (serial terminal with explicit port selection), ‘ gfxterm ’ (graphics-mode output), ‘ vga_text ’ (VGA text output), ‘ mda_text ’ (MDA text output), ‘ morse ’ (Morse-coding using system beeper) or ‘ spkmodem ’ (simple data protocol using system speaker).
‘ spkmodem ’ is useful when no serial port is available. Connect the output of sending system (where GRUB is running) to line-in of receiving system (usually developer machine). On receiving system compile ‘ spkmodem-recv ’ from ‘ util/spkmodem-recv.c ’ and run:
The default is to use the platform’s native terminal output.
If this option is set, it overrides both ‘ GRUB_TERMINAL_INPUT ’ and ‘ GRUB_TERMINAL_OUTPUT ’ to the same value.
A command to configure the serial port when using the serial console. See serial. Defaults to ‘ serial ’.
Command-line arguments to add to menu entries for the Linux kernel.
Unless ‘ GRUB_DISABLE_RECOVERY ’ is set to ‘ true ’, two menu entries will be generated for each Linux kernel: one default entry and one entry for recovery mode. This option lists command-line arguments to add only to the default menu entry, after those listed in ‘ GRUB_CMDLINE_LINUX ’.
As ‘ GRUB_CMDLINE_LINUX ’ and ‘ GRUB_CMDLINE_LINUX_DEFAULT ’, but for NetBSD.
As ‘ GRUB_CMDLINE_LINUX ’, but for GNU Mach.
The values of these options are passed to Xen hypervisor Xen menu entries, for all respectively normal entries.
The values of these options replace the values of ‘ GRUB_CMDLINE_LINUX ’ and ‘ GRUB_CMDLINE_LINUX_DEFAULT ’ for Linux and Xen menu entries.
List of space-separated early initrd images to be loaded from ‘ /boot ’. This is for loading things like CPU microcode, firmware, ACPI tables, crypto keys, and so on. These early images will be loaded in the order declared, and all will be loaded before the actual functional initrd image.
‘ GRUB_EARLY_INITRD_LINUX_STOCK ’ is for your distribution to declare images that are provided by the distribution. It should not be modified without understanding the consequences. They will be loaded first.
‘ GRUB_EARLY_INITRD_LINUX_CUSTOM ’ is for your custom created images.
The default stock images are as follows, though they may be overridden by your distribution:
Normally, grub-mkconfig will generate menu entries that use universally-unique identifiers (UUIDs) to identify the root filesystem to the Linux kernel, using a ‘ root=UUID=. ’ kernel parameter. This is usually more reliable, but in some cases it may not be appropriate. To disable the use of UUIDs, set this option to ‘ true ’.
If grub-mkconfig cannot identify the root filesystem via its universally-unique indentifier (UUID), grub-mkconfig can use the UUID of the partition containing the filesystem to identify the root filesystem to the Linux kernel via a ‘ root=PARTUUID=. ’ kernel parameter. This is not as reliable as using the filesystem UUID, but is more reliable than using the Linux device names. When ‘ GRUB_DISABLE_LINUX_PARTUUID ’ is set to ‘ false ’, the Linux kernel version must be 2.6.37 (3.10 for systems using the MSDOS partition scheme) or newer. This option defaults to ‘ true ’. To enable the use of partition UUIDs, set this option to ‘ false ’.
If this option is set to ‘ true ’, disable the generation of recovery mode menu entries.
Normally, grub-mkconfig will generate menu entries that use universally-unique identifiers (UUIDs) to identify various filesystems to search for files. This is usually more reliable, but in some cases it may not be appropriate. To disable this use of UUIDs, set this option to ‘ true ’. Setting this option to ‘ true ’, will also set the options ‘ GRUB_DISABLE_LINUX_UUID ’ and ‘ GRUB_DISABLE_LINUX_PARTUUID ’ to ‘ true ’, unless they have been explicilty set to ‘ false ’.
If graphical video support is required, either because the ‘ gfxterm ’ graphical terminal is in use or because ‘ GRUB_GFXPAYLOAD_LINUX ’ is set, then grub-mkconfig will normally load all available GRUB video drivers and use the one most appropriate for your hardware. If you need to override this for some reason, then you can set this option.
After grub-install has been run, the available video drivers are listed in /boot/grub/video.lst .
Set the resolution used on the ‘ gfxterm ’ graphical terminal. Note that you can only use modes which your graphics card supports via VESA BIOS Extensions (VBE), so for example native LCD panel resolutions may not be available. The default is ‘ auto ’, which tries to select a preferred resolution. See gfxmode.
Set a background image for use with the ‘ gfxterm ’ graphical terminal. The value of this option must be a file readable by GRUB at boot time, and it must end with .png , .tga , .jpg , or .jpeg . The image will be scaled if necessary to fit the screen.
Set a theme for use with the ‘ gfxterm ’ graphical terminal.
Set to ‘ text ’ to force the Linux kernel to boot in normal text mode, ‘ keep ’ to preserve the graphics mode set using ‘ GRUB_GFXMODE ’, ‘ width x height ’[‘ x depth ’] to set a particular graphics mode, or a sequence of these separated by commas or semicolons to try several modes in sequence. See gfxpayload.
Depending on your kernel, your distribution, your graphics card, and the phase of the moon, note that using this option may cause GNU/Linux to suffer from various display problems, particularly during the early part of the boot sequence. If you have problems, set this option to ‘ text ’ and GRUB will tell Linux to boot in normal text mode.
The grub-mkconfig has a feature to use the external os-prober program to discover other operating systems installed on the same machine and generate appropriate menu entries for them. It is disabled by default since automatic and silent execution of os-prober , and creating boot entries based on that data, is a potential attack vector. Set this option to ‘ false ’ to enable this feature in the grub-mkconfig command.
List of space-separated FS UUIDs of filesystems to be ignored from os-prober output. For efi chainloaders it’s @
Normally, grub-mkconfig will generate top level menu entry for the kernel with highest version number and put all other found kernels or alternative menu entries for recovery mode in submenu. For entries returned by os-prober first entry will be put on top level and all others in submenu. If this option is set to ‘ true ’, flat menu with all entries on top level will be generated instead. Changing this option will require changing existing values of ‘ GRUB_DEFAULT ’, ‘ fallback ’ (see fallback) and ‘ default ’ (see default) environment variables as well as saved default entry using grub-set-default and value used with grub-reboot .
If set to ‘ y ’, grub-mkconfig and grub-install will check for encrypted disks and generate additional commands needed to access them during boot. Note that in this case unattended boot is not possible because GRUB will wait for passphrase to unlock encrypted container.
Play a tune on the speaker when GRUB starts. This is particularly useful for users unable to see the screen. The value of this option is passed directly to play.
If this option is set, GRUB will issue a badram command to filter out specified regions of RAM.
This option may be set to a list of GRUB module names separated by spaces. Each module will be loaded as early as possible, at the start of grub.cfg .
The following options are still accepted for compatibility with existing configurations, but have better replacements:
Wait this many seconds before displaying the menu. If ESC or F4 are pressed, or SHIFT is held down during that time, display the menu and wait for input according to ‘ GRUB_TIMEOUT ’. If a hotkey associated with a menu entry is pressed, boot the associated menu entry immediately. If the timeout expires before either of these happens, display the menu for the number of seconds specified in ‘ GRUB_TIMEOUT ’ before booting the default entry.
If you set ‘ GRUB_HIDDEN_TIMEOUT ’, you should also set ‘ GRUB_TIMEOUT=0 ’ so that the menu is not displayed at all unless ESC or F4 are pressed, or SHIFT is held down.
This option is unset by default, and is deprecated in favour of the less confusing ‘ GRUB_TIMEOUT_STYLE=countdown ’ or ‘ GRUB_TIMEOUT_STYLE=hidden ’.
In conjunction with ‘ GRUB_HIDDEN_TIMEOUT ’, set this to ‘ true ’ to suppress the verbose countdown while waiting for a key to be pressed before displaying the menu.
This option is unset by default, and is deprecated in favour of the less confusing ‘ GRUB_TIMEOUT_STYLE=countdown ’.
Variant of ‘ GRUB_HIDDEN_TIMEOUT ’, used to support vendor-specific power buttons. See Vendor power-on keys.
This option is unset by default, and is deprecated in favour of the less confusing ‘ GRUB_TIMEOUT_STYLE=countdown ’ or ‘ GRUB_TIMEOUT_STYLE=hidden ’.
Источник
Углубление в параметры ядра. Часть 1: загрузочные параметры
EC2 (эластичное облако вычислений) — это наиболее часто используемый AWS-сервис, поскольку он надёжен, гибок и позволяет масштабируемость. EC2 можно назвать “хребтом” AWS, т.к. прямо или косвенно он задействуется во множестве других сервисов AWS. По большей части публичные AMI, предоставляемые Amazon и другими крупными вендорами, уже прошли тщательные испытания на пригодность использования в продакшене. Тем не менее иногда возникает необходимость подстройки поведения инстансов EC2 через изменение параметров их ядер.
В текущей серии статей мы рассмотрим, что представляют собой параметры ядра (включая параметры его загрузки), а также как изменять эти параметры для Amazon Linux 1/2, RHEL 5/6/7/8, CentOS 6/7, SLES 12/15 и Ubuntu 14.04/16.04/18.04/20.04 на инстансах AWS EC2. Это будет первой частью погружения в тему параметров ядра.
Знакомство с параметрами ядра
Ядро Linux — это сложный элемент ПО, чьё поведение, как и поведение любого другого ПО, зависит от параметров по умолчанию, установленных в коде самого этого ядра. К примерам этого поведения можно отнести то, как ядро управляет диском, памятью или загрузкой системы. Эти параметры определяют поведение Linux, и в целях корректировки поведения системы могут быть изменены как в процессе работы ядра, так и при его загрузке.
Существует 3 способа, с помощью которых вы можете добавлять или редактировать эти параметры. Выбор одного из них будет зависеть от конкретного случая.
- При загрузке ядра (загрузочные параметры). Эти параметры вызываются через загрузчика ОС.
- В процессе работы ядра через псевдо-файловые системы /proc и /sys, используя “sysctl”.
- При компиляции (или перекомпиляции) ядра и его подсистем (вроде initrd).
В этой статье я обширно рассмотрел загрузочные параметры ядра, а именно: что это такое и как их можно добавлять, редактировать или удалять. В дальнейших статьях серии я рассмотрю остальные 2 варианта с соответствующими примерами. Я также представлю вам пример проблемы, решённой мной в прошлом, относящийся к третьему варианту, чтобы сформировать полноценное понимание темы.
Загрузочные параметры ядра
В процессе загрузки Linux требуется ряд параметров, посредством которых ядру предоставляется информация об аппаратных средствах. В частности, нам приходится иметь дело с этими параметрами, когда ядро не способно определить конкретный параметр самостоятельно, и мы добавляем его вручную. А иногда мы редактируем параметры для переопределения их значений, обнаруживаемых ядром.
За загрузку и запуск ядра Linux отвечает загрузчик ОС, поэтому, чтобы иметь возможность передать параметры загрузки, мы используем специализированный загрузчик вроде GRUB.
Загрузочные параметры ядра определяются в виде списка строк, разделённых пробелами следующим образом:
name[=value_1][,value_2]…[,value_10].
На данный момент код ядра может обрабатывать максимум 10 отделённых запятыми значений параметров. Тем не менее допускается переиспользование одного и того же ключевого слова.
К примеру, приведу конфигурацию grub для инстанса на Amazon Linux 1. В ней я изменил параметр “console”, определив для него 2 значения (допускается до 10).
Мы можем также предоставить ядру параметры загрузки, приведённые ниже. Здесь вместо определения значений “console” в виде одного параметра мы повторно использовали console для определения другого значения. При необходимости каждый параметр “console” может содержать до 10 значений, что позволяет выйти за рамки предыдущих ограничений.
Существует несколько способов изменения загрузочных параметров ядра. Кроме того, все дистрибутивы Linux (кроме Ubuntu), упомянутые ранее, используют схожие шаги для изменения этих параметров.
1. Универсальный способ—обновление загрузочных параметров через утилиту grubby
grubby— это инструмент командной строки для обновления и отображения информации о файлах конфигурации загрузчика. grubby отлично работает со всеми дистрибутивами Linux, включая Amazon Linux 1/2, RHEL 5/6/7/8, CentOS 6/7 и SLES 12/15, но при этом не дружит с Ubuntu.
PS: grubby по умолчанию установлен на все дистрибутивы Linux, кроме SLES. Инструкции по его установке вы можете найти в разделе “Добавить репозиторий и установить вручную” здесь.
Преимущества grubby
Работа с таким инструментом, как grubby, предоставляет множество преимуществ, включая простоту и согласованность во многих дистрибутивах. Для использования grubby вам также не нужно обладать глубокими познаниями об его файлах конфигурации. Например, вы можете получить рабочее ядро при помощи одной команды:
Обратите внимание, что это текущая версия ядра. Вы получите её же при помощи команды “uname-r” (текущая версия ядра) или через запись меню “default” в файле конфигурации. Более подробную информацию вы можете получить при помощи опции -info (аналогично использованию файла конфигурации):
Попробуйте также опцию “grubby -info ALL”.
С остальными опциями вы можете ознакомиться при помощи “grubby -help”.
В процессе загрузки загрузчик передаёт параметры ядру Linux в буфер памяти под названием kernel command line (командная строка ядра). Файл /proc/cmdline в псевдо-файловой системе /proc также содержит копию этих параметров. Проверить это мы можем при помощи следующей команды:
Работа с grubby
Чтобы добавить/изменить параметры ядра посредством grubby, нам нужно указать параметры при помощи -args=args совместно с опцией -update-kernel=default-kernel-path. Например, я добавил параметры “clocksource=tsc tsc=reliable”. Параметр “clocksource=tsc” устанавливает источник тактовой частоты как tsc (clocksource=tsc), если он ещё таковым не установлен. Параметр же “tsc=reliable” отключает все проверки стабильности TSC в процессе загрузки.
PS. Для удаления существующих параметров используйте команду -remove-arguments.
Перезагрузите систему и убедитесь, что параметры “clocksource=tsc tsc=reliable” добавлены:
Либо просто проверьте это через grubby:
В дальнейшем вы можете убедиться, что источником тактовой частоты определён tsc, при помощи следующей команды:
Это всё, что касается grubby.
2. Дистрибутивы Linux с Legacy GRUB
Amazon Linux 1 аналогично RHEL6.X, RHEL5.X и CentOS использует в качестве загрузчика GRUB (также известный как Legacy RUB). Узнать версию в подобных дистрибутивах вы можете так:
Файл конфигурации GRUB располагается в /boot/grub/grub.conf и содержит две символические ссылки на себя: /etc/grub.conf и /boot/grub/menu.lst. Нам нужно изменить эту конфигурацию grub, добавив дополнительные параметры загрузки ядра. Однако, чтобы сделать это эффективно, давайте сначала разберём основы конфигурации grub. Ниже приведён её пример из инстанса EC2 Amazon Linux 1.
Конфигурация GRUB
Здесь, как вы видите, присутствует более 1 записи меню. Запись меню наряду с параметрами содержит информацию о расположении образов ядра и initrd. Каждая запись начинается с “title…” и содержит численный порядок, начиная с 0. Значение “default” определяет текущий образ ядра, который используется для загрузки serve=. В конфигурации, приведённой выше, значение представлено как “0”. Это означает, что действует первая запись меню (4.14.181–108.257.amzn1.x86_64). Давайте взглянем на строку ядра. Вся структура name[=value_1], указанная после местоположения образа ядра (выделена жирным курсивом и разделена пробелами), представляет параметры загрузки:
kernel /boot/vmlinuz-4.14.181–108.257.amzn1.x86_64 root=LABEL=/ console=tty1 console=ttyS0 selinux=0 nvme_core.io_timeout=4294967295
Важно знать её, чтобы добавлять параметры в правильную запись меню.
Работа с конфигурацией GRUB
Теперь отредактируйте файл конфигурации (/etc/grub.conf) в предпочтительном редакторе и добавьте/измените нужные вам параметры. Я добавил те же параметры “clocksource=tsc tsc=reliable”, что и ранее.
kernel /boot/vmlinuz-4.14.181–108.257.amzn1.x86_64 root=LABEL=/ console=tty1 console=ttyS0 selinux=0 nvme_core.io_timeout=4294967295 clocksource=tsc tsc=reliable
Перезапустите систему, чтобы изменения вступили в силу. Проверить это мы можем тем же способом, что и в опции 1:
Несмотря на то, что эта опция работает прекрасно и широко используется, её недостаток в том, что она требует от вас наличия базового понимания конфигурации grub. Кроме того, вам нужно знать, какая запись меню активна и где изменять параметры.
3. Дистрибутивы Linux с загрузчиком GRUB2
Amazon Linux 2, так же как RHEL7.X, CentOS7, SLES15 и SLES12, использует в качестве загрузчика GRUB2. Узнать версию такого дистрибутива вы можете следующим образом:
Для систем, по умолчанию использующих загрузчик GRUB2, конфигурация этого загрузчика размещается в /boot/grub2/grub.cfg. Управлять этим файлом должен только сам GRUB2, поскольку он генерирует его автоматически посредством grub2-mkconfig с использованием шаблонов из каталога /etc/grub.d и файла /etc/default/grub. Об этом мы поговорим чуть позже.
Понимание конфигурации GRUB2
PS. Если вы используете инстансы из семейства ARM, упомянутые здесь и здесь, то конфигурация grub должна располагаться где-то в каталоге /boot/efi/EFI. К примеру, для RHEL7, работающего на ARM, это будет /boot/efi/EFI/redhat/grub.cfg.
Загрузочные параметры ядра дистрибутивов, использующих GRUB2, определены в каталоге /etc/default/grub. Давайте взглянем на пример из инстанса на Amazon Linux 2:
“GRUB_CMDLINE_LINUX_DEFAULT” содержит загрузочные параметры (командной строки) ядра. Это строка, в которой мы редактируем конфигурацию grub для изменения загрузочных параметров.
GRUB_CMDLINE_LINUX_DEFAULT=”console=tty0 console=ttyS0,115200n8 net.ifnames=0 biosdevname=0 nvme_core.io_timeout=4294967295
Работа с конфигурацией GRUB2
Отредактируйте файл конфигурации grub (/etc/default/grub.conf) с помощью предпочтительного редактора. Добавьте/измените интересующие вас параметры для строки GRUB_CMDLINE_LINUX_DEFAULT. Например, я добавил параметры systemd.log_level=debug systemd.log_target=console. Эти дополнительные параметры активируют режим отладки системы и перенаправляют в консоль. Итак, после обновления моя запись в файле /etc/default/grub будет выглядеть примерно так:
GRUB_CMDLINE_LINUX_DEFAULT=”console=tty0 console=ttyS0,115200n8 net.ifnames=0 biosdevname=0 nvme_core.io_timeout=4294967295 rd.emergency=poweroff rd.shell=0 systemd.log_level=debug systemd.log_target=console”
Теперь, чтобы автоматически сгенерировать конфигурацию grub2 на основе добавленных параметров, нам нужно запустить grub2-mkconfig, добавив путь к этой конфигурации:
Перезагрузите систему и проверьте, вступили ли изменения в силу из /proc/cmdline, как мы делали ранее.
4. Для инстансов EC2 на Ubuntu 14.04 / 16.04 / 18.04 / 20.04
GRUB2 является предустановленным загрузчиком и менеджером для Ubuntu, начиная с версии 9.10. Именно поэтому процесс изменения загрузочных параметров ядра практически такой же, как и для других дистрибутивов Linux с GRUB2, которые мы рассмотрели выше.
В данном случае местоположением файла конфигурации будет /etc/default/grub.d/50-cloudimg-settings.cfg.
Для добавления параметров откройте в редакторе /etc/default/grub.d/50-cloudimg-settings.cfg и измените нужные параметры в GRUB_CMDLINE_LINUX_DEFAULT, как мы делали ранее.
После этого выполните команду update-grub, чтобы повторно сгенерировать уже обновлённую конфигурацию grub:
PS. update-grub — это альтернатива или, так скажем, сокращённая версия команды grub-mkconfig -o /boot/grub/grub.cfg.
На этом всё. Надеюсь, эта статья была для вас полезна. Во второй её части мы поговорим о параметрах выполнения ядра и многом другом.
Источник