How to a New Boot Disk in Fedora 23 with UEFI

How to a New Boot Disk in Fedora 23 with UEFI
Well, THAT was a hell of a learning experience.  You know, I spent all this time learning about GRUB 2, the MBR, and bootloader operation in general, and just when I thought I really had the bootloader stuff down, I realized I had to learn about UEFI before I could consider myself to have mastered the area from a system administration perspective.
But that was a lot of junk to read, so I didn’t.
So then, I found I needed to swap out an SSD in my Fedora system so that I could replace it with a larger drive.  Of course, it had to be my boot volume.
THUS BEGAN MY QUEST.  I read quite a lot.  I can recommend this guy for a high-quality informal read in BIOS and UEFI technology.  But, I think I can make a quick and dirty SysAdmin overview for ya:
  1. As you know, Fedora boots using the GRand Unified Bootloader (GRUB) version 2.
  2. As you may know, GRUB 2 operates either with BIOS or UEFI firmware.
    1. If operating with BIOS firmware, GRUB 2 installs bootloader code at the beginning of a bootable disk, in what’s known as the Master Boot Record.  Even more particularly, it installs to s a very small space at the start of a disk within the MBR which exists prior to partition information (and then a second “Stage 1.5” is installed in a subsequent space).  Many people have experience with bootloaders wiping one another out (such as, say, Microsoft Windows and Fedora) during installation as they contend for this same extremely limited space.
    2. If operating with UEFI firmware, GRUB 2 installs bootloader code in a special EFI partition which must be formatted with the FAT 12, 16, or 32 file system (use mkfs.vfat in Fedora to create any of those file system types).  Technically, the UEFI specification describes a very specific implementation of the FAT file system, but Fedora’s mkfs.vfat command seems to produce file systems of UEFI’s liking.
      1. Once the UEFI bootloader code is in place, there is a final important step for system administrators, and that is to update the UEFI firmware’s boot manager to point to the new code.
That last step there was what had me hung up for about an hour.  Fedora, and GNU/Linux distributions in general, use a tool called efibootmgr to control the UEFI firmware’s boot manager from within the operating system.  That’s pretty sweet.  Amazingly enough, your motherboard is not likely to provide as much capability in managing the UEFI boot manager as this handy tool.  My motherboard doesn’t even seem to let me create boot entries within the UEFI interface, so I have to rely on efibootmgr.
If you check out the man page, you’ll see some pretty standard options.  Basically:
  • Use efibootmgr -v to list the boot manager entries in your UEFI firmware.
  • Use grep efibootmgr /var/log/anaconda/program.log to locate the command used by Fedora when your OS was installed.  It will look something like this:
    • efibootmgr -c -w -L Fedora -d /dev/sde -p 1 -l \EFI\fedora\shim.efi
      • The “-c” option creates a new boot entry
      • The “-w” option writes a signature to the MBR if necessary (which it is not, in a UEFI environment, so this can probably be dropped)
      • The “-L” option creates the name for the boot entry which you will see in your UEFI firmware
      • The “-d” option points to the disk device on which the EFI System Partition (your FAT file system) resides
      • The “-p” option indicates the partition number on the disk device on which the EFI Partition resides
      • The “l” option points to the code within the EFI partition which should be executed first by the UEFI firmware.
Now, armed with this super secret knowledge, you will be able to easily and handily create a new boot device on your Fedora system.  Really, all you have to do is:
  1. Create the necessary EFI and boot partitions on the new device
    1. sudo cfdisk /dev/sdb or whatever and make a 200MB EFI partition and a 500MB boot partition.
  2. Create the necessary file systems in the new partitions
    1. `sudo mkfs.vfat /dev/sdb1`
    2. sudo mkfs.ext4 /dev/sdb2
  3. Make some temporary locations and mount the partitions to them so you can modify their contents
    1. sudo mkdir /mnt/boot2 /mnt/efi2
    2. sudo mount /dev/sdb1 /mnt/efi2 && sudo mount /dev/sdb2 /mnt/boot2
  4. And then just rsync over your current boot and EFI partitions:
    1. sudo rsync -a /boot/ /mnt/boot2
    2. sudo rm -r /mnt/boot2/efi/EFI
    3. sudo rsync -a /boot/efi/ /mnt/efi2
  5. Now just fix your /etc/fstab so that the boot and EFI partitions point to the right new GUIDs
    1. Obtain the file system UUIDs from `cfdisk` (displayed at the bottom)
    2. Swap UUIDs in /etc/fstab
  6. And finally, use efibootmgr to create a new boot entry for your system which points to the proper boot device.
    1. You need only change the -d option in the command from your Anaconda program.log.
    2. You cannot rename UEFI boot manager entries with efibootmgr (sadly), so just delete the old entry after you prove that your system boots with the new entry.
And that is it!  Fantastico.
So whereas with older MBR/BIOS systems, you need to reinstall GRUB after installing Microsoft Windows (if you installed onto the same disk as your Fedora system) in order to overwrite the Windows bootloader in the MBR (and then chainload Windows with GRUB, making GRUB the sole true bootloader for the system), with EFI, you have more options.  You could create two separate EFI partitions for Windows and Fedora, or you could try to put all the bootloader code in a single EFI partition and use efibootmgr to create separate boot entries in your UEFI firmware to point to the same disk and partition, but separate bootloader code for each OS.
It’s actually a lot easier to manage, but it requires this additional understanding to get it right.  Once you know the sequence of events and the relationships between the components, managing issues becomes a lot easier.  If you are no longer able to boot Microsoft Windows on a dual-boot system from within your UEFI firmware, for example, you now know you simply need to boot into your GNU/Linux OS and use efibootmgr to create the appropriate entry.  If your Windows EFI partition was overwritten or the code was lost, you can attempt the use of Microsoft utilities (as described here) to repair that matter.

COMMENTS

Name

Ads Earning Guide,4,AdSense Alternatives,1,Affiliate Marketing,1,Anti-Hacking Solution,2,Bitcoin,1,Blogger SEO,1,Blogger Tutorials,26,Blogger Widget,1,Blogging Tips,11,Business and Marketing,9,BuySellAds,1,Content Marketing,3,Contextual Marketing,2,Copyrighting,1,CPC Keywords,1,Digital Marketing,7,Download,1,Drupal Theme,1,Drupal Tutorials,8,Earning Guide,4,eCommerce Solution,1,Email Marketing,3,Facebook Marketing,1,Games Source Code,2,Google AdSense,4,HTML Script,1,Infographics,2,Information Technology,8,Instagram Marketing,1,Joomla Tutorials,1,jQuery Script,1,JS Script,1,Keyword Research,3,Learn Code,3,Learn CSS,1,Learn HTML,1,Learn XML,2,Make Money Online,6,Media Dot Net,1,MySQL Tips,1,Off Page SEO,1,On Page SEO,2,Online Tools,4,Paid URL Shortener,1,PC Tutorials,7,PHP Development,1,PHP Script,3,PPD File Sharing,1,Reviews,1,SEO Tips,4,Social Marketing,3,Template and Theme,2,Video Marketing,3,Web Design,8,Web Hosting Reviews,1,Website Script,4,WordPress Plugin,2,WordPress Script,1,WordPress Security,2,WordPress Theme,1,WordPress Tools,1,WordPress Tutorial,2,WordPress Tutorials,5,YouTube,1,
ltr
item
Teach Sansar - Leading Digital Technology: How to a New Boot Disk in Fedora 23 with UEFI
How to a New Boot Disk in Fedora 23 with UEFI
Well, THAT was a hell of a learning experience. You know, I spent all this time learning about GRUB 2, the MBR, and bootloader operation in general, and just when I thought I really had the bootloader stuff down...
https://1.bp.blogspot.com/--xsLcjygGnY/Wod6WMXuCTI/AAAAAAAABlo/1BvuPDaIphAIxEwxY2ssqU0wh7QGalptQCLcBGAs/s640/How%2Bto%2Ba%2BNew%2BBoot%2BDisk%2Bin%2BFedora%2B23%2Bwith%2BUEFI.jpg
https://1.bp.blogspot.com/--xsLcjygGnY/Wod6WMXuCTI/AAAAAAAABlo/1BvuPDaIphAIxEwxY2ssqU0wh7QGalptQCLcBGAs/s72-c/How%2Bto%2Ba%2BNew%2BBoot%2BDisk%2Bin%2BFedora%2B23%2Bwith%2BUEFI.jpg
Teach Sansar - Leading Digital Technology
https://www.teachsansar.com/2018/02/how-to-new-boot-disk-in-fedora-23-with-uefi.html
https://www.teachsansar.com/
http://www.teachsansar.com/
http://www.teachsansar.com/2018/02/how-to-new-boot-disk-in-fedora-23-with-uefi.html
true
5329405941980539054
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS CONTENT IS PREMIUM Please share to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy