LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-06-2012, 11:39 PM   #1
ValleyForge
LQ Newbie
 
Registered: Sep 2012
Posts: 8

Rep: Reputation: Disabled
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.

Last edited by ValleyForge; 09-07-2012 at 12:59 AM.
 
Old 09-07-2012, 01:04 AM   #2
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
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
 
Old 09-07-2012, 11:13 AM   #3
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 6,870

Rep: Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249
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.
 
Old 09-07-2012, 11:34 AM   #4
ValleyForge
LQ Newbie
 
Registered: Sep 2012
Posts: 8

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by EDDY1 View Post
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.

Last edited by ValleyForge; 09-07-2012 at 11:36 AM.
 
Old 09-07-2012, 11:48 AM   #5
ValleyForge
LQ Newbie
 
Registered: Sep 2012
Posts: 8

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by yancek View Post
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).
Attached Files
File Type: txt RESULTS.txt (17.4 KB, 6 views)
 
Old 09-07-2012, 11:50 AM   #6
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
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.
 
Old 09-07-2012, 12:01 PM   #7
ValleyForge
LQ Newbie
 
Registered: Sep 2012
Posts: 8

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by EDDY1 View Post
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.
 
Old 09-07-2012, 12:10 PM   #8
snowpine
Senior Member
 
Registered: Feb 2009
Posts: 4,037

Rep: Reputation: 1099Reputation: 1099Reputation: 1099Reputation: 1099Reputation: 1099Reputation: 1099Reputation: 1099Reputation: 1099
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.
 
Old 09-07-2012, 12:33 PM   #9
ValleyForge
LQ Newbie
 
Registered: Sep 2012
Posts: 8

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by snowpine View Post
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.

Last edited by ValleyForge; 09-07-2012 at 12:38 PM.
 
Old 09-07-2012, 12:48 PM   #10
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
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.

Last edited by Wim Sturkenboom; 09-09-2012 at 10:55 AM.
 
Old 09-07-2012, 12:49 PM   #11
snowpine
Senior Member
 
Registered: Feb 2009
Posts: 4,037

Rep: Reputation: 1099Reputation: 1099Reputation: 1099Reputation: 1099Reputation: 1099Reputation: 1099Reputation: 1099Reputation: 1099
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
 
Old 09-07-2012, 01:07 PM   #12
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
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
}

Last edited by Wim Sturkenboom; 09-07-2012 at 01:27 PM.
 
Old 09-07-2012, 01:14 PM   #13
ValleyForge
LQ Newbie
 
Registered: Sep 2012
Posts: 8

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by snowpine View Post
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 View Post
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.
 
Old 09-07-2012, 01:32 PM   #14
ValleyForge
LQ Newbie
 
Registered: Sep 2012
Posts: 8

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Wim Sturkenboom View Post
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?

Last edited by ValleyForge; 09-07-2012 at 01:46 PM.
 
Old 09-07-2012, 01:59 PM   #15
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
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)

Last edited by Wim Sturkenboom; 09-07-2012 at 02:01 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Wine installed a program onto my windows partition, Windows BSOD on boot. DJGCrusader Linux - Enterprise 9 08-14-2009 09:25 AM
I have windows XP and want to install XUbuntu on a dual boot setup, how do I do it? Mac_09 Linux - Newbie 4 05-07-2008 05:57 PM
[HELP]Broken windows booting. Able to boot to xubuntu. Low Man Linux - Newbie 2 07-03-2007 07:45 AM
Installed Xubuntu and FC6, but FC6 wont boot, is there a solution? mitchell7man Linux - General 3 05-01-2007 05:27 PM
Samba stuff - never used it before...very confusing...help! Thymox Linux - Networking 1 10-08-2001 01:44 PM


All times are GMT -5. The time now is 04:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration