LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Installed Xubuntu, now can't boot to Windows. But there's more confusing stuff. (https://www.linuxquestions.org/questions/linux-newbie-8/installed-xubuntu-now-cant-boot-to-windows-but-theres-more-confusing-stuff-4175426051/)

ValleyForge 09-06-2012 10:39 PM

Installed Xubuntu, now can't boot to Windows. But there's more confusing stuff.
 
Ok...I have quite a strange situation here. I'll provide as much detail as I can. And BTW I need help urgently, as school just started and I need my computer.

I have a Dell Inspiron 14R laptop.
My original setup with 4 partitions:
1: 102MB - Some Dell thing that I assume doesn't matter
2: 19.53GB - Dell "RECOVERY" thing for reinstalling OEM Windows 7
3: 63.48GB - OEM Windows 7 Home Premium x64
4: 513.06GB - My Data

My plan was to reformat the Dell RECOVERY thing (because it's not actually needed) and install Xubuntu on it. So, I used a cool USB installer tool to install the Xubuntu 12.04 64-bit ISO onto my 8GB USB flash drive, and booted to it. I do this by pressing F12 at boot and selecting USB device. It booted to the Xubuntu installer, and at the installation partition selection place I soon found out that you can't install Linux on any filesystem type other than ext2, ext3, or ext4. I was unsure about this so I exited the installer to the "Live demo" of Xubuntu, opened Firefox, and researched to confirm that Windows cannot read extX filesystems and that there are annoying workarounds. I decided it was still worth it anyway and attempted to install Xubuntu on the 2nd partition. But I didn't know you had to put "/" in the "Mount point" and was stumped there for a while, researching, and eventually got it. So I formatted the 2nd partition as ext3 and installed Xubuntu on it. All good so far.

The partition setup was now:
1: Some Dell thing that I assume doesn't matter
2: Xubuntu
3: OEM Windows 7 Home Premium x64
4: My Data
(same sizes as above).

Now...on the reboot I assumed it would have an OS selection screen, allowing me to boot to either Windows 7 or Xubuntu. It didn't, and instead booted straight into Xubuntu. I rebooted and checked to see if there was a way to choose the OS if I pressed F12, but that only allows choosing the hardware device to boot to (CDROM, Hard Drive, USB drive). I did some researched and determined that it was something having to do with Grub that was causing my problem. I ran 'sudo os-prober' and 'sudo update-grub' along with some other recommended commands for people having related issues (I don't remember some). Then when I booted it would say something about Grub, timeout after 5 seconds, and boot Xubuntu. If I hit Escape during this timeout, it would bring up a screen with about 5 choices all saying "Ubuntu" which all boot to Xubuntu. I think now that Grub is installed onto my MBR. At this point I was ready to quit this and revert to my original Windows-only setup, but I had no way to boot to Windows.

I found out that some people fixed this issue by running the Windows 7 installation CD, opening the command prompt, and typing "bootrec /fixMBR". I happened to have the Windows 7 installation CD already extracted somewhere on my Data partition, so I formatted my USB flash drive and copied the Windows 7 CD's contents to it. I then booted to it, and upon clicking the "Repair my computer" button (the way to get to the Command Prompt) it said something along the lines of "A Windows installation with bootup problems has been detected, click OK to fix it." I clicked OK, thinking this might do the trick. Guess what; it affected nothing. So I was going to boot to the Windows 7 install disk (on my flash drive) again to try the Command Prompt command. I pressed F12, selected my flash drive, and...you won't believe it...IT BOOTED MY ORIGINAL WINDOWS 7!! What???? Yeah. So now at the boot menu:
Hard Drive = Xubuntu
USB device = the Windows 7 installation on my hard drive
And I'm pretty sure Grub is installed onto my MBR.

I think what I need to do is uninstall Grub from my MBR (don't know how) and format the 2nd partition. What do you think?

I am thoroughly confused.

BTW, now my Windows 7 clock is 7 hours ahead of the actual time o.O

Edit 1: I formatted my USB drive and copied the Win7Installer files to it again and booted to it, this time when it asked if I wanted to fix my existing Windows boot I said no and opened the Command Prompt. I ran the command "bootrec /fixBCD" which executed in about 0.1 seconds, then ran Startup Repair, then restarted. Still booted to Xubuntu, and now when I boot to the USB drive it boots to my Windows on my hard drive. I then booted to a drive which did not have any OS on it (just to see what would happen), and it booted to Windows. So the action it prompts me to do when I first open the Win7Installer is actually Startup Repair. I found that the file which causes the USB drive to boot to Windows on my hard drive after running Startup Repair is [Win7Installer]\boot\BCD. This file is different after doing Startup Repair than before doing it. But as mentioned if I boot to a drive with no OS on it, Windows boots. I don't know what to think of that, since if I choose to boot to the Hard Drive it boots to Xubuntu.

EDDY1 09-07-2012 12:04 AM

When you ran os-prober did it say that it found windows ? To get grub to show on boot press Shift key if windows was found you will have an option to boot it. Then

Post output of
Quote:

fdisk -l

yancek 09-07-2012 10:13 AM

Quote:

1: 102MB - Some Dell thing that I assume doesn't matter
That is more than likely your windows boot partition so I would leave it alone. Also, given the confusion in partitions/drives and boot files here, your best bet would be to go to the site below and read the instructions on using the bootinfoscript, download it and run it and it will output a results.txt file. If you can't fix things after reading it, post it here and someone should be able to help. It provides details on drives/partitions and boot files for Linux and windows.

http://sourceforge.net/projects/bootinfoscript/

I'm surprised that the os-prober and update-grub run from the installed Xubuntu didn't produce any output. Grub is usually pretty good about detecting operating systems boot files.

ValleyForge 09-07-2012 10:34 AM

Quote:

Originally Posted by EDDY1 (Post 4774687)
When you ran os-prober did it say that it found windows ? To get grub to show on boot press Shift key if windows was found you will have an option to boot it. Then

Post output of

When I ran os-prober it would sit for 5 seconds, then return nothing. But I just ran os-prober again and it says:
Code:

/dev/sdd1:Windows 7 (loader):Windows:chain
/dev/sdd is my USB drive with the Win7 Installer on it, so os-prober did not find my installed Windows 7.
Output of fdisk -l:
Code:

Disk /dev/sda: 640.1 GB, 640135028736 bytes
255 heads, 63 sectors/track, 77825 cylinders, total 1250263728 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x07f2837e

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1              63      208844      104391  de  Dell Utility
Partition 1 does not start on physical sector boundary.
/dev/sda2          212992    41172991    20480000  83  Linux
/dev/sda3        41172992  174293679    66560344    7  HPFS/NTFS/exFAT
/dev/sda4      174295040  1250260991  537982976    f  W95 Ext'd (LBA)
/dev/sda5      174297088  1250260991  537981952    7  HPFS/NTFS/exFAT

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x730beb54

  Device Boot      Start        End      Blocks  Id  System
/dev/sdb1            2048  976773119  488385536    7  HPFS/NTFS/exFAT

Disk /dev/sdc: 16.0 GB, 16009658368 bytes
255 heads, 63 sectors/track, 1946 cylinders, total 31268864 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

  Device Boot      Start        End      Blocks  Id  System
/dev/sdc1            2048    31268863    15633408    c  W95 FAT32 (LBA)

Disk /dev/sdd: 7998 MB, 7998537728 bytes
255 heads, 63 sectors/track, 972 cylinders, total 15622144 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x34fe34fd

  Device Boot      Start        End      Blocks  Id  System
/dev/sdd1  *        8064    15622143    7807040    7  HPFS/NTFS/exFAT

/dev/sda is my hard drive, as you can see my 4th partition (data) is actually an extended partition (shows as a submenu in GParted). I don't know why or how to change it, but I assume it doesn't matter much...
/dev/sdb is my external 500GB hard drive.
/dev/sdc is my SD card
/dev/sdd is my USB flash drive. None of these are bootable except my hard drive (which boots to the Grub selection screen with 5 "Ubuntu" options), and if I boot to anything else, Windows boots. Optimally I would like to know how to edit Grub's settings, and if that's too dificult then how to remove it entirely.

ValleyForge 09-07-2012 10:48 AM

1 Attachment(s)
Quote:

Originally Posted by yancek (Post 4775037)
That is more than likely your windows boot partition so I would leave it alone. Also, given the confusion in partitions/drives and boot files here, your best bet would be to go to the site below and read the instructions on using the bootinfoscript, download it and run it and it will output a results.txt file. If you can't fix things after reading it, post it here and someone should be able to help. It provides details on drives/partitions and boot files for Linux and windows.

http://sourceforge.net/projects/bootinfoscript/

I'm surprised that the os-prober and update-grub run from the installed Xubuntu didn't produce any output. Grub is usually pretty good about detecting operating systems boot files.

Not sure about your reasoning for /dev/sda1 being my Windows boot partition...
I ran bootinfoscript and attached RESULTS.txt to this post. I see that it found my Windows installation (surprise). I see now the Grub menu, but I don't see how to add Windows as an option in it, nor how to make it appear with choices each boot (it currently doesn't unless I press Escape).

EDDY1 09-07-2012 10:50 AM

You can view your windows files thru Xubuntu's file manager.
Seeing that you installed linux to sda2 you may have over-written your wins install.
Also X probably should've been installed to the extended partition.
You should probably do as Yancek said & run bootinfo script.

ValleyForge 09-07-2012 11:01 AM

Quote:

Originally Posted by EDDY1 (Post 4775071)
You can view your windows files thru Xubuntu's file manager.
Seeing that you installed linux to sda2 you may have over-written your wins install.
Also X probably should've been installed to the extended partition.
You should probably do as Yancek said & run bootinfo script.

As I said, if I boot to any device that's not bootable, my original Windows install boots. So I did not overwrite it, and they are in fact on two seperate partitions. Xubuntu is on /dev/sda2, and Windows 7 is on /dev/sda3. I can choose to boot to either by doing something roundabout:
boot to Hard Drive = Grub menu, Xubuntu
boot to something unbootable = straight to Windows 7
I don't know why this is or how to fix it. My goal is to get a menu on boot that will allow me to choose between Xubuntu or Windows 7, or after a 5 second timeout boot to Xubuntu. I don't know if Grub will do this for me or not, or how to configure Grub.
I attached RESULTS.txt to my last post.

snowday 09-07-2012 11:10 AM

Remove the USB drive, boot to Xubuntu, and run:

Code:

sudo update-grub
This is a known bug in the installer, that sometimes it will not pick up on the Windows install until you run the command above.

ValleyForge 09-07-2012 11:33 AM

Quote:

Originally Posted by snowpine (Post 4775086)
Remove the USB drive, boot to Xubuntu, and run:

Code:

sudo update-grub
This is a known bug in the installer, that sometimes it will not pick up on the Windows install until you run the command above.

I did that, didn't help. I also edited menu.lst so the Grub menu would appear automatically and have a 5 second timeout. I added en entry:
title Windows 7 Home Premium x64
root (hd0,2)

When I try to boot to that entry, I get an error "Unrecognized device string" and have to choose a different entry. I am probably missing some things from the entry that it needs to know how to boot Windows. What else does it need?

Edit: I did the entry wrong, I put hd(0,2) instead of (hd0,2). Fixed that and added:
chainloader +1 (was present in online examples)
So now my Windows entry looks like:
title Windows 7 Home Premium x64
rootnoverify (hd0,2)
chainloader +1

And now I get "BOOTMGR is missing" when I try to boot to it.

Wim Sturkenboom 09-07-2012 11:48 AM

I'm new to Windows 7, but it has a seperate boot partition. On my system that's the first partition so that partition IS important.
You must point to the first partition which will contain the Windows bootloader, not to Windows partion itself.

Something like this? No guarantee.
Code:

title Microsoft Windows XP Professional at sda1
rootnoverify (hd0,0)
chainloader +1

Maybe it must be root instead of rootnoverify

Source: http://forums.justlinux.com/showthre...d-chainloading

// Edit 2012/09/09 (to keep the record straight :))
The extra partition might be related to UEFI and not to Win7; new to UEFI as well.

snowday 09-07-2012 11:49 AM

I did not realize you had tried "sudo update-grub" because at no point did you mention it and I'm not a mind reader. You mention you tried "update-grub" but the "sudo" is very important.

Something is strange with the fact you're editing menu.lst because Ubuntu no longer uses that file. Are you sure you aren't following some tutorial written for an older version of Ubuntu?

This one is up-to-date and reliable, give it a read: https://help.ubuntu.com/community/Grub2

Wim Sturkenboom 09-07-2012 12:07 PM

Xubuntu might still use legacy grub; I don't know, but the reference to menu.lst also struck me as strange.

For grub2, this is the Win7 entry on my Ubuntu 12.04 system (/boot/grub/grub.cfg)
Code:

menuentry "Windows 7 (loader) (on /dev/sda1)" --class windows --class os {
        insmod part_msdos
        insmod ntfs
        set root='(hd0,msdos1)'
        search --no-floppy --fs-uuid --set=root E05A431C5A42EEBA
        chainloader +1
}


ValleyForge 09-07-2012 12:14 PM

Quote:

Originally Posted by snowpine (Post 4775122)
I did not realize you had tried "sudo update-grub" because at no point did you mention it and I'm not a mind reader. You mention you tried "update-grub" but the "sudo" is very important.

Something is strange with the fact you're editing menu.lst because Ubuntu no longer uses that file. Are you sure you aren't following some tutorial written for an older version of Ubuntu?

This one is up-to-date and reliable, give it a read: https://help.ubuntu.com/community/Grub2

I said: "I ran 'sudo os-prober' and 'sudo update-grub'" but it spanned across two lines with "update-grub" on a new line so I understand the confusion. I'm looking at this. I suppose I'll look into Grub 2. But when I edit menu.lst, the changes reflect in the Grub boot menu immediately, so I'm sure it's using it. Maybe Ubuntu doesn't use it but Xubuntu does.
Quote:

Originally Posted by Wim Sturkenboom (Post 4775120)
I'm new to Windows 7, but it has a seperate boot partition. On my system that's the first partition so that partition IS important.
You must point to the first partition which will contain the Windows bootloader, not to Windows partion itself.

Something like this? No guarantee.
Code:

title Microsoft Windows XP Professional at sda1
rootnoverify (hd0,0)
chainloader +1

Maybe it must be root instead of rootnoverify

I've tried both root and rootnoverify with the same results. I'm certain that Windows 7 doesn't usually have a seperate partition to boot to, looking at the partitions of my desktop PC and my Dad's desktop PC. My Dad has a bunch of different hard drives, all with a bunch of different Windows installations each with their own partition. He uses a program called BCDEdit to edit his BCD which changes his Windows bootloader and customizes the titles and such. I just can't get Grub to try to boot to Windows, which I think manages its BCD automatically. I'll try booting to hd0,0 "DellUtility" anyway.

ValleyForge 09-07-2012 12:32 PM

Quote:

Originally Posted by Wim Sturkenboom (Post 4775137)
Xubuntu might still use legacy grub; I don't know, but the reference to menu.lst also struck me as strange.

For grub2, this is the Win7 entry on my Ubuntu 12.04 system (/boot/grub/grub.cfg)
Code:

menuentry "Windows 7 (loader) (on /dev/sda1)" --class windows --class os {
        insmod part_msdos
        insmod ntfs
        set root='(hd0,msdos1)'
        search --no-floppy --fs-uuid --set=root E05A431C5A42EEBA
        chainloader +1
}


I think what happened is, when messing around with stuff I accidentally installed Grub legacy. So I installed Grub 2, and it sees my Windows 7 loader! But when I boot presently it goes to Grub legacy with a message saying "once you have confirmed that Grub 2 works, run the command update-from-grub-legacy to complete the upgrade" or something. I ran that command and got 'sudo: update-from-grub-legacy: command not found'.

Edit: I got it, it was upgrade-from-grub-legacy. Thanks guys!
I have one more question. If I wanted to in the future, is it possible to uninstall Grub from the MBR/wherever it's installed?

Wim Sturkenboom 09-07-2012 12:59 PM

Windows usually has an utility to fix the MBR; that will wipe grub from the MBR. You might however have wiped it after you installed linux in /dev/sda2 ;)

As you might know: do not delete the Linux partition as it holds some files that grub relies on !!

Note:.
If the problem is solved, please mark the thread as such using the thread tools above the first post (on this page)


All times are GMT -5. The time now is 09:59 PM.