Cookie Consent by Free Privacy Policy Generator ๐Ÿ“Œ How-to: Migrate a CentOS installation from BIOS/Legacy boot to EFI boot.

๐Ÿ  Team IT Security News

TSecurity.de ist eine Online-Plattform, die sich auf die Bereitstellung von Informationen,alle 15 Minuten neuste Nachrichten, Bildungsressourcen und Dienstleistungen rund um das Thema IT-Sicherheit spezialisiert hat.
Ob es sich um aktuelle Nachrichten, Fachartikel, Blogbeitrรคge, Webinare, Tutorials, oder Tipps & Tricks handelt, TSecurity.de bietet seinen Nutzern einen umfassenden รœberblick รผber die wichtigsten Aspekte der IT-Sicherheit in einer sich stรคndig verรคndernden digitalen Welt.

16.12.2023 - TIP: Wer den Cookie Consent Banner akzeptiert, kann z.B. von Englisch nach Deutsch รผbersetzen, erst Englisch auswรคhlen dann wieder Deutsch!

Google Android Playstore Download Button fรผr Team IT Security



๐Ÿ“š How-to: Migrate a CentOS installation from BIOS/Legacy boot to EFI boot.


๐Ÿ’ก Newskategorie: Linux Tipps
๐Ÿ”— Quelle: reddit.com

Introduction

I've upgraded a small, private server from an Intel Atom D510 to an Intel Celeron J5005 and encountered the problem that the new board does not support BIOS/Legacy boot. So here is a small write-up on how you can achieve this without any data- or system-loss...if everything goes well, that is.

I've pieced this information together from several different sources, hence this write-up.

Reminder: We're going to change the partition layout. Every time before you touch the partitions you should make sure that you have a backup. These instructions have the potential to corrupt your data for good. Think about every step you're doing, and read every message and warning that is displayed on screen.

Prerequisites

I'm assuming you're having a system with a msdos partition table and an installed CentOS. What you need is a CentOS installation medium.

Conversion

These steps could most likely be done at least partially with the old board, but in my case I only noticed that problem after having migrated the hardware to the new board.

First, boot into the CentOS install medium, select the "Troubleshooting" option in the boot menu and "Rescue an CentOS installation".

Short detour, if your boot fails at this point and it can't mount the root/medium (dracut reports starting timeout scripts and drops you in a rescue shell), you most likely have a problem with the configuration of the medium you created. There is the problem that the boot configuration on the medium might not match the medium it was flashed onto. To remedy that, you have to replace the label/name of the medium in the "grub.cfg" and "syslinux.cfg" on the medium.

If the rescue system boots, Anaconda will automatically ask whether it should mount an existing installation, proceed with that. Another word of warning, some times it failed to find my installation, but after a reboot it worked. You're now in shell which allows you to chroot into the actual installation, if you want to, it's not necessary for changing the partition table/layout.

Converting the partition table

We will now convert from the msdos partition table to a GPT one. Have a good look at the backup you've made beforehand and ask yourself "can I lose all that data currently on this disk?", then continue confidently.

Now, we start gdisk. gdisk is basically parted but for GPT partitioned disks.

gdisk /dev/yourharddiskgoeshere 

It should now inform you right after the start that a msdos partition table was found, and it has been converted to a GPT one in memory. No changes have been done to disk at this point and quitting the application will not change your disk. You can type p to see the new layout of the disk. If you're happy with it, proceed to write the new layout with w.

Reboot back into the rescue system afterwards to make sure the changes are being picked up correctly.

Creating an EFI partition.

We will now create an additional EFI partition, around 30MB should me more than enough. If you don't have that much space left, resize another partition to get it. You can create the new partition directly in gdisk.

gdisk /dev/yourharddiskgoeshere

Then type n to create a new partition. The type of the partition will be "ef00", which dedicates it as an EFI partition. Whether or not the legacy boot flag (under expert/attributes x/a) must be set, is a little bit unclear, a few people reporting it to be necessary, it most likely depends on the board.

After the partition has been created and you have written the changes to the partition table with w, you must format the partition with FAT32. mkfs.fat is in the "dosfstools" package.

mkfs.fat -F32 -s1 /dev/yourefipartitiongoeshere 

The -F states the "type" of the FAT created, -s tells it to use one sector as one cluster.

Now that we have the partition set up, we can chroot into our system for the first time and add it to the "fstab".

chroot /mnt/sysimage 

The EFI partition should be mounted under "/boot/efi".

Install GRUB-EFI

Install "grub-efi" and "efibootmgr" on your system, if it is not already there.

Restoring GRUB and the boot process.

Make sure that the EFI partition is mounted. From here on the instructions are a little bit fuzzy, and I'm sorry for that, as I had trouble to get the machine to boot, so any of these steps might suffice.

First, reinstall GRUB to be able to boot from EFI.

grub2-install --target=x86_64-efi --bootloader-id=centos --boot-directory=/boot --efi-directory=/boot/efi --recheck --verbose /dev/yourharddiskgoeshere 

Now regenerate the "grub.cfg":

grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg 

My system still did not boot after that, as it failed to mount the root filesystem. What I had to do was reinstall the kernel:

yum reinstall kernel 

Or rather, as there were updates available, update the kernel:

yum update kernel 

Conclusion

From here on, your system should boot with EFI again, and behave otherwise quite as before.

