LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 09-28-2010, 02:25 AM   #1
BigCheezy
LQ Newbie
 
Registered: Sep 2010
Posts: 7

Rep: Reputation: 0
Windows upgrade -> GRUB help


Here is a summary of my situation. I was dual-booting Windows XP and Ubuntu, but I don't remember which disk I was booting off of back then. The state I am in now is such that I must use the BIOS to switch between accessing Ubuntu and Windows.

When I have hard drive 1 (lets call it WD for western digital) as primary boot device in BIOS, GRUB loads up. From this GRUB screen I can select Linux and boot into it just fine. I have an option however for Windows XP, which I have since upgraded to Windows 7. Selecting that option causes boot to fail with some short message.

When I have hard drive 2 (lets call it S for samsung) as primary boot device in BIOS, I boot straight into Windows 7 just fine.

GRUB and Ubuntu is located on WD, and Windows is on S. How do I fix GRUB to successfully point to and boot S for my Windows option so that I can keep WD as my primary boot device and go through GRUB?

Thanks for the help! I couldn't quite get the information I needed looking over the many similar threads...

Last edited by BigCheezy; 09-28-2010 at 02:27 AM.
 
Old 09-28-2010, 04:02 AM   #2
ronlau9
Senior Member
 
Registered: Dec 2007
Location: In front of my LINUX OR MAC BOX
Distribution: Mandriva 2009 X86_64 suse 11.3 X86_64 Centos X86_64 Debian X86_64 Linux MInt 86_64 OS X
Posts: 2,369

Rep: Reputation: Disabled
As a start run the command fdisk -l
And post the output to provide us with some use full information bout you're disk and it partitioning
 
Old 09-28-2010, 12:12 PM   #3
BigCheezy
LQ Newbie
 
Registered: Sep 2010
Posts: 7

Original Poster
Rep: Reputation: 0
Well, I actually have many more drives than the two I mentioned for simplicity, but here is the output:
Code:
Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xa4cd8d84

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         261     2096451   82  Linux swap / Solaris
/dev/sda2             262        6527    50331645   83  Linux
/dev/sda3            6528       38913   260140545    7  HPFS/NTFS

Disk /dev/sdc: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x3d8d3d8c

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *           1       38912   312560608+   7  HPFS/NTFS

Disk /dev/sdb: 750.2 GB, 750156374016 bytes
255 heads, 63 sectors/track, 91201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x7c09fd38

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       91201   732572001    7  HPFS/NTFS

Disk /dev/sdd: 1500.3 GB, 1500301910016 bytes
255 heads, 63 sectors/track, 182401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x26cc5e3f

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1      182401  1465136001    7  HPFS/NTFS

Disk /dev/sde: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x38ab364b

   Device Boot      Start         End      Blocks   Id  System
/dev/sde1               1      121602   976759808    7  HPFS/NTFS
Disk /dev/sdc is the partition that contains Windows. Also what is the difference between /dev/sdc and /dev/sdc1?

Last edited by BigCheezy; 09-28-2010 at 12:21 PM.
 
Old 09-28-2010, 02:53 PM   #4
ronlau9
Senior Member
 
Registered: Dec 2007
Location: In front of my LINUX OR MAC BOX
Distribution: Mandriva 2009 X86_64 suse 11.3 X86_64 Centos X86_64 Debian X86_64 Linux MInt 86_64 OS X
Posts: 2,369

Rep: Reputation: Disabled
As windows is not hd0 we have to map you're drives
Depending on the UBUNTu version you use you have GRUB 2 or GHUB 1
UBUNTU 10.4 uses grub 2 in that case you grub.cfg /boot/grub/grub.cfg
In older versions of Ubuntu have GRUB 1 meaning you are using menu.lst /boot/grub/menu.lst
Depending on the on the grub you use ad the begin of the windows the lines
Map (hd0) (hd3)
Map (hd3) (hd0)

Sdc is you third physical drive
sdc1 is the first partition on sdc
 
Old 09-28-2010, 03:44 PM   #5
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
If you are using karmic or Lucid all you may have to do is from ubuntu terminal run the command

sudo update-grub

If this does not help here is a good tutorial

grub2
 
Old 09-28-2010, 09:31 PM   #6
BigCheezy
LQ Newbie
 
Registered: Sep 2010
Posts: 7

Original Poster
Rep: Reputation: 0
I have a menu.lst file and am working on an upgraded ubuntu that was originally much older, so I am certain I have GRUB 1.

Why do I want to Map hd0 to hd3 and hd3 to hd0? Can't I just change the root entry? Right now my entry for Windows looks like:
Code:
title		Microsoft Windows XP Professional
root		(hd0,0)
savedefault
makeactive
chainloader	+1
wouldn't the fix look something like:

Code:
title		Microsoft Windows 7
root		(hd2,0)
savedefault
makeactive
chainloader	+1
I'm trying to figure out what the relationship between the notation "hdx" means in relationship to "sdx". Is it equivalent in meaning (enumerating the logical hard drives) but using 0 indexed numbers when doing hd0, hd1, etc. and letters for sda, sdb, sdc, etc.? What does the s stand for?

UPDATE:
Doing the above change to menu.lst causes boot to hang with "Starting up..." I'm guessing I need to change the Windows bootmgr somehow?

Last edited by BigCheezy; 09-28-2010 at 09:41 PM.
 
Old 09-28-2010, 11:27 PM   #7
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,508

Rep: Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490
Quote:
Why do I want to Map hd0 to hd3 and hd3 to hd0?
Because of the difficulty in booting windows when it is not on the first drive. You would have to go to Microsoft to get an explanation of the why, no reason it couldn't be done.

Quote:
Can't I just change the root entry?
You can try, I doubt it will for the reason explained above. Try the entry below:

Quote:
title Microsoft Windows 7
rootnoverify (hd2,0)
map (hd0) (hd2)
map (hd2) (hd0)
chainloader +1
You don't need (or should not at least) the makeactive line as your windows partition is already marked active.

The (hd0) entries in Grub are the naming convention its developers use. In Grub Legacy, both hard drives and partitions are numbered beginning with zero (0). In Grub 2, hard drives are numbered from zero (0) and partitions are numbered from one (1).

So (hd0) in Grub would be the first drive, (hd1) the second, etc.
Using fdisk, for example, you would see sda, sdb, etc .
(hd0) should be equal to sda, (hd1) to sdb, etc. This is usually the case but not always.

The 's' used to refer to scsi drives as and the 'h' to IDE but newer distributions have taken to using 's' for all drives, mostly.
 
Old 09-28-2010, 11:37 PM   #8
Kenny_Strawn
Senior Member
 
Registered: Feb 2010
Location: /usa/ca/orange_county/lake_forest
Distribution: ArchBang, Google Android 2.1 + Motoblur (on Motortola Flipside), Google Chrome OS (on Cr-48)
Posts: 1,791
Blog Entries: 62

Rep: Reputation: 56
And also: Clean installs of Windows erase GRUB from the MBR, which means you have to boot from the Ubuntu Live CD, open a terminal window, and issue the following commands:

Code:
sudo grub-install /dev/sda && sudo update-grub
This will reinstall GRUB and reconfigure it.
 
Old 09-29-2010, 01:05 AM   #9
BigCheezy
LQ Newbie
 
Registered: Sep 2010
Posts: 7

Original Poster
Rep: Reputation: 0
@Kenny_Strawn, GRUB is not located on the MBR of the Windows partition. I can access the GRUB program just fine by selecting one hard drive to boot with in the BIOS, and Windows by selecting the other. Does your advice still apply?
 
Old 09-29-2010, 01:25 AM   #10
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
That is probably where your problem started is you changed the boot order in bios originally. If you leave your boot order this way Yancek is right you will need to remap your hd in grub menu. M$ thinks if has to be on the first partition of the first drive in order to work. You are tricking it by remapping grub.
 
Old 09-30-2010, 11:48 AM   #11
BigCheezy
LQ Newbie
 
Registered: Sep 2010
Posts: 7

Original Poster
Rep: Reputation: 0
So my entry for Windows looks like this now:
Code:
title		Microsoft Windows 7
rootnoverify	(hd2,0)
map 		(hd0) (hd2)
map		(hd2) (hd0)
#savedefault
#makeactive
chainloader	+1
When I select Windows from GRUB, however, I get the message "NTDLR is missing." What now? Also, what does rootnoverify mean?
 
Old 09-30-2010, 11:18 PM   #12
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,508

Rep: Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490
Quote:
When I select Windows from GRUB, however, I get the message "NTDLR is missing.
You stated in your first post that you initially had windows xp on your drive and you upgraded it to windows 7, is that correct? If it is, you did something wrong because there is no NTLDR in windows 7, that was in xp. Win 7 and vista use a totally different bootloader than xp. You might do a search here on repairing windows 7 bootloader, I've seen posts about it or just google it. The error you report indicates Grub is getting to your windows boot sector but it is no correct.

Quote:
Also, what does rootnoverify mean?
According to the Grub manual at this link: http://orgs.man.ac.uk/documentation/grub/grub_13.html

It means "Set GRUB's root device without mounting" and is usually used with windows ntfs filesystems.
 
Old 10-01-2010, 02:58 AM   #13
BigCheezy
LQ Newbie
 
Registered: Sep 2010
Posts: 7

Original Poster
Rep: Reputation: 0
To clarify, I did a fresh install of Windows 7, completely reformatting the partition XP was on originally.

If the Win 7 boot loader was messed up, how come it boots fine when I select the drive from BIOS?
 
Old 10-01-2010, 05:28 AM   #14
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
Substitute 1 for 2 in all your numbers and see if that works. There seem to be a lot of ntfs partitions for being a clean install?

Last edited by Larry Webb; 10-01-2010 at 05:31 AM.
 
Old 10-03-2010, 11:27 PM   #15
BigCheezy
LQ Newbie
 
Registered: Sep 2010
Posts: 7

Original Poster
Rep: Reputation: 0
Got it to work by substituting 3 for 2. Woot, thanks for the help!
 
  


Reply



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
Want to upgrade Windows Vista to Windows 7 on a Dual Boot machine Ubuntu/Winvista. hector3rd Linux - Desktop 6 08-07-2010 05:33 PM
synaptic upgrade quit; blasted on using apt-get;upgrade; x-windows now gone blupton Linux - Newbie 0 11-22-2009 03:48 PM
winXP + RedHat9 + Grub = can't Upgrade Windows firstlastcase Linux - Software 4 08-12-2007 11:36 AM
installing vista upgrade on my windows partion, will GRUB get in the way? chris598 Linux - General 2 05-19-2007 08:44 AM
Grub not finding grub.conf post fc6 upgrade billymayday Fedora - Installation 1 10-30-2006 04:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 08:15 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
Open Source Consulting | Domain Registration