5

On my machine I have two ubuntu partitions and one windows partition. Everything was fine, until I had to increase the size of the / partition of one of the ubuntu installs. I basically moved the / from /dev/sda8 to /dev/sda10 (there's a guide on ubuntu wiki about how to do that).

Everything went fine, except that I lost the ability of booting on windows. There's still the windows entry in grub, but whenever I click on it, I'm sent back to the grub window. Any help?

Here's the output of "bootinfoscript" (unfortunately, I'm not understanding it that much) -> http://pastebin.com/WNwvsXn5

Thanks in advance for any help! :)

3
  • You might try to repair the windows bootloader via the windows repair DVD and after that recreate GRUB via chrooting into your Ubuntu partition.
    – FSMaxB
    Oct 14 '13 at 8:44
  • I don't have the windows DVD, is it possible to do that from the recovery partition?
    – alecive
    Oct 15 '13 at 10:26
  • You can get windows repair cds in the internet and you can even download Windows 7 Installation CDs from Microsoft (Just google for Windows ISOs, for 7 they are provided from Microsoft as 60 day trials [Profressional and Home Premium, but that doesn't matter, because you can use anyone for recovery purposes]).
    – FSMaxB
    Oct 15 '13 at 15:25
2

Do sudo update-grub and, if it don't work, edit grub.cfg manually with sudo nano /boot/grub/grub.cfg from a terminal. This last option requires some knowledge.
I suggest you to read this basic guide before doing any change.
Always remember to use update-grub after each change, it's very important.
Have a nice day.

Edit in response to the comment: you should find the "BEGIN /etc/grub.d/30_os-prober" string in the file. There should be the Windows entry.
Verify that the data there is right: (it should be like this, except for the last line)

### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows NT/2000/XP (su /dev/sda2)' --class windows --class os $menuentry_id_option 'osprober-chain-C2F0E263F0E25D63' {
        insmod part_msdos
        insmod ntfs
        set root='hd0,msdos2'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2  C2F0E263F0E25D63
        else
          search --no-floppy --fs-uuid --set=root C2F0E263F0E25D63
        fi
        drivemap -s (hd0) ${root}
        chainloader +1
}
### END /etc/grub.d/30_os-prober ###

No, your data doesn't seems right (from the pastebin):

menuentry 'Windows 7 (loader) (on /dev/sda2)' --class windows --class os $menuentry_id_option 'osprober-chain-909C7C3E9C7C20C0' {
        insmod part_msdos
        insmod ntfs
        set root='hd0,msdos2'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2  909C7C3E9C7C20C0
        else
          search --no-floppy --fs-uuid --set=root 909C7C3E9C7C20C0
        fi
        chainloader +1
}

...because Windows should be on sda3 and not on sda2! (see sda3 on bootifoscript.txt)
Try to use this specific software to fix your problem, it should be a better alternative to manual grub.cfg editing in this specific case.
If you still don't solve feel free to write it.

5
  • I sudo update-grubed from any of the three partitions that I have, but this didn't change. I think to be enough good with playing around with grub and similar things, otherwise I wouldn't be able to move a the root partition easily (actually, that wasn't that easy since I had to change some commands w.r.t. the guide). My question is: what I should do in the grub.cfg file?
    – alecive
    Oct 12 '13 at 10:05
  • Answered with an edit. After you've made any change you can rename the grub entry and delete the "(loader)" string. Oct 13 '13 at 9:42
  • Thanks for the explanation. Is it still possible to simply modify the grub.cfg to change the set root='hd0,msdos2' into set root='hd0,msdos3', am I right? That should fix the issue, or not?
    – alecive
    Oct 15 '13 at 10:23
  • My problem is that I've always had Windows on /dev/sda2, so probably when I moved the root partition something was messing up and a new /dev/sda2 has been created. Is it possible?
    – alecive
    Oct 15 '13 at 10:25
  • Do a cfg backup and try, only avoid to edit other entries in the cfg file; be sure to change any reference to the old partition and to run the update command I cited up. A DESPERATE CASE: you can always delete the Windows partition, create a one big partition and install there Windows another time. You can do this from Ubuntu or from a Live distro. Remember to backup your documents from Windows on the linux partition (from linux, it can see the Windows partition) or, more safely, by doing a traditional backup. Oct 15 '13 at 17:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.