submitted by /u/Bobby_Bonsaimind
[link] [comments] ...



๐Ÿ“Œ How-to: Migrate a CentOS installation from BIOS/Legacy boot to EFI boot.


๐Ÿ“ˆ 88.23 Punkte

๐Ÿ“Œ CentOS Blog: CentOS 8 and CentOS Stream updates, and feeds.centos.org


๐Ÿ“ˆ 38.4 Punkte

๐Ÿ“Œ Linux Kernel up to 5.1.5 efi Subsystem efi.c phys_efi_set_virtual_address_map denial of service


๐Ÿ“ˆ 36.33 Punkte

๐Ÿ“Œ Windows partion with mbr and Linux partion with efi. How to set up Grub in a multiboot situation with MBR and EFI.


๐Ÿ“ˆ 36.33 Punkte

๐Ÿ“Œ How to migrate from CentOS 8 to CentOS stream conversion


๐Ÿ“ˆ 35.63 Punkte

๐Ÿ“Œ Trying to move boot directory to a separate disk in order to boot from Nvme on a Legacy BIOS


๐Ÿ“ˆ 34.7 Punkte

๐Ÿ“Œ Error before installation [The attempt to mount a file system with type vfat in SSI1(0,0,0),partition#1(sda)at/boot/efi failed]


๐Ÿ“ˆ 34.35 Punkte

๐Ÿ“Œ How to migrate your VMs, databases, and apps to Azure using Azure Migrate


๐Ÿ“ˆ 32.85 Punkte

๐Ÿ“Œ Learn Live - Learn how Azure Migrate can help migrate Windows servers to Azure - Part 1


๐Ÿ“ˆ 32.85 Punkte

๐Ÿ“Œ Learn Live - Learn how Azure Migrate can help migrate Windows servers to Azure - Part 2


๐Ÿ“ˆ 32.85 Punkte

๐Ÿ“Œ How to switch UEFI BIOS to Legacy BIOS on a PC


๐Ÿ“ˆ 31.88 Punkte

๐Ÿ“Œ How to switch UEFI BIOS to Legacy BIOS on a PC


๐Ÿ“ˆ 31.88 Punkte

๐Ÿ“Œ Super UEFIinSecureBoot Disk. Boot any OS or launch any efi file without disabling UEFI Secure Boot.


๐Ÿ“ˆ 31.87 Punkte

๐Ÿ“Œ Super UEFIinSecureBoot Disk. Boot any OS or launch any efi file without disabling UEFI Secure Boot.


๐Ÿ“ˆ 31.87 Punkte

๐Ÿ“Œ Legacy Malware and Legacy Systems Are Not a Legacy Problem


๐Ÿ“ˆ 30.34 Punkte

๐Ÿ“Œ Intel: Sicherheitslรผcke erlaubt Zugriff auf BIOS/EFI


๐Ÿ“ˆ 29.05 Punkte

๐Ÿ“Œ CentOS Blog: CentOS 8 and CentOS Stream released


๐Ÿ“ˆ 28.8 Punkte

๐Ÿ“Œ CentOS Seven blog: CentOS Linux 6 to CentOS Linux 7 Upgrade Tool


๐Ÿ“ˆ 28.8 Punkte

๐Ÿ“Œ CentOS Seven blog: CentOS Linux can only come from the CentOS Project


๐Ÿ“ˆ 28.8 Punkte

๐Ÿ“Œ CentOS Seven blog: Seven.centos.org is dead .. long life to blog.centos.org !


๐Ÿ“ˆ 28.8 Punkte

๐Ÿ“Œ CentOS Seven blog: CentOS Linux can only come from the CentOS Project


๐Ÿ“ˆ 28.8 Punkte

๐Ÿ“Œ CentOS Blog: Update: State of CentOS Linux 8, and CentOS Stream


๐Ÿ“ˆ 28.8 Punkte

๐Ÿ“Œ CentOS Blog: CentOS Project shifts focus to CentOS Stream


๐Ÿ“ˆ 28.8 Punkte

๐Ÿ“Œ Dell Inspiron 7347 BIOS prior A13 UEFI BIOS Boot Services use after free


๐Ÿ“ˆ 28.62 Punkte

๐Ÿ“Œ Dell Inspiron 7352 BIOS UEFI BIOS Boot Service protection mechanism failure


๐Ÿ“ˆ 28.62 Punkte

๐Ÿ“Œ friend was going to install ubuntu on a laptop, but when in the bios, he accidently deleted windows boot manager file in the bios


๐Ÿ“ˆ 28.62 Punkte

๐Ÿ“Œ Trouble with Syslinux PXEBOOT: Need Help Combining EFI and Legacy Modes


๐Ÿ“ˆ 28.27 Punkte

๐Ÿ“Œ Is it a bad idea to dual boot OSes with one being installed in UEFI mode and the other in legacy BIOS mode?


๐Ÿ“ˆ 27.85 Punkte

๐Ÿ“Œ Migrate from legacy Service Scheduling to the Service Scheduling on Unified interface


๐Ÿ“ˆ 26.54 Punkte

๐Ÿ“Œ Snowflake and Mobilize.Net help customers efficiently migrate from legacy systems to the cloud


๐Ÿ“ˆ 26.54 Punkte

๐Ÿ“Œ KDE users of RHEL & CENTOS, which GUI will you migrate?


๐Ÿ“ˆ 26.03 Punkte











matomo