1

I had Ubuntu 12.04 pre-installed on my laptop with /home partition of about 246GB (and all other partitions like / and /boot etc. with variable sizes). I shrinked the drive and made a new one of 100GB from /home and installed windows 8 there. After that Grub menu was not being shown as obvious.

Then I booted live cd (same Ubuntu 12.04) and did "recommended repair" by boot-repair. It said everything went fine but when I start the system, Grub does not show the option to select windows OS.

Only those, with Linux-generic and recovery kind of options, but not Windows Loader.

Here is the log file from boot-repair.

Avinash Raj
  • 78,556
Tarun
  • 521
  • 1
  • 5
  • 14
  • upload gparted screenshot to imgur.com and post the link here. – Avinash Raj Dec 06 '13 at 13:08
  • You need to repair your windows bootloader.Try this,it should really help you http://askubuntu.com/questions/381601/windows-doesnt-boot-after-updating-to-13-10/381603#381603 – Avinash Raj Dec 06 '13 at 13:20
  • Isn't that what has happened here? I installed windows and it worked fine so that means it had already overwritten the grub. Then I booted into live cd and repair it. – Tarun Dec 06 '13 at 16:40
  • but you say in the question that Grub does not show the option to select windows OS.plz tell what's your actual problem is. – Avinash Raj Dec 06 '13 at 16:42
  • My actual problem is this only that the grub does not show the OS selection menu. But isn't it that the steps you just said have already been implemented in the process I've done till now? – Tarun Dec 06 '13 at 16:46
  • btw here is the gparted screenshot: http://i.imgur.com/2navfW7.png?1 – Tarun Dec 06 '13 at 16:46
  • did you run sudo update-grub command – Avinash Raj Dec 06 '13 at 16:48
  • When? While executing "recommended repair"? – Tarun Dec 06 '13 at 16:55
  • boot into ubuntu os.open up the terminal and run sudo update-grub command. – Avinash Raj Dec 06 '13 at 16:57
  • Just did. But no gain. – Tarun Dec 06 '13 at 17:09
  • in that gparted screenshot where is your windows partition. – Avinash Raj Dec 06 '13 at 17:22
  • let us continue the discussion here http://chat.stackexchange.com/rooms/11833/room-for-avinash-raj-and-whoever-wants-to-make-company – Avinash Raj Dec 06 '13 at 17:25
  • I can't talk there as I don't have 20 reps. Windows partition is the one of ~100GB NTFS file system. – Tarun Dec 06 '13 at 17:50
  • I'm here only waiting for your answer (and others' as well). – Tarun Dec 06 '13 at 18:23
  • is my answer help you. – Avinash Raj Dec 06 '13 at 19:02
  • I've just added something which may help a bit more to understand the problem. – Tarun Dec 06 '13 at 19:08
  • Windows only boots from primary partitions, so grub need to find the boot files in sda2. But your sda2 has these /menu.lst /grldr /bootmgr /Boot/BCD /grldr. The menu.lst is from grub legacy and /grldr is grub4dos. Best to remove those and just leave the two Windows boot files bootmgr & BCD. Then os-prober may have a chance to find it with a sudo update-grub. – oldfred Dec 07 '13 at 05:06

2 Answers2

1

enter image description here

  • From the screenshot,it was clearly shown that you installed Windows on a logical partition.Windows doesn't boot from a logical partition,it only boots from a primary partition.

  • So delete /dev/sda8 and install windows on a primary partition other than extended partition.

  • For this,follow the below steps.

    1. Boot ubuntu-live-disk(so that your ubuntu partition will be unmounted and you will be able to resize it) and install gparted by running the below commands on terminal,

      sudo apt-get update
      sudo apt-get install gparted && sudo gparted
      
    2. Right click on the /dev/sda8 ntfs partition and delete it by selecting delete option.

    3. Now the unallocated spaces before and after /dev/sda8 combine into one.(unallocated space= 3.74 MB+100.09 GB+4.74MB).

    4. Then you have to move the total unallocated space,just below to the /dev/sda7 linux-swap partition,so that the total unallocated space will be throw out of the extended partition.For this,

    5. Right click on the dev/sda6 and select Resize/Move option.Click on the slider and move it to the left atmost.

    6. Now the unallocated space comes just below to the /dev/sda6.

      enter image description here

    7. Try the same like i did on step 5 to move the unallocated space just below to the /dev/sda7 linux swap partition.

    8. Now the total unallocated space of about 100 GB are comes at the last of the extended partition.Now right-click on the extended partition and click on the Resize/Move option then you can be able to shrink or shorten the extended partition to throw 100 GB unallocated space out of the extended partition.

    9. Right click on the unallocated space just below to the extended partition and select New option.

    10. From that create a new primary ntfs partition.And then install Windows os on it.

