{"id":3567,"date":"2017-04-03T11:19:10","date_gmt":"2017-04-03T05:49:10","guid":{"rendered":"https:\/\/www.wikitechy.com\/technology\/?p=3567"},"modified":"2017-04-03T11:19:10","modified_gmt":"2017-04-03T05:49:10","slug":"centos-7-dual-boot-with-windows","status":"publish","type":"post","link":"https:\/\/www.wikitechy.com\/technology\/centos-7-dual-boot-with-windows\/","title":{"rendered":"CenTOS 7 dual boot with windows"},"content":{"rendered":"<h4 id=\"configuring-grub-2-on-centos-7-to-dual-boot-with-windows-7\"><strong><span style=\"color: #ff6600;\">Configuring Grub 2 on CentOS 7 to Dual Boot with Windows 7:<\/span><\/strong><\/h4>\n<ul>\n<li>Once you install CentOS 7 alongside your Windows OS, you may find that you cannot boot into Windows. The Grub bootloader may only show your Linux OS as your only options to boot from.<\/li>\n<\/ul>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter wp-image-3575 size-full\" src=\"https:\/\/www.wikitechy.com\/technology\/wp-content\/uploads\/2017\/04\/CenTOS-7-dual-boot-with-windows.png\" alt=\"\" width=\"727\" height=\"408\" \/><\/p>\n<ul>\n<li>To fix this and have the Grub bootloader list your Windows OS, you need to edit the Grub bootloader files.<\/li>\n<li>If you have used CentOS is the past (with 6 or earlier), you may find that editing Grub is different. Previously, you would edit \/boot\/grub\/grub.conf.<\/li>\n<li>This is no longer the case, as the grub2.cfg file is generated dynamically, based on dependency files. Here\u2019s what you need to edit to configure your bootloader.<\/li>\n<\/ul>\n<p><label class=\"label label-warning\">STEPS:1<\/label><\/p>\n<ul>\n<li>Boot into CentOS 7.<\/li>\n<\/ul>\n<p><label class=\"label label-warning\">STEPS:2<\/label><\/p>\n<ul>\n<li>Determine what partition your Windows OS resides on by running sudo fdisk -l in Terminal.<\/li>\n<\/ul>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <span class=\"code-embed-name\">Linux<\/span> <\/div> <pre class=\"language-bash code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-bash code-embed-code\">Disk \/dev\/sda: 320.1 GB, 320072933376 bytes, 625142448 sectors<br\/> Units = sectors of 1 * 512 = 512 bytes<br\/> Sector size (logical\/physical): 512 bytes \/ 512 bytes<br\/> I\/O size (minimum\/optimal): 512 bytes \/ 512 bytes<br\/> Disk label type: dos<br\/> Disk identifier: 0xcd8b1219<\/code><\/pre> <\/div>\n[ad type=&#8221;banner&#8221;]\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <span class=\"code-embed-name\">Linux<\/span> <\/div> <pre class=\"language-bash code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-bash code-embed-code\"> Device Boot          Start              End              Blocks \t  Id  \tSystem<br\/> \/dev\/sda1   *        2048          4194303       2096128   \t 7  \tHPFS\/NTFS\/exFAT<br\/> \/dev\/sda2         4194304      360402758   178104227+           7              HPFS\/NTFS\/exFAT<br\/> \/dev\/sda3       360402942   625141759   132369409              5               Extended<br\/> \/dev\/sda5       612595712   625141759     6273024                82           Linux swap \/ Solaris<br\/> \/dev\/sda6       360407040   361431039      512000                 83               Linux<br\/> \/dev\/sda7       361433088   612589567   125578240              8e             Linux LVM<\/code><\/pre> <\/div>\n<p>In this example, \/dev\/sda1 is the recovery partition, and \/dev\/sda2 is the Windows OS partition. Since partition indexes start at zero, the Windows OS partition will be `hd0,1` (a = 0, 2 = 1; or first disk, second partition) when we edit the Grub file. Make note of this.<\/p>\n<p><label class=\"label label-warning\">STEPS:3<\/label><\/p>\n<ul>\n<li>Open a terminal and navigate to \/etc\/grub.d\/:<\/li>\n<\/ul>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <span class=\"code-embed-name\">Linux<\/span> <\/div> <pre class=\"language-bash code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-bash code-embed-code\">cd  \/etc\/grub.d\/<\/code><\/pre> <\/div>\n<p><label class=\"label label-warning\">STEPS:4<\/label><\/p>\n<ul>\n<li>Edit the 40_custom file. You may not see the file if you ls in \/grub.d\/.<\/li>\n<\/ul>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <span class=\"code-embed-name\">Linux<\/span> <\/div> <pre class=\"language-bash code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-bash code-embed-code\">sudo nano 40_custom<\/code><\/pre> <\/div>\n<p><label class=\"label label-warning\">STEPS:5<\/label><\/p>\n<ul>\n<li>You should see the following in the nano text editor:<\/li>\n<\/ul>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <span class=\"code-embed-name\">Linux<\/span> <\/div> <pre class=\"language-bash code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-bash code-embed-code\">#!\/bin\/sh<br\/> exec tail -n +3 $0<br\/> # This file provides an easy way to add custom menu entries.  Simply type the<br\/> # menu entries you want to add after this comment.  Be careful not to change<br\/> # the &#039;exec tail&#039; line above.<\/code><\/pre> <\/div>\n<p><label class=\"label label-warning\">STEPS:6<\/label><\/p>\n<ul>\n<li>Below the last #, type on a new line:<\/li>\n<\/ul>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <span class=\"code-embed-name\">Linux<\/span> <\/div> <pre class=\"language-bash code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-bash code-embed-code\">menuentry &quot;Windows 7&quot; {<br\/>         set root=(hd0,1)<br\/>         chainloader +1<br\/>         }<\/code><\/pre> <\/div>\n[ad type=&#8221;banner&#8221;]\n<p><label class=\"label label-warning\">STEPS:7<\/label><\/p>\n<ul>\n<li>Finally, run the following to apply the changes to the grub.cfg file:<\/li>\n<\/ul>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <span class=\"code-embed-name\">Linux code<\/span> <\/div> <pre class=\"language-bash code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-bash code-embed-code\">grub2-mkconfig --output=\/boot\/grub2\/grub.cfg<\/code><\/pre> <\/div>\n<ul>\n<li>Once you reboot, you should see the option of booting into Windows 7.<\/li>\n<li>If a default boot entry into Windows (or something else) is requested, then you need to edit the GRUB_DEFAULT in \/etc\/default\/grub:<\/li>\n<\/ul>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <span class=\"code-embed-name\">Linux Code<\/span> <\/div> <pre class=\"language-bash code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-bash code-embed-code\">GRUB_DEFAULT=&quot;Windows 7&quot;<\/code><\/pre> <\/div>\n","protected":false},"excerpt":{"rendered":"<p>CenTOS 7 dual boot with windows &#8211; Once you install CentOS 7 alongside your Windows OS, you may find that you cannot boot into Windows.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1699],"tags":[6529,6532,6522,6524,6528,6537,6525,6533,6530,6487,6490,6484,6527,6489,6488,6481,6483,6526,6539,6482,6534,6531,6542,6535,6538,6536,6541,6485,6486,6540,6523],"class_list":["post-3567","post","type-post","status-publish","format-standard","hentry","category-linux","tag-boot-centos-7-from-usb","tag-centos-7-boot-partition","tag-centos-7-dual-boot","tag-centos-7-grub","tag-centos-7-grub-install","tag-centos-7-installation-step-by-step","tag-centos-7-live-usb","tag-centos-7-manual","tag-centos-7-partition-scheme","tag-centos-add-windows-to-grub","tag-centos-windows-virtual-machine","tag-dual-boot-centos-6-and-centos-7","tag-dual-boot-centos-7","tag-dual-boot-centos-7-and-windows-7","tag-dual-boot-centos-and-ubuntu","tag-dual-boot-centos-windows-10","tag-dual-boot-windows-10-and-centos-6","tag-dual-boot-windows-10-and-centos-7","tag-dual-boot-windows-7-centos-7","tag-dual-boot-windows-8-and-centos-7","tag-grub-rescue-centos-7","tag-grub-update-centos-7","tag-how-to-dual-boot-windows-10-and-centos-7","tag-how-to-install-centos-7-from-usb","tag-how-to-install-centos-7-on-windows-7","tag-how-to-install-centos-7-step-by-step","tag-how-to-update-grub-in-centos-7","tag-install-centos-on-windows-7-virtual-machine","tag-install-windows-after-centos","tag-usb-boot-centos-7","tag-windows-10-centos-7-dual-boot"],"_links":{"self":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts\/3567","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/comments?post=3567"}],"version-history":[{"count":0,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts\/3567\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/media?parent=3567"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/categories?post=3567"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/tags?post=3567"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}