Fedora Linux Support Community & Resources Center
  #1  
Old 4th December 2016, 09:07 PM
wodel Offline
Registered User
 
Join Date: Sep 2015
Location: Algeria
Posts: 2
linuxfedorafirefox
Install a second Fedora on UEFI system on the same disk

Hi,

When we install a Fedora or CentOS, RHEL, openSuse ...etc, on a UEFI system, we have to create /boot/efi partition. In that partition the installer software creates a directory that belongs to the system being installed, for example, for Fedora it's a fedora directory.

My problem, is when I need to install a second fedora on the same disk, regardless of the version, for example, I need FC23 to use some applications and FC25 to test the new distribution. The installer of the FC25 will use the same directory on /boot/efi/EFI/fedora to put the boot loader stuff, and things get missed up then between the two distributions.

The installer doesn't offer any way to create or change the directory's name during the installation, so I had to do it manually, create a new dir on /boot/efi/EFI/fedora23, copy all files in it, then use efibootmgr to complete the modifications.

Is there any other way to do this during the install process? Could for example the installer be changed to use the name and the version of the distribution, instead of the name alone, thus this is not a permanent solution, if we want to install two FC23 on the same disk.

The same problem, will arise with the other distributions.

thanks in advance.
Excuse the English.
__________________
Simbad the Marine
FC24/FC25/openSuse Leap 42.2

Last edited by wodel; 5th December 2016 at 08:11 AM. Reason: correct a statement
Reply With Quote
  #2  
Old 4th December 2016, 09:53 PM
satanselbow Offline
Registered User
 
Join Date: Apr 2011
Location: Rainham, Essex, UK
Posts: 264
linuxchrome
Re: Install a second Fedora on UEFI system on the same disk

AFAIK it is not possible to change/edit/amend an existing EFI boot entry and your existing procedure (copy to new name, delete old entry) is the only way to achieve the task.

This kubuntu forum post is one of the go to posts on the subject.

As it happens I have yet to change my "fedora" to "fedora25" - so thank you for reminding me to keep up on my housekeeping

It would be more useful to have version specific, or custom user entries in the 1st place in my opinion ie "fedora26".
Reply With Quote
  #3  
Old 5th December 2016, 05:01 AM
nobody Offline
Registered User
 
Join Date: Mar 2012
Location: München, Deutschland
Posts: 652
windows_98_nt_2000chrome
Exclamation Re: Install a second Fedora on UEFI system on the same disk

Quote:
Originally Posted by wodel View Post
When we install a Fedora or CentOS, RHEL, openSuse ...etc, on a UEFI system, we have to create /boot/efi partition. In that partition the installer software creates a directory that belongs to the system being installed, for example, for Fedora it's a fedora directory.
Correct!

Here is my recommendation for you (please, replace Ubuntu with F23):
http://forums.fedoraforum.org/showpo...29&postcount=2

And you might want to install rEFInd (introduced by satanselbow): http://www.rodsbooks.com/efi-bootloaders/refind.html

Please, let us know how it goes!

_nobody_
__________________
I am nobody, and nobody is perfect, therefore I am perfect!
Reply With Quote
  #4  
Old 5th December 2016, 08:59 AM
satanselbow Offline
Registered User
 
Join Date: Apr 2011
Location: Rainham, Essex, UK
Posts: 264
linuxchrome
Re: Install a second Fedora on UEFI system on the same disk

Quote:
Originally Posted by nobody View Post
Correct!

Here is my recommendation for you (please, replace Ubuntu with F23):
http://forums.fedoraforum.org/showpo...29&postcount=2

And you might want to install rEFInd (introduced by satanselbow): http://www.rodsbooks.com/efi-bootloaders/refind.html

Please, let us know how it goes!

_nobody_
Personally I would avoid rEFInd where possible although it does have it's uses in certain scenarios.

In the specific situation you posted about the efibootmfr -L method should suffice.
Reply With Quote
  #5  
Old 5th December 2016, 04:07 PM
kldixon Offline
Registered User
 
Join Date: Aug 2005
Posts: 618
linuxfedorafirefox
Re: Install a second Fedora on UEFI system on the same disk

As far as I am aware, there is no way to get anaconda to install the boot loader anywhere other than \EFI\fedora. Also, the shim package overwrites entries in /boot/efi/EFI/BOOT/.
However, I have been installing two releases of Fedora on the same disc of a UEFI machine for many years.

Before installing the second release, (usually the latest but I like to keep the previous release, as yourself) I do the following on the current release:-

1) Copy the grub.cfg to a release specific file name.
Code:
# cp /boot/efi/EFI/fedora/grub.cfg /boot/efi/EFI/fedora/grub_23.cfg
At this point you might like to backup the ESP somewhere in case of a disaster.