Avinash Raj
  • 78,556
  • How do I make a primary partition? I can only shrink the /home partition (sda7) which I did. How to make it primary? edit: Windows did load (over writing grub) but later I used boot-repair to get it dual booted. – Tarun Dec 06 '13 at 19:14
  • After searching, I got to know that sda1-sda4 are primary partitions. But I don't think there is any way to get the new partition to be any of those sda1-sda4.

    Can you tell if there is some? Thanks

    – Tarun Dec 06 '13 at 19:46
  • Thank You very much. I will surely try the way how you brought the logical partition out of extended but I still have some doubts, which if you could solve, will be very much appreciated.

    But I can't use the chat here. If you can give any other contact info, that will be great. For the time being, I've repaired Windows and using it only.

    – Tarun Dec 07 '13 at 06:23
  • you can post as comments here.After that don't forget to delete that. – Avinash Raj Dec 07 '13 at 06:28
  • I cannot upvote since I lack the min number of reps:

    Alright, 1. If windows can boot only from primary partition, how is it able to boot when only windows is used (as I am using currently replacing grub by windows boot manager)?

    – Tarun Dec 07 '13 at 06:35
  • When I see the partitioning in windows computer management, it shows all of them as 'Primary'. Why is that so?
  • – Tarun Dec 07 '13 at 06:36
  • Is it sure that if I delete the sd8 and then following your method, brings a partition out of extended, to make it primary, there won't be any problem using those /boot and /recovery partitions? What I've understood is that system contains the data about where the boot sectors etc (I may be wrong here) are situated and all that info, with the name (number) of partition would be situated in the tables it forms. But as we'll change the partitioning, there will be difference in the name and/or sectors etc. which may lead to malfunctioning from using those partitions.
  • – Tarun Dec 07 '13 at 06:40
  • In only windows os pc's ,windows must be installed in primary partition otherwise it won't.I didn't see partitions in disk-management.But by using gparted,it was easy to understand.All partitions inside the extended partition must be logical partition. – Avinash Raj Dec 07 '13 at 06:41
  • Here's what I see in disk management in windows: http://i.imgur.com/ZStyb6P.png?1 – Tarun Dec 07 '13 at 06:43
  • did you have any important files in that partition please backup before deleting. – Avinash Raj Dec 07 '13 at 06:46
  • see that image c: shows that it was a logical drive. – Avinash Raj Dec 07 '13 at 06:47
  • Bur it shows all other as primary. What I found was at max, only 4 partitions can be primary. – Tarun Dec 07 '13 at 06:52
  • MBR disk supports only 4 primary partitions but GPT disk supports 128 primary partitions. – Avinash Raj Dec 07 '13 at 07:01
  • Run this command to check whether your disk is GPT or MBR gdisk -l /dev/sda – Avinash Raj Dec 07 '13 at 07:34
  • In step 5, won't sliding the bar to the leftmost bring the partition above the sda5 (/home)? – Tarun Dec 09 '13 at 12:29
  • And make sure that there was no key symbol in all the /dev/sda partitions. – Avinash Raj Dec 09 '13 at 12:34
  • Yes. Here is the screenshot after deleting the partition sda8: http://i.imgur.com/2WAVPOE.png?1 – Tarun Dec 09 '13 at 12:39
  • is that it appears like my second screenshot?like unallocated space before that. – Avinash Raj Dec 09 '13 at 12:42
  • It shows free space preceding to be 100.1 GB. So I think that you were right and it will place the /root right under the /home. Still I'm waiting for assurance from you. :) – Tarun Dec 09 '13 at 12:44
  • yes please try that. – Avinash Raj Dec 09 '13 at 12:46
  • It's still not allowing to create as primary partition (showing both primary and extended option as greyed out). Let me know what to do next. Here's the screenshot http://i.imgur.com/xWQjdLh.png?1 – Tarun Dec 09 '13 at 13:12
  • I will for sure (if it allows me to do so, since I have very less number of reps). You have been of great help. Thank You very much, now I'm going to shrink the extended partition and lets see what happens :) – Tarun Dec 09 '13 at 13:30
  • "It is not possible to create more than 4 primary partitions" Can I somehow make the last one (sda4) logical (put that into the extended partition)? – Tarun Dec 09 '13 at 13:35
  • did you have any files on sda4?I think it is not necessary.Delete it and create new primary partition from the unallocated space. – Avinash Raj Dec 09 '13 at 13:45
  • you can't upvote my answer but you can accept it by pressing tick mark below the down arrow. – Avinash Raj Dec 09 '13 at 13:46
  • They are provided by the manufacturer and I am afraid to delete them as they may have to be checked time to time. – Tarun Dec 09 '13 at 13:47
  • Is there any chance if I install windows on the unallocated partition(if possible) and then using the softwares like AOMEI partition manager, convert the primary to logical? Then again using Gparted, delete the partition (in which windows will be installed) and make a new primary? – Tarun Dec 09 '13 at 13:51
  • it only allocates 3.75 mb,mount that partition in ubuntu and copy the files from that.And then delete that. – Avinash Raj Dec 09 '13 at 13:54
  • I can't mount it, nothing happens on right clicking and hitting mount. I am using live cd (since I downloaded the 64bit ISO in Ubuntu only which I can no longer use as Windows overwrote the grub which inturn can't be repaired without 64 bit version). – Tarun Dec 09 '13 at 14:01
  • try this on terminal to mount sda4. sudo mount /dev/sda4 – Avinash Raj Dec 09 '13 at 14:03
  • I get error: "mount: can't find /dev/sda4/ in /etc/fstab or /etc/mtab " – Tarun Dec 09 '13 at 14:04
  • sorry try this, sudo mount /dev/sda4 /media – Avinash Raj Dec 09 '13 at 14:05
  • Now I can't even see that partition now in the explorer. – Tarun Dec 09 '13 at 14:18
  • try this command cd /media && ls there you can find the sda4 partition.Or you can move to the media folder through nautilus,there you find the mounted partition. – Avinash Raj Dec 09 '13 at 14:21
  • The output of the command is '$RECYCLE.BIN' The prompt also got changed to /media adn when I tried ls, it again showed '$RECYCLE.BIN' I guess there is nothing in that drive :p – Tarun Dec 09 '13 at 14:25
  • you don't worry plz delete that.What's you problem in deleting that? i will clear your doubt. – Avinash Raj Dec 09 '13 at 14:28
  • I deleted it and installed windows in it. But one thing I could not understand is it's showing two windows options while booting. I installed previous in that logical drive which has been deleted now. Why is it asking so then? I've tried repairing windows boot loader with thosr commands bootrec /fixmbr etc. But no gain. – Tarun Dec 09 '13 at 17:55
  • Try boot-repair – Avinash Raj Dec 10 '13 at 03:00
  • It's not a question regarding the partition problem I was earlier having. Just asking: I clicked recommended repair then it asked if I wanted to install pastebin (something like that) I hit yes and now it's stuck at Enabling BootInfo (This may require several minutes). I've been waiting for about half an hour now. Any idea? – Tarun Dec 10 '13 at 08:13
  • it connects to the internet and paste the bootrepair log to pastebin.com and then it provides the pastebin url.just skip that if you r not having internet connected. – Avinash Raj Dec 10 '13 at 08:17
  • I do have internet (much slow though, 512 kbps) but when I tried it last time, it didn't take this long. Since I have started it already, either I have to wait for it to complete or have to kill it. :/ – Tarun Dec 10 '13 at 08:22
  • I killed it and can see grub but NO Windows loader option in it :( – Tarun Dec 10 '13 at 08:37
  • I've tried recommended repair again but still no gain. Since the original purpose has been solved and this discussion has become too long, I'll make another thread for that. Thank you very much for your help. – Tarun Dec 10 '13 at 11:24
  • @Tarun Avinash, can you both take the important information and move it to the question/answer? – Braiam Dec 11 '13 at 11:36
  • @Braiam I've added a summary and the title so that users may get to know what they'll find in the answer. But as the solution of the question of bringing a partition out of extended has been solved but the main purpose of the question, to dual-boot still persists, I've made a new question. I'll appreciate if you could tell me what I should do if I don't get answers (or help me). – Tarun Dec 12 '13 at 11:59
  • @Tarun ask another question with gparted screenshot.I will help you. – Avinash Raj Dec 12 '13 at 12:20
  • @AvinashRaj http://askubuntu.com/questions/389115/dual-boot-ubuntu-12-04-and-windows8-grub-doesnt-detect-windows-boot-repair-di/389119#389119 – Tarun Dec 12 '13 at 12:50