------------ Original Message ------------
Date: Sunday, March 01, 2015 21:50:34 -0500 From: Fred Smith fredex@fcshome.stoneham.ma.us To: centos@centos.org Subject: Re: [CentOS] installing C7 on a laptop with Win7, dual
boot
On Mon, Mar 02, 2015 at 02:04:24AM +0000, Richard wrote:
------------ Original Message ------------
Date: Sunday, March 01, 2015 20:06:26 -0500 From: Fred Smith fredex@fcshome.stoneham.ma.us To: centos@centos.org Subject: [CentOS] installing C7 on a laptop with Win7, dual boot
Hi all!
I've just installed C7 on my netbook that already contained Win7 (and also Fedora 19, which the C7 is intended to replace). The Fedora installer had found the windows installation and it appeared in the grub menu, and was bootable and worked fine.
The C7 installer did not put the windows installation into the grub menu.
with some googling I found a page at https://priteshugrankar.wordpress.com/2014/09/12/dual-booting-c ent os-7-and-windows-7/ that gives a simple recipe for fixing this problem. basically:
cp /boot/grub2/grub.cfg orig.grub.cfg grub2-mkconfig -o /boot/grub2/grub.cfg
with (on his system) the second command above producing this output:
[root@localhost ~]# grub2-mkconfig -o /boot/grub2/grub.cfg Generating grub configuration file ... Found linux image: /boot/vmlinuz-3.16.2-1.el7.elrepo.x86_64 Found initrd image: /boot/initramfs-3.16.2-1.el7.elrepo.x86_64.img Found linux image: /boot/vmlinuz-3.10.0-123.el7.x86_64 Found initrd image: /boot/initramfs-3.10.0-123.el7.x86_64.img Found linux image: /boot/vmlinuz-3.10.0-123.6.3.el7.x86_64 Found initrd image: /boot/initramfs-3.10.0-123.6.3.el7.x86_64.img Found linux image: /boot/vmlinuz-0-rescue-327fe33f3b364802871211321a2790b7 Found initrd image: /boot/initramfs-0-rescue-327fe33f3b364802871211321a2790b7.img Found Windows 7 (loader) on /dev/sda1 Found Windows 7 (loader) on /dev/sda2 done
Unfortunately, when I did it, I got this:
Generating grub configuration file ... Found linux image: /boot/vmlinuz-3.10.0-123.el7.x86_64 Found initrd image: /boot/initramfs-3.10.0-123.el7.x86_64.img Found linux image: /boot/vmlinuz-3.10.0-123.20.1.el7.x86_64 Found initrd image: /boot/initramfs-3.10.0-123.20.1.el7.x86_64.img Found linux image: /boot/vmlinuz-0-rescue-c875112952114f6284f69abaa4f9a2f7 Found initrd image: /boot/initramfs-0-rescue-c875112952114f6284f69abaa4f9a2f7.img done
No mention of the windows installation.
It's not that I use the win7 installation much, but I do want to be able to do so when one of those rare occasions pops up.
Thanks in advance!
Fred
I too encountered this issue putting centos7 on a win7 machine. The solution is to:
edit:
/etc/grub.d/40_custom
putting in:
menuentry 'name' { insmod ntfs set root=(hd0,2) chainloader +1 }
note: "name" can be anything you want (within reason), and is the name that will show in the boot menu.
So, I did this. I'm assuming that 'name' should be bare, with no quotes? well, I tried it both ways, makes no difference. The grub-mkconfig does not emit any lines about having found windows. its output looks the same as what I showed in the original mail, above.
there are 3 windows partitions, two of which appeared in grub previously. Here's the entry I made:
menuentry Win-7 { insmod ntfs set root=(hd0,1) chainloader +1 }
the values here:
root=(hd0,2)
will vary based on your disk setup. if you still have your fc19 grub/grub2 (whichever it used) configuration file you should be able to confirm the values from that.
I can still access the files (I made an image of the disk), but grub2 configurations are not human-readable, so I can't figure it out from that. however, if I look at the drive image with fdisk, it shows partition 2 as being bootable, so I used (hd0,1). maybe I s hould try (hd0,2) as an alternative...
when done, then:
grub2-mkconfig -o <output file>
personally, i didn't set the -o to the production grub.cfg file as my preference is to make backups and check things before potentially trashing a file like that, but do as you wish. when you're comfortable with the generated file move it to the production location and reboot.
- Richard
I believe you need quotes around the "name" value, but will admit I haven't tried without.
Correct, the grub2-mkconfig command doesn't emit lines about windows, but it puts the above lines into the resulting (grub2/grub.cfg) file - towards the bottom. [You could hand-edit these lines into that file if you want, but having them in the 40_custom file means that they will be included when the grub.cfg file is recreated after a linux kernal update.]
When you boot the machine you should see the (windows) "name" entry at the bottom of the list of kernel options. Select it and the machine should boot into windows.
Windows does have a couple of partitions -- the main/production bootable one as well as a rescue one. I believe that (hd0,2) is the default location/naming for the production/bootable one.
- Richard
Unfortunately, when I did it, I got this: Generating grub configuration file ... Found linux image: /boot/vmlinuz-3.10.0-123.el7.x86_64 Found initrd image: /boot/initramfs-3.10.0-123.el7.x86_64.img Found linux image: /boot/vmlinuz-3.10.0-123.20.1.el7.x86_64 Found initrd image: /boot/initramfs-3.10.0-123.20.1.el7.x86_64.img Found linux image: /boot/vmlinuz-0-rescue-c875112952114f6284f69abaa4f9a2f7 Found initrd image: /boot/initramfs-0-rescue-c875112952114f6284f69abaa4f9a2f7.img done No mention of the windows installation.
No mention of the Fedora installation either. So how are you going to boot Fedora 19?
Honestly this is one of those things that convinces me we're in the 5th epoch of computing dark age insanity. Windows n and Windows n+1; OS X n and OS X n + 1 are bullet proof dual booting and never involved the user in this sort of madness. On Linux, it's like, we step on our own tails, we step on every distro's tails, we make this completely crazy complex and things don't work (automatically).
What *I* would do >> I would use the Fedora GRUB instance as primary. And I would have its 40_custom include the proper lines for Windows 7, and an additional entry in 40_custom for CentOS using the configfile command to point to the CentOS grub.cfg.
That way you have a single GRUB menu that always has up-to-date kernels. The kernel updater only updates the distro specific grub.cfg, so using configfile to point to other distros is the correct way grub2-mkconfig should be creating "master" grub.cfgs in the first place. But no, we are living in the Pleistocene where things have to be made more difficult than necessary.
Of course you could use CentOS as primary, modify its 40_custom to have the Windows chainloader and Fedora configfile forwarding entries. Thing is, you want the newest GRUB binaries to be primary and usually that's Fedora. In your case with CentOS 7 and Fedora 19 it's probably a draw. But as Fedora 19 is EOL, you probably want to fedup that system to Fedora 21 one of these days :-D.
Chris Murphy
On Sun, Mar 01, 2015 at 09:41:06PM -0700, Chris Murphy wrote:
Unfortunately, when I did it, I got this: Generating grub configuration file ... Found linux image: /boot/vmlinuz-3.10.0-123.el7.x86_64 Found initrd image: /boot/initramfs-3.10.0-123.el7.x86_64.img Found linux image: /boot/vmlinuz-3.10.0-123.20.1.el7.x86_64 Found initrd image: /boot/initramfs-3.10.0-123.20.1.el7.x86_64.img Found linux image: /boot/vmlinuz-0-rescue-c875112952114f6284f69abaa4f9a2f7 Found initrd image: /boot/initramfs-0-rescue-c875112952114f6284f69abaa4f9a2f7.img done No mention of the windows installation.
No mention of the Fedora installation either. So how are you going to boot Fedora 19?
Ah, perhaps I didn't think to mention that I was installing Centos as a replacement for F19 (which is now EOL).
On Mon, Mar 2, 2015 at 5:17 AM, Fred Smith fredex@fcshome.stoneham.ma.us wrote:
Ah, perhaps I didn't think to mention that I was installing Centos as a replacement for F19 (which is now EOL).
You did, I wasn't paying close enough attention. Sorry.
On Mon, Mar 02, 2015 at 04:24:47AM +0000, Richard wrote:
------------ Original Message ------------
Date: Sunday, March 01, 2015 21:50:34 -0500 From: Fred Smith fredex@fcshome.stoneham.ma.us To: centos@centos.org Subject: Re: [CentOS] installing C7 on a laptop with Win7, dual
boot
On Mon, Mar 02, 2015 at 02:04:24AM +0000, Richard wrote:
------------ Original Message ------------
Date: Sunday, March 01, 2015 20:06:26 -0500 From: Fred Smith fredex@fcshome.stoneham.ma.us To: centos@centos.org Subject: [CentOS] installing C7 on a laptop with Win7, dual boot
Hi all!
I've just installed C7 on my netbook that already contained Win7 (and also Fedora 19, which the C7 is intended to replace). The Fedora installer had found the windows installation and it appeared in the grub menu, and was bootable and worked fine.
The C7 installer did not put the windows installation into the grub menu.
with some googling I found a page at https://priteshugrankar.wordpress.com/2014/09/12/dual-booting-c ent os-7-and-windows-7/ that gives a simple recipe for fixing this problem. basically:
cp /boot/grub2/grub.cfg orig.grub.cfg grub2-mkconfig -o /boot/grub2/grub.cfg
with (on his system) the second command above producing this output:
[root@localhost ~]# grub2-mkconfig -o /boot/grub2/grub.cfg Generating grub configuration file ... Found linux image: /boot/vmlinuz-3.16.2-1.el7.elrepo.x86_64 Found initrd image: /boot/initramfs-3.16.2-1.el7.elrepo.x86_64.img Found linux image: /boot/vmlinuz-3.10.0-123.el7.x86_64 Found initrd image: /boot/initramfs-3.10.0-123.el7.x86_64.img Found linux image: /boot/vmlinuz-3.10.0-123.6.3.el7.x86_64 Found initrd image: /boot/initramfs-3.10.0-123.6.3.el7.x86_64.img Found linux image: /boot/vmlinuz-0-rescue-327fe33f3b364802871211321a2790b7 Found initrd image: /boot/initramfs-0-rescue-327fe33f3b364802871211321a2790b7.img Found Windows 7 (loader) on /dev/sda1 Found Windows 7 (loader) on /dev/sda2 done
Unfortunately, when I did it, I got this:
Generating grub configuration file ... Found linux image: /boot/vmlinuz-3.10.0-123.el7.x86_64 Found initrd image: /boot/initramfs-3.10.0-123.el7.x86_64.img Found linux image: /boot/vmlinuz-3.10.0-123.20.1.el7.x86_64 Found initrd image: /boot/initramfs-3.10.0-123.20.1.el7.x86_64.img Found linux image: /boot/vmlinuz-0-rescue-c875112952114f6284f69abaa4f9a2f7 Found initrd image: /boot/initramfs-0-rescue-c875112952114f6284f69abaa4f9a2f7.img done
No mention of the windows installation.
It's not that I use the win7 installation much, but I do want to be able to do so when one of those rare occasions pops up.
Thanks in advance!
Fred
I too encountered this issue putting centos7 on a win7 machine. The solution is to:
edit:
/etc/grub.d/40_custom
putting in:
menuentry 'name' { insmod ntfs set root=(hd0,2) chainloader +1 }
note: "name" can be anything you want (within reason), and is the name that will show in the boot menu.
So, I did this. I'm assuming that 'name' should be bare, with no quotes? well, I tried it both ways, makes no difference. The grub-mkconfig does not emit any lines about having found windows. its output looks the same as what I showed in the original mail, above.
there are 3 windows partitions, two of which appeared in grub previously. Here's the entry I made:
menuentry Win-7 { insmod ntfs set root=(hd0,1) chainloader +1 }
the values here:
root=(hd0,2)
will vary based on your disk setup. if you still have your fc19 grub/grub2 (whichever it used) configuration file you should be able to confirm the values from that.
I can still access the files (I made an image of the disk), but grub2 configurations are not human-readable, so I can't figure it out from that. however, if I look at the drive image with fdisk, it shows partition 2 as being bootable, so I used (hd0,1). maybe I s hould try (hd0,2) as an alternative...
when done, then:
grub2-mkconfig -o <output file>
personally, i didn't set the -o to the production grub.cfg file as my preference is to make backups and check things before potentially trashing a file like that, but do as you wish. when you're comfortable with the generated file move it to the production location and reboot.
- Richard
I believe you need quotes around the "name" value, but will admit I haven't tried without.
Correct, the grub2-mkconfig command doesn't emit lines about windows, but it puts the above lines into the resulting (grub2/grub.cfg) file - towards the bottom. [You could hand-edit these lines into that file if you want, but having them in the 40_custom file means that they will be included when the grub.cfg file is recreated after a linux kernal update.]
When you boot the machine you should see the (windows) "name" entry at the bottom of the list of kernel options. Select it and the machine should boot into windows.
Yes, I do see that, and it does work. Thanks for the help!
Windows does have a couple of partitions -- the main/production bootable one as well as a rescue one. I believe that (hd0,2) is the default location/naming for the production/bootable one.
I'll see if I can add another stanza for the windows recovery partition, for just in case it becomes necessary.
thanks again!