2) Exclude the grub2 and shim packages from yum and dnf.
These packages are going to be upgraded and owned by Fedora 25. You do not want Fedora 23 updating them as well.
Code:
# echo "exclude=grub2-efi grub2-efi-modules grub2-tools shim mokutil" >> /etc/yum.conf 
# echo "exclude=grub2-efi,grub2-efi-modules,grub2-tools,shim,mokutil" >> /etc/dnf/dnf.conf
3) The kernel package uses new-kernel-pkg to update the kernel. (Recently, F21 or F22, it seems kernel installation has been taken over by systemd but new-kernel-pkg is still called, eventually, via the kernel-core package.) On a x86_64 efi system, new-kernel-pkg uses the symbolic link, /etc/grub2-efi.cfg, to find the grub.cfg. So, change that symbolic link to point to the release specific file instead of the default, ../boot/efi/EFI/fedora/grub.cfg.
Code:
# mv /etc/grub2-efi.cfg /etc/grub2-efi.cfg.orig
# ln -s ../boot/efi/EFI/fedora/grub_23.cfg /etc/grub2-efi.cfg
Check that the symbolic link works
Code:
# less /etc/grub2-efi.cfg
That symbolic link was originally installed by the grub2-efi package which we have excluded from yum and dnf so will not be overwritten by an update.

Now install Fedora 25. This will overwrite grub.cfg but leave grub_23.cfg.

My ESP is the first partition of the first disc so I add the following boot menu entry to the new /boot/efi/EFI/fedora/grub.cfg after the entries for Fedora 25.
Code:
menuentry 'Fedora 23' {
        configfile (hd0,gpt1)/EFI/fedora/grub_23.cfg
}
Selecting this menu entry causes grub to switch to the Fedora 23 grub.cfg.
I also comment out the os-prober section of grub.cfg as the above method is far more elegant.

You will need an editor with root priviledges to edit grub.cfg. I log into a console as root and use nano.

Now, when you update the kernel under Fedora 23, grub_23.cfg will be updated, and when you update the kernel under Fedora 25, grub.cfg will be updated.

Last edited by kldixon; 5th December 2016 at 04:15 PM.
Reply With Quote
  #6  
Old 3rd March 2017, 02:28 PM
dswaner Offline
Registered User
 
Join Date: Nov 2008
Posts: 211
linuxfedorafirefox
Re: Install a second Fedora on UEFI system on the same disk

Thanks to kldixon for the excellent How-To. However, Secure Boot is active on my PC, and the configfile that works for kldixon didn't work for me - it would just "return" without branching to the new grub.cfg. However, the following did work:

menuentry 'Fedora Mate 25' {
insmod part_gpt
insmod fat
set root='hd0,gpt1'
configfile /EFI/fedora/grub_F25_Mate.cfg
}
Reply With Quote
  #7  
Old 8th March 2017, 04:44 PM
dswaner Offline
Registered User
 
Join Date: Nov 2008
Posts: 211
linuxfedorafirefox
Re: Install a second Fedora on UEFI system on the same disk

The original configfile technique specified by kldixon now works for me. The new technique also works. I have no idea why the former did not work, or why it suddenly stared working. It may be related to another grub problem which also magically auto-corrected (313445).
Reply With Quote
  #8  
Old 10th March 2017, 04:37 AM
amiga Offline
Registered User
 
Join Date: Aug 2007
Posts: 71
linuxfirefox
Re: Install a second Fedora on UEFI system on the same disk

Quote:
I also comment out the os-prober section of grub.cfg as the above method is far more elegant.
It is far more elegant to simply disable the os-prober generation by adding the following line to /etc/default/grub

GRUB_DISABLE_OS_PROBER=true

Quote:
You will need an editor with root priviledges to edit grub.cfg. I log into a console as root and use nano.
You shouldn't edit grub.cfg directly as it is a generated file. Add any custom targets to the file 40_custom in the /etc/grub.d dirirectory. If you have sudo set up

sudo nano /etc/grub.d/40_custom

should work. Then simply regenerate grub.cfg with grub2-mkconfig
Reply With Quote
  #9  
Old 10th March 2017, 10:16 AM
kldixon Offline
Registered User
 
Join Date: Aug 2005
Posts: 618
linuxfedorafirefox
Re: Install a second Fedora on UEFI system on the same disk

I have never found it necessary to run grub2-mkconfig.
If you need to run it for some reason then you need to edit /etc/default/grub and the files in /etc/grub.d/, as you suggest, but if not, you can edit grub.cfg directly. In particular, kernel updates do not run grub2-mkconfig.
The osprober entries I comment out are those created during OS installation by anaconda, presumably by a call of grub2-mkconfig. You cannot control the details of what is created at installation time.
Reply With Quote
Reply

Tags
disk, fedora, install, uefi

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
installing Fedora on UEFI sata III disk abk4523 Installation, Upgrades and Live Media 32 3rd December 2016 04:10 PM
Installing Fedora 21/22 on UEFI system ioooo Installation, Upgrades and Live Media 12 30th May 2015 05:00 PM
Can't install f21 beta on asus m5a99x mobo - ERROR - for a UEFI install need GPT disk floydsmith Hardware & Laptops 0 26th November 2014 08:47 PM
Installing Fedora 17 using USB pendrives on UEFI system toMeloos Installation, Upgrades and Live Media 5 18th July 2012 07:23 AM
UEFI - how to install Fedora twice on same disk? (without breaking boot) interzoneuk Using Fedora 5 6th July 2012 09:50 PM


Current GMT-time: 19:39 (Wednesday, 26-04-2017)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat