Is there a way to force CentOS to do a legacy-style boot install in the UEFI-style installer?
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I've got a strange situation at work, and I have about 700 systems that all are booting to EFI by default.
I have a PXE menu set up, and I can install CentOS - but the units need to swap to Legacy booting mode to continue in our process.
This presents a problem; once CentOS 7.4 is laid down in UEFI installer mode, it will not boot when the BIOS is swapped to Legacy mode.
How can I force CentOS 7.4, in an automated way, to do a Legacy-style bootloader install while running in UEFI mode?
centos software-installation grub2 uefi
add a comment |Â
up vote
1
down vote
favorite
I've got a strange situation at work, and I have about 700 systems that all are booting to EFI by default.
I have a PXE menu set up, and I can install CentOS - but the units need to swap to Legacy booting mode to continue in our process.
This presents a problem; once CentOS 7.4 is laid down in UEFI installer mode, it will not boot when the BIOS is swapped to Legacy mode.
How can I force CentOS 7.4, in an automated way, to do a Legacy-style bootloader install while running in UEFI mode?
centos software-installation grub2 uefi
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I've got a strange situation at work, and I have about 700 systems that all are booting to EFI by default.
I have a PXE menu set up, and I can install CentOS - but the units need to swap to Legacy booting mode to continue in our process.
This presents a problem; once CentOS 7.4 is laid down in UEFI installer mode, it will not boot when the BIOS is swapped to Legacy mode.
How can I force CentOS 7.4, in an automated way, to do a Legacy-style bootloader install while running in UEFI mode?
centos software-installation grub2 uefi
I've got a strange situation at work, and I have about 700 systems that all are booting to EFI by default.
I have a PXE menu set up, and I can install CentOS - but the units need to swap to Legacy booting mode to continue in our process.
This presents a problem; once CentOS 7.4 is laid down in UEFI installer mode, it will not boot when the BIOS is swapped to Legacy mode.
How can I force CentOS 7.4, in an automated way, to do a Legacy-style bootloader install while running in UEFI mode?
centos software-installation grub2 uefi
asked Jan 13 at 2:56
Locane
1155
1155
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
2
down vote
accepted
Yes. You can set the platform using --target
option with grub2-install
as follows
grub2-install --target=i386-pc /dev/sdX
i386-pc
option creates a legacy grub installation even in a UFI
booted platform.
NOTE You must have a small 1Mb unformatted partition with bios-boot
flag while installing legacy style grub with gpt
partition table.
You must also have grub create a config file, and then because the installer is in EFI mode, you must replace instances of EFI keywords with Legacy ones. Here is an example using awk:
#EXAMPLE: Normal grub make config command
#grub2-mkconfig > /boot/grub2/grub.cfg
#With awk statement to replace EFI keywords with legacy ones:
grub2-mkconfig |awk 'gsub("linuxefi /", "linux /");gsub("initrdefi /", "initrd /");print $0' > /boot/grub2/grub.cfg
1
+1 without thebios-boot
partition the grub installation will fail.
â GAD3R
Jan 13 at 16:38
I'm having a hell of a time getting this to work. The system reboots to a grub rescue prompt - grub2-install --target=i386-pc /dev/sda also doesn't place a grub.cfg. When I make it manually, it makes it with EFI linux references.
â Locane
Jan 14 at 22:25
@Locane Usegrub2-mkconfig
and redirect the output intogrub.cfg
. It'll auto detect all installed OSs (including Windows, if any) and will generategrub.cfg
for you..grub2-install
is not supposed to generate the configuration.
â Abhik Bose
Jan 15 at 0:08
Thanks @AbhikBose - I actually got that far (in my comment it says "when I make it manually") - it auto-detects EFI style installation, so the terms "linuxefi" and "initrdefi" replace "linux" and "initrd" respectively. I was able to get it to work by awking the output and just gusb()ing the terms; so linuxefi->linux and initrdefi->initrd.
â Locane
Jan 15 at 1:53
Can you edit your answer to include those two steps? "grub2-mkconfig > /boot/grub2/grub.cfg" and replace all instances of "linuxefi" with "linux" and "initrdefi" with "initrd"?
â Locane
Jan 15 at 1:55
 |Â
