Showing posts with label GRUB. Show all posts
Showing posts with label GRUB. Show all posts

Friday, 29 December 2017

How to change the video resolution in Raspbian PC/Mac Pixel

In case you are not aware, you can also get Raspbian Pixel for your PC or Mac. It's a 32-bit Debian Stretch distro with Raspbian enhancements, notably the Pixel desktop.

One problem is that the default video mode after install is 640x480, rather limiting. I searched a bit for how to change the video resolution but most articles were about Raspbian on the RPi. However this GRUB documentation was the key.

To find the modes available to you, interrupt GRUB's booting with c, then at the grub> prompt, type videoinfo. You will get a list of available modes. This depends on your (real or virtual) video card. In my case I was running under VirtualBox and had sufficient video memory configured. Note a video mode you want, then as root (either via sudo or getting a root shell) do the following:

Edit /etc/default/grub. Change the entry GRUB_GFXMODE which is commented out by default to for example:

GRUB_GFXMODE=1280x1024x32

Check that the file also contains

GRUB_GFXPAYLOAD_LINUX=keep

Run update-grub, which will rewrite the grub.cfg file. Reboot and enjoy your new video resolution.

Addendum: I've found that when the VirtualBox guest additions are installed, a different resolution is used. This can be configured with the program lxrandr. I have to investigate under what circumstances the display switches from the resolution inherited from grub to its own setting.

Thursday, 10 November 2016

Reverting UEFI boot to MBR boot for CentOS/Redhat 6 on the HP z230

Why would you want to do this? In my case it is because the HP z230 workstation I am maintaining has two disks in software RAID1 and while /boot can be on a RAID1 array, and the boot loader can be installed in the MBR of both disks, so that boot can continue even if one disk fails, UEFI doesn't (as far as I know) provide this redundancy. If you know different, please write that up.

I had already configured UEFI boot on the workstation. This is what I had to do to change to MBR boot when I discovered that UEFI doesn't provide redundancy.

First do all the required kernel updates and check that UEFI boot works.

Then copy the contents of /usr/share/grub/x86_64-redhat to /boot/grub. The OS installer doesn't install the grub helper files when it detects that UEFI boot is active.

Next copy /boot/efi/EFI/redhat/grub.conf to /boot/grub. This is the reason for doing the kernel updates first so that grub.conf is up to date.

Shutdown and go into the BIOS and disable UEFI so the boot method is Legacy MBR.

Boot with the CentOS install DVD and select rescue mode. You'll need to let the rescue OS mount the root filesystem on /mnt/sysimage so that you can run grub-install. Get a shell and do chroot /mnt/sysimage, then run grub-install /dev/sda and grub-install /dev/sdb to install the boot loader on both disks.

Reboot and remove the DVD before startup. Now GRUB should boot from the hard disk. It also wanted to do a selinux relabel so plan for some downtime in case this happens.

Addendum 2016-11-10: Also ensure that /etc/grub.conf is a symlink to ../../boot/grub/grub.conf and not to the one in the EFI boot partition, otherwise kernel package updates will update the wrong grub.conf.

The instructions are for the HP z230 but may be applicable to your workstation. This assumes that your BIOS supports the legacy MBR boot method in addition to UEFI.