1

I have installed windows 8 in the partition sda4 (and ubuntu 12.04 was pre-installed) - partition screenshot below - and then tried recommended repair using boot-repair. But after boot-repair, Grub does not detect Windows. I've tried to repair grub twice (using boot-repair), but no gain.

(Earlier I installed windows in logical partition but now, it is in primary then why it doesn't get detected by grub?)

GParted screenshot

So far I've tried these...

Contents of grub.cfg - updated (Please note that this file is in the directory /boot/grub and NOT in etc/grub. In fact, there is no such directory like etc/grub.)

http://pastebin.com/SUTFSBSL

Also, if it may be related to the problem in any way... Ubuntu does not show the 101GB (NTFS in which Windows is installed) partition in the devices and gparted shows an exclamation sign beside this particular partition, asking to run chkdsk /f on windows and rebooting twice (this was not shown while I was on LiveCD) but I am able to successfully mount this partition using terminal.

More info (if it may help with another question): Initially the /home was around 246GB and I shrank it to 146GB and installed windows in 100 GB (logical partition). Later when I got to know that windows won't boot from logical I managed to move that 100GB (after deleting it) out of extended by moving the 100GB unallocated space to bottom and decreasing the size of extended partition.

I installed windows in this (now) Primary partition and repaired grub. But grub didn't show windows loader option. So I again repaired windows boot loader. Now here I got two windows options, Windows 8 and windows 8 on volume6. The earlier is the option for the windows which I earlier installed when that was a logical drive. My (second - it is not related to Ubuntu though) question is why and how is windows boot loader is getting info about the previous installation of windows as I had deleted the partition later.

Tarun
  • 521
  • 1
  • 5
  • 14
  • is that you can be able to boot both windows and ubuntu. – Avinash Raj Dec 12 '13 at 13:01
  • I want that, but I am unable to do so. – Tarun Dec 12 '13 at 13:14
  • I am not saying that it's not the answer, I'm just saying that the ultimate purpose (of dual-booting) has not yet been met. Now I've made it a primary partition as you said but still can't dual-boot. – Tarun Dec 12 '13 at 13:42
  • still you can't able to dualboot? – Avinash Raj Dec 12 '13 at 13:45
  • That's what I'm saying. I told so in that question also. – Tarun Dec 12 '13 at 13:47
  • what was output of sudo os-prober? – Avinash Raj Dec 12 '13 at 14:04
  • I didn't check that. I'll try tomorrow and will report back. – Tarun Dec 12 '13 at 17:21
  • ubuntu@ubuntu:~$ sudo os-prober /dev/sda1:FreeDOS:FreeDOS:chain /dev/sda2:Windows 8 (loader):Windows:chain /dev/sda4:Windows 8 (loader):Windows1:chain /dev/sda6:Ubuntu 12.04.2 LTS (12.04):Ubuntu:linux – Tarun Dec 14 '13 at 13:41
  • @AvinashRaj Sorry for delay in replying (I was experiencing problems making pendrive bootable). Could you please help me now. – Tarun Dec 14 '13 at 15:01
  • which software did you use to create bootable usb? – Avinash Raj Dec 14 '13 at 15:04
  • I've made pendrive bootable now. Earlier LiLi was giving error, now I tried pendrivelinux's software. So it's not the issue now. I've posted the output of os-prober command to help you assist me. – Tarun Dec 14 '13 at 15:07
  • i will be back within 15 minutes plz wait.And then it was better to start the discussion in chat,plz gain some rep. – Avinash Raj Dec 14 '13 at 15:15
  • @Tarun If the Ubuntu install doesn't see that partition, then go ahead and do what gparted says. Run chkdsk /f on windows and reboot twice. (Yes I know you have to repair windows boot and then grub again, kinda boring) Gparted always flags NTFS partitions after moving/resizing them. If you do the chkdsk it will remove that flag, and it won't come back if you don't use gparted again on that partition. After that I advise you to repeat my procedure. It is clear from your grub.cfg that the installed ubuntu has no clue about that windows. – falconer Dec 17 '13 at 21:25
  • Also from your partition scheme it looks like you are using uefi boot. Can't you change in UEFI the OS which you want to boot? – falconer Dec 17 '13 at 21:28
  • When you install Windows it puts its boot files in the partition with the boot flag. It looks like sda2 or your recovery partition has the boot flag. Best move flag to sda4 and then rerun Windows repairs. – oldfred Dec 17 '13 at 21:28
  • @oldfred Please explain this more. Can I just edit it using gparted in LiveCD without having any changes in the partition? – Tarun Dec 18 '13 at 15:37
  • You can use gparted to move boot flag to the Windows partition. Right click edit flags. You can only have one boot flag per drive and it is for Windows, grub does not use boot flag. If using Windows it is the set active command. Then running repairs from Windows will add bootmgr & bcd to main Windows partition. If those files are in sda2 you may be able to copy them also to sda4. You may still need repairs from a Windows repair console. – oldfred Dec 18 '13 at 16:24
  • @oldfred Here's what I did: Using LiveCD and Gparted, removed the boot flag from sda2 then added boot flag to sda4. Then using the the troubleshoot option (Command Prompt mode), executed these three commands bootrec /fixmbr bootrec /fixboot bootrec /rebuildbcd. After that again, using LiveCD, did recommended-repair using boot-repair. But I am still not getting Windows option in grub. Please let me know if I did anything wrong. – Tarun Dec 18 '13 at 20:13

2 Answers2

0

This brought so much memory for me from the past which often happened to me.

The fix that worked for me: use your installation cd and start the system off from it.

Select the option from menu, "Rescue the broken system"

You will go through the cycle of series of questions which it would lead you to partition section. When you arrive to that section, escape the process. You then will see the menu and you should see "Install GRUB".

Re-install GRUB and be sure to install on your master HD (sda1)

Reboot

You will then see your GRUB back and it'll detect your dual OS between Win and Ubuntu.

EDIT: Found this article for you: https://sites.google.com/site/easylinuxtipsproject/tips#TOC-Make-Windows-the-first-option-in-the-Grub-boot-menu

Faron
  • 1,398
  • 10
  • 14
  • The solution that you are giving (what I've understood) is to re-install grub. That's what boot-repair does! But it didn't work. – Tarun Dec 11 '13 at 10:20
0

Okay. I can't get from you question whether are you able to boot into ubuntu after you did a boot-repair from the Live CD? If you can do that, then do it. Then boot up the installed ubuntu system, and run sudo update-grub from the installed system. After that check whether you can boot into windows and ubuntu. If you can, problem solved, if you can't then update your question with your /boot/grub/grub.cfg from your installed ubuntu system.

falconer
  • 15,026
  • 3
  • 48
  • 68
  • There is no folder like grub. The only folder related to grub is grub.d but it does not have any file named grub.cfg. I found the file grub.cfg on searching the file system in /boot/grub whose contents have been added in the question. – Tarun Dec 17 '13 at 20:23
  • @Tarun Of course. I missed typed it. Sorry. – falconer Dec 17 '13 at 21:15
  • I tried that chkdsk /fand gparted didn't show the exclamation sigh anymore (But it doesn't show it in the devices even now) but after doing that and updating grub, I still can't see windows loader option in grub. – Tarun Dec 18 '13 at 15:32
  • Sorry but I didn't understand your UEFI OS selection advise. Could you please elaborate it a bit more. – Tarun Dec 18 '13 at 15:33
  • @Tarun I was referring to this about the UEFI OS selection. So maybe it is possible to change which OS you want to boot in the UEFI firmware. (Although I have never seen this in practice, thats why I don't know whether it is possible.) – falconer Dec 18 '13 at 19:25
  • I'm very much sure that my hardware either doesn't support UEFI or it is disabled because when I tried to make fifth partition (actually I shrank sda5 and decreased its size by 100GB which I later created as partition by bringing it out of extended, as Avinash said), gparted threw an error saying only 4 Primary partitions can be there. Please corect me if I am wrong but what I've found, having read several of the questions and answers here is that UEFI supports more than 4 primary partitions to be created. I'll report back if I find anything in the Boot Options. – Tarun Dec 18 '13 at 19:43
  • Just confirmed that it support UEFI but it is disabled by default in Boot Options. – Tarun Dec 18 '13 at 19:49
  • @Tarun If oldred's solution does not work, you may try to change it to UEFI mode (of course with Secure boot turned off), and try installing in that mode. Unfortunately I have no more clue. :( – falconer Dec 18 '13 at 19:56
  • I tried his solution, but no gain yet. May I know what do you mean by installing? Sorry but I didn't get you. – Tarun Dec 18 '13 at 20:14
  • @Tarun Installing the OS-s. – falconer Dec 18 '13 at 20:21
  • I'm sorry but if I could repartition it all, I would have done so earlier, but for some reasons I can't. – Tarun Dec 18 '13 at 20:26