show 1 more comment
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
Yes. You can set the platform using --target
option with grub2-install
as follows
grub2-install --target=i386-pc /dev/sdX
i386-pc
option creates a legacy grub installation even in a UFI
booted platform.
NOTE You must have a small 1Mb unformatted partition with bios-boot
flag while installing legacy style grub with gpt
partition table.
You must also have grub create a config file, and then because the installer is in EFI mode, you must replace instances of EFI keywords with Legacy ones. Here is an example using awk:
#EXAMPLE: Normal grub make config command
#grub2-mkconfig > /boot/grub2/grub.cfg
#With awk statement to replace EFI keywords with legacy ones:
grub2-mkconfig |awk 'gsub("linuxefi /", "linux /");gsub("initrdefi /", "initrd /");print $0' > /boot/grub2/grub.cfg
1
+1 without thebios-boot
partition the grub installation will fail.
â GAD3R
Jan 13 at 16:38
I'm having a hell of a time getting this to work. The system reboots to a grub rescue prompt - grub2-install --target=i386-pc /dev/sda also doesn't place a grub.cfg. When I make it manually, it makes it with EFI linux references.
â Locane
Jan 14 at 22:25
@Locane Usegrub2-mkconfig
and redirect the output intogrub.cfg
. It'll auto detect all installed OSs (including Windows, if any) and will generategrub.cfg
for you..grub2-install
is not supposed to generate the configuration.
â Abhik Bose
Jan 15 at 0:08
Thanks @AbhikBose - I actually got that far (in my comment it says "when I make it manually") - it auto-detects EFI style installation, so the terms "linuxefi" and "initrdefi" replace "linux" and "initrd" respectively. I was able to get it to work by awking the output and just gusb()ing the terms; so linuxefi->linux and initrdefi->initrd.
â Locane
Jan 15 at 1:53
Can you edit your answer to include those two steps? "grub2-mkconfig > /boot/grub2/grub.cfg" and replace all instances of "linuxefi" with "linux" and "initrdefi" with "initrd"?
â Locane
Jan 15 at 1:55
 |Â
show 1 more comment
up vote
2
down vote
accepted
Yes. You can set the platform using --target
option with grub2-install
as follows
grub2-install --target=i386-pc /dev/sdX
i386-pc
option creates a legacy grub installation even in a UFI
booted platform.
NOTE You must have a small 1Mb unformatted partition with bios-boot
flag while installing legacy style grub with gpt
partition table.
You must also have grub create a config file, and then because the installer is in EFI mode, you must replace instances of EFI keywords with Legacy ones. Here is an example using awk:
#EXAMPLE: Normal grub make config command
#grub2-mkconfig > /boot/grub2/grub.cfg
#With awk statement to replace EFI keywords with legacy ones:
grub2-mkconfig |awk 'gsub("linuxefi /", "linux /");gsub("initrdefi /", "initrd /");print $0' > /boot/grub2/grub.cfg
1
+1 without thebios-boot
partition the grub installation will fail.
â GAD3R
Jan 13 at 16:38
I'm having a hell of a time getting this to work. The system reboots to a grub rescue prompt - grub2-install --target=i386-pc /dev/sda also doesn't place a grub.cfg. When I make it manually, it makes it with EFI linux references.
â Locane
Jan 14 at 22:25
@Locane Usegrub2-mkconfig
and redirect the output intogrub.cfg
. It'll auto detect all installed OSs (including Windows, if any) and will generategrub.cfg
for you..grub2-install
is not supposed to generate the configuration.
â Abhik Bose
Jan 15 at 0:08
Thanks @AbhikBose - I actually got that far (in my comment it says "when I make it manually") - it auto-detects EFI style installation, so the terms "linuxefi" and "initrdefi" replace "linux" and "initrd" respectively. I was able to get it to work by awking the output and just gusb()ing the terms; so linuxefi->linux and initrdefi->initrd.
â Locane
Jan 15 at 1:53
Can you edit your answer to include those two steps? "grub2-mkconfig > /boot/grub2/grub.cfg" and replace all instances of "linuxefi" with "linux" and "initrdefi" with "initrd"?
â Locane
Jan 15 at 1:55
 |Â
show 1 more comment
up vote
2
down vote
accepted
up vote
2
down vote
accepted
Yes. You can set the platform using --target
option with grub2-install
as follows
grub2-install --target=i386-pc /dev/sdX
i386-pc
option creates a legacy grub installation even in a UFI
booted platform.
NOTE You must have a small 1Mb unformatted partition with bios-boot
flag while installing legacy style grub with gpt
partition table.
You must also have grub create a config file, and then because the installer is in EFI mode, you must replace instances of EFI keywords with Legacy ones. Here is an example using awk:
#EXAMPLE: Normal grub make config command
#grub2-mkconfig > /boot/grub2/grub.cfg
#With awk statement to replace EFI keywords with legacy ones:
grub2-mkconfig |awk 'gsub("linuxefi /", "linux /");gsub("initrdefi /", "initrd /");print $0' > /boot/grub2/grub.cfg
Yes. You can set the platform using --target
option with grub2-install
as follows
grub2-install --target=i386-pc /dev/sdX
i386-pc
option creates a legacy grub installation even in a UFI
booted platform.
NOTE You must have a small 1Mb unformatted partition with bios-boot
flag while installing legacy style grub with gpt
partition table.
You must also have grub create a config file, and then because the installer is in EFI mode, you must replace instances of EFI keywords with Legacy ones. Here is an example using awk:
#EXAMPLE: Normal grub make config command
#grub2-mkconfig > /boot/grub2/grub.cfg
#With awk statement to replace EFI keywords with legacy ones:
grub2-mkconfig |awk 'gsub("linuxefi /", "linux /");gsub("initrdefi /", "initrd /");print $0' > /boot/grub2/grub.cfg
edited Jan 21 at 11:54
Jeff Schaller
31.8k848109
31.8k848109
answered Jan 13 at 3:09
Abhik Bose
1,5341217
1,5341217
1
+1 without thebios-boot
partition the grub installation will fail.
â GAD3R
Jan 13 at 16:38
I'm having a hell of a time getting this to work. The system reboots to a grub rescue prompt - grub2-install --target=i386-pc /dev/sda also doesn't place a grub.cfg. When I make it manually, it makes it with EFI linux references.
â Locane
Jan 14 at 22:25
@Locane Usegrub2-mkconfig
and redirect the output intogrub.cfg
. It'll auto detect all installed OSs (including Windows, if any) and will generategrub.cfg
for you..grub2-install
is not supposed to generate the configuration.
â Abhik Bose
Jan 15 at 0:08
Thanks @AbhikBose - I actually got that far (in my comment it says "when I make it manually") - it auto-detects EFI style installation, so the terms "linuxefi" and "initrdefi" replace "linux" and "initrd" respectively. I was able to get it to work by awking the output and just gusb()ing the terms; so linuxefi->linux and initrdefi->initrd.
â Locane
Jan 15 at 1:53
Can you edit your answer to include those two steps? "grub2-mkconfig > /boot/grub2/grub.cfg" and replace all instances of "linuxefi" with "linux" and "initrdefi" with "initrd"?
â Locane
Jan 15 at 1:55
 |Â
show 1 more comment
1
+1 without thebios-boot
partition the grub installation will fail.
â GAD3R
Jan 13 at 16:38
I'm having a hell of a time getting this to work. The system reboots to a grub rescue prompt - grub2-install --target=i386-pc /dev/sda also doesn't place a grub.cfg. When I make it manually, it makes it with EFI linux references.
â Locane
Jan 14 at 22:25
@Locane Usegrub2-mkconfig
and redirect the output intogrub.cfg
. It'll auto detect all installed OSs (including Windows, if any) and will generategrub.cfg
for you..grub2-install
is not supposed to generate the configuration.
â Abhik Bose
Jan 15 at 0:08
Thanks @AbhikBose - I actually got that far (in my comment it says "when I make it manually") - it auto-detects EFI style installation, so the terms "linuxefi" and "initrdefi" replace "linux" and "initrd" respectively. I was able to get it to work by awking the output and just gusb()ing the terms; so linuxefi->linux and initrdefi->initrd.
â Locane
Jan 15 at 1:53
Can you edit your answer to include those two steps? "grub2-mkconfig > /boot/grub2/grub.cfg" and replace all instances of "linuxefi" with "linux" and "initrdefi" with "initrd"?
â Locane
Jan 15 at 1:55
1
1
+1 without the
bios-boot
partition the grub installation will fail.â GAD3R
Jan 13 at 16:38
+1 without the
bios-boot
partition the grub installation will fail.â GAD3R
Jan 13 at 16:38
I'm having a hell of a time getting this to work. The system reboots to a grub rescue prompt - grub2-install --target=i386-pc /dev/sda also doesn't place a grub.cfg. When I make it manually, it makes it with EFI linux references.
â Locane
Jan 14 at 22:25
I'm having a hell of a time getting this to work. The system reboots to a grub rescue prompt - grub2-install --target=i386-pc /dev/sda also doesn't place a grub.cfg. When I make it manually, it makes it with EFI linux references.
â Locane
Jan 14 at 22:25
@Locane Use
grub2-mkconfig
and redirect the output into grub.cfg
. It'll auto detect all installed OSs (including Windows, if any) and will generate grub.cfg
for you.. grub2-install
is not supposed to generate the configuration.â Abhik Bose
Jan 15 at 0:08
@Locane Use
grub2-mkconfig
and redirect the output into grub.cfg
. It'll auto detect all installed OSs (including Windows, if any) and will generate grub.cfg
for you.. grub2-install
is not supposed to generate the configuration.â Abhik Bose
Jan 15 at 0:08
Thanks @AbhikBose - I actually got that far (in my comment it says "when I make it manually") - it auto-detects EFI style installation, so the terms "linuxefi" and "initrdefi" replace "linux" and "initrd" respectively. I was able to get it to work by awking the output and just gusb()ing the terms; so linuxefi->linux and initrdefi->initrd.
â Locane
Jan 15 at 1:53
Thanks @AbhikBose - I actually got that far (in my comment it says "when I make it manually") - it auto-detects EFI style installation, so the terms "linuxefi" and "initrdefi" replace "linux" and "initrd" respectively. I was able to get it to work by awking the output and just gusb()ing the terms; so linuxefi->linux and initrdefi->initrd.
â Locane
Jan 15 at 1:53
Can you edit your answer to include those two steps? "grub2-mkconfig > /boot/grub2/grub.cfg" and replace all instances of "linuxefi" with "linux" and "initrdefi" with "initrd"?
â Locane
Jan 15 at 1:55
Can you edit your answer to include those two steps? "grub2-mkconfig > /boot/grub2/grub.cfg" and replace all instances of "linuxefi" with "linux" and "initrdefi" with "initrd"?
â Locane
Jan 15 at 1:55
 |Â
show 1 more comment
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f416734%2fis-there-a-way-to-force-centos-to-do-a-legacy-style-boot-install-in-the-uefi-sty%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password