Setting tty resolution | grub2

I have a Lenovo P14s Gen2 and a ThinkPad Thunderbolt 4 dock and I use both an external monitor connected to the dock but also the laptop screen. Currently the resolution on tty in laptop screen looks to be at 3840x2160 while external monitors looks to be at 2560x1440.

The external monitor is my main monitor and the laptop resolution makes the tty usage on it inconvenient. For example: I switch to tty and login and run dnf upgrade, if I just keep my eye on external monitor, the update seems to get stuck as the laptop screen display way more rows thus the output on the external monitor is incomplete.

Per How do I increase console-mode resolution? in AskUbuntu I tested on boot to hit e and add:

set gfxmode=1920x1080
set gfxpayload_linux=1920x1080x32

before the linux ... line, without avail. How can I lower the resolution on the laptop screen?

By tty do you mean that you are not using a desktop ennvironment?
You can override the screen resolution with a kernel command line option I believe.

But if you are using the Gnome or KDE then in the settings app change the resolution of the screen as you require.

Please check link on askubuntu he posted … I added “| grub2” to the title to clarify that the OP tried to change the kernel command line option while booting.

The example you posted shows that you have to edit more than one place to have success.

I add something like video=1280x720 to GRUB_CMDLINE_LINUX. The combination of monitor and GPU determines what values will be acceptable as just arbitrary values won’t work.

Edited the /etc/default/grub and /etc/grub.d/00_header and ran:

# grub2-mkconfig -o /boot/grub2/grub.cfg
# grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg

Based on this post in Fedora Discussion, GRUB_TERMINAL_OUTPUT should be set to gfxterm in /etc/default/grub. But that didn’t help either (also my grub reports that videoinfo command is not found).

Tested out by temporarily editing the boot entry on boot by appending video=1024x768 and on another boot video=1920x1080. Laptop screen stopped showing anything while external monitor seemed to use the specified resolution. Loosing the output in laptop screen in the console is not an issue for me (as stated in the starting post, external monitor is my main monitor) so I’ll add the video= option permanently with grubby and mark this as the solution.

This should never be done. /boot/efi/EFI/fedora/grub.cfg is a small config file which will refer to the real config file in /boot/grub2/grub.cfg.

This command breaks fedora with future kernel updates and since about Fedora 34 should never be run.
/boot/efi/EFI/fedora/grub.cfg was switched from the actual config file to a pointer file that redirects grub to read the actual file at /boot/grub2/grub.cfg. I believe this was done for consistency and so users only had to remember one location for the grub.cfg file instead of them being in different locations for systems using legacy boot or uefi boot.

$ ls -ld /etc/grub2*
lrwxrwxrwx. 1 root root   22 Feb  6 18:00 /etc/grub2.cfg -> ../boot/grub2/grub.cfg
lrwxrwxrwx. 1 root root   22 Feb  6 18:00 /etc/grub2-efi.cfg -> ../boot/grub2/grub.cfg

To restore update functionality the user must do the following

  1. sudo rm /boot/grub2/grub.cfg /boot/efi/EFI/fedora/grub.cfg
  2. sudo dnf reinstall grub2-common which will rebuild both those files with the proper content.

Thanks for the notice!

I should have been clearer.
Those changes, I think, change grub not the running kernel.
For that there are kernel command options.

1 Like

Added the video= permanently with grubby --args=video=1920x1080 --update-kernel=ALL. I’ll need to study the modedb default video mode support documentation to see if I can get the laptop screen to work also but if I have issues with it that’s a case for another topic.

Thanks for everyone who helped!