{"id":2466,"date":"2018-03-14T22:47:48","date_gmt":"2018-03-15T05:47:48","guid":{"rendered":"http:\/\/rglinuxtech.com\/?p=2236"},"modified":"2018-03-14T22:47:48","modified_gmt":"2018-03-15T05:47:48","slug":"linux-dual-boot-nasty-hack-2","status":"publish","type":"post","link":"https:\/\/rglinuxtech.com\/?p=2466","title":{"rendered":"Linux &#8211; Dual-Boot Nasty Hack.."},"content":{"rendered":"<p>I am setting up an HP Z820 as &#8211; primarily &#8211; a video creating\/editing\/restoring system, but I need to be able to boot into Windows 7 Pro (for Vegas Pro, AviSynth, Prodrenalin, Mercalli, etc. etc..) <span style=\"text-decoration: underline;\">and<\/span> Linux (Fedora)..\u00a0\u00a0 I had set up dual-boot systems before, and I am still using Windows 7 Pro SP1, but this time I am using uEFI..<\/p>\n<p><em>The problem..<\/em><br \/>\nSet up dual boot as usual (install Win7, then &#8216;shrink&#8217; disk partition, then install Fedora 27).\u00a0\u00a0\u00a0 First boot into Fedora brings up Grub2 menu correctly, with chainloader entry to boot Windows 7, but after subsequent reboot into Windows 7, only Windows 7 shows up, instead of Grub2.\u00a0\u00a0\u00a0 I had read up on many suggested &#8216;fixes&#8217; but most of these were not very helpful..\u00a0\u00a0\u00a0 I updated the Z820 bios to the very latest version, but this made no difference.\u00a0 The problem appears to be caused by Win7..<\/p>\n<p>Fortunately, as I was using uEFI, I could use this from the Z820 setup UEFI menu option to select Grub2\/Fedora manually (EFI- fedora &#8211; shimx64-fedora.efi), and still boot into Grub2\/Fedora..<\/p>\n<p>I did try one suggested fix, using <span style=\"font-family: arial, helvetica, sans-serif;\"><strong>efibootmgr<\/strong><\/span> to add back the &#8216;Fedora entry&#8217;, but after rebooting into Windows 7, this vanished again..<\/p>\n<pre><strong><span style=\"font-family: courier\\ new, courier;\"># efibootmgr<\/span><\/strong>\n<strong><span style=\"font-family: courier\\ new, courier;\"> Timeout: 2 seconds<\/span><\/strong>\n<strong><span style=\"font-family: courier\\ new, courier;\"> BootOrder: 0000,0004,0005,0008,0006,0009,0000<\/span><\/strong>\n<strong><span style=\"font-family: courier\\ new, courier;\"> Boot0000* Windows Boot Manager<\/span><\/strong>\n<strong><span style=\"font-family: courier\\ new, courier;\"> Boot0001 IP6 Intel(R) 82579LM Gigabit Network Connection<\/span><\/strong>\n<strong><span style=\"font-family: courier\\ new, courier;\"> Boot0004* DTO UEFI USB Hard Drive<\/span><\/strong>\n<strong><span style=\"font-family: courier\\ new, courier;\"> Boot0005* DTO UEFI USB Floppy\/CD<\/span><\/strong>\n<strong><span style=\"font-family: courier\\ new, courier;\"> Boot0006* Hard Drive<\/span><\/strong>\n<strong><span style=\"font-family: courier\\ new, courier;\"> Boot0008* DTO UEFI ATAPI CD-ROM Drive<\/span><\/strong>\n<strong><span style=\"font-family: courier\\ new, courier;\"> Boot0009* CD\/DVD Drive<\/span><\/strong><\/pre>\n<p>Add Fedora entry back to efi boot menu:<br \/>\n<code><strong><span style=\"font-family: courier\\ new, courier;\">efibootmgr -c -w -d \/dev\/sda -p 1 -l '\\EFI\\fedora\\shimx64-fedora.efi' -L \"Fedora\"<\/span><\/strong><\/code><\/p>\n<pre><strong><span style=\"font-family: courier\\ new, courier;\"># efibootmgr<\/span><\/strong>\n<strong><span style=\"font-family: courier\\ new, courier;\"> Timeout: 2 seconds<\/span><\/strong>\n<strong><span style=\"font-family: courier\\ new, courier;\"> BootOrder: 0002,0000,0004,0005,0008,0006,0009,0000<\/span><\/strong>\n<strong><span style=\"font-family: courier\\ new, courier;\"> Boot0000* Windows Boot Manager<\/span><\/strong>\n<strong><span style=\"font-family: courier\\ new, courier;\"> Boot0001 IP6 Intel(R) 82579LM Gigabit Network Connection<\/span><\/strong>\n<span style=\"font-size: 10pt;\"><strong><span style=\"font-family: courier\\ new, courier;\"> Boot0002* Fedora<\/span><\/strong><\/span>\n<strong><span style=\"font-family: courier\\ new, courier;\"> Boot0004* DTO UEFI USB Hard Drive<\/span><\/strong>\n<strong><span style=\"font-family: courier\\ new, courier;\"> Boot0005* DTO UEFI USB Floppy\/CD<\/span><\/strong>\n<strong><span style=\"font-family: courier\\ new, courier;\"> Boot0006* Hard Drive<\/span><\/strong>\n<strong><span style=\"font-family: courier\\ new, courier;\"> Boot0008* DTO UEFI ATAPI CD-ROM Drive<\/span><\/strong>\n<strong><span style=\"font-family: courier\\ new, courier;\"> Boot0009* CD\/DVD Drive<\/span><\/strong><\/pre>\n<p>Reboot into Windows 7, then Fedora (via uEFI menu!) and the Fedora entry has vanished:<\/p>\n<pre><strong><span style=\"font-family: courier\\ new, courier;\"># efibootmgr<\/span><\/strong>\n<strong><span style=\"font-family: courier\\ new, courier;\"> Timeout: 2 seconds<\/span><\/strong>\n<strong><span style=\"font-family: courier\\ new, courier;\"> BootOrder: 0000,0004,0005,0008,0006,0009,0000<\/span><\/strong>\n<strong><span style=\"font-family: courier\\ new, courier;\"> Boot0000* Windows Boot Manager<\/span><\/strong>\n<strong><span style=\"font-family: courier\\ new, courier;\"> Boot0001 IP6 Intel(R) 82579LM Gigabit Network Connection<\/span><\/strong>\n<strong><span style=\"font-family: courier\\ new, courier;\"> Boot0004* DTO UEFI USB Hard Drive<\/span><\/strong>\n<strong><span style=\"font-family: courier\\ new, courier;\"> Boot0005* DTO UEFI USB Floppy\/CD<\/span><\/strong>\n<strong><span style=\"font-family: courier\\ new, courier;\"> Boot0006* Hard Drive<\/span><\/strong>\n<strong><span style=\"font-family: courier\\ new, courier;\"> Boot0008* DTO UEFI ATAPI CD-ROM Drive<\/span><\/strong>\n<strong><span style=\"font-family: courier\\ new, courier;\"> Boot0009* CD\/DVD Drive<\/span><\/strong><\/pre>\n<p>After more trial-and-error, I came up with the following solution, and it is nasty, but it does work!<\/p>\n<p>Boot into Fedora.<br \/>\nAs <em>root<\/em>, go to <code><strong><span style=\"font-family: courier\\ new, courier;\">\/boot\/efi\/EFI\/Microsoft\/Boot<\/span><\/strong><\/code><br \/>\nRename <strong><span style=\"font-family: courier\\ new, courier;\">bootmgfw.efi<\/span><\/strong> to <strong><span style=\"font-family: courier\\ new, courier;\">bootmgfwin7.efi<\/span><\/strong><br \/>\nCopy <strong><span style=\"font-family: courier\\ new, courier;\">shimx64-fedora.efi<\/span><\/strong> and <strong><span style=\"font-family: courier\\ new, courier;\">grub64.efi<\/span><\/strong> from <code><strong><span style=\"font-family: courier\\ new, courier;\">\/boot\/efi\/EFI\/fedora<\/span><\/strong><\/code>, and rename <strong><span style=\"font-family: courier\\ new, courier;\">shimx64-fedora.efi<\/span><\/strong> to <strong><span style=\"font-family: courier\\ new, courier;\">bootmgfw.efi<\/span><\/strong><br \/>\nRun <strong>grub-customizer<\/strong> to edit Grub2 entry for &#8216;<em>Windows Boot Manager<\/em>&#8216;:<br \/>\nchange<br \/>\n<code><strong><span style=\"font-family: courier\\ new, courier;\">chainloader \/EFI\/Microsoft\/Boot\/bootmgfw.efi<\/span><\/strong><\/code><br \/>\nto<br \/>\n<code><strong><span style=\"font-family: courier\\ new, courier;\">chainloader \/EFI\/Microsoft\/Boot\/bootmgfwin7.efi<\/span><\/strong><\/code><\/p>\n<p>So..\u00a0 Windows 7 thinks it is rebooting into Windows 7, but is in fact rebooting into Grub2..<\/p>\n<p><em>Robert Gadsdon.\u00a0\u00a0 March 14, 2018.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I am setting up an HP Z820 as &#8211; primarily &#8211; a video creating\/editing\/restoring system, but I need to be able to boot into Windows 7 Pro (for Vegas Pro, AviSynth, Prodrenalin, Mercalli, etc. etc..) and Linux (Fedora)..\u00a0\u00a0 I had set up dual-boot systems before, and I am still using Windows 7 Pro SP1, but this time <span class=\"excerpt-dots\">&hellip;<\/span> <a class=\"more-link\" href=\"https:\/\/rglinuxtech.com\/?p=2466\"><span class=\"more-msg\">Continue reading &rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[1280,1836,10,1238,1375,11,15,19,1535,1160,26],"tags":[1837,1838,161,181,182,242,1839,1175,1162,416,1840],"class_list":["post-2466","post","type-post","status-publish","format-standard","hentry","category-boot","category-dual-boot","category-fedora","category-fix","category-grub","category-hacks","category-linux-2","category-opinion","category-quirks","category-uefi","category-win-7","tag-dual-boot","tag-fedora-entry-missing","tag-fix","tag-grub2","tag-hack","tag-linux","tag-substitute","tag-success","tag-uefi","tag-windows-7","tag-z820"],"_links":{"self":[{"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/posts\/2466","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2466"}],"version-history":[{"count":0,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=\/wp\/v2\/posts\/2466\/revisions"}],"wp:attachment":[{"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2466"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2466"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rglinuxtech.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2466"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}