Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
My wife's desktop computer is running Ubuntu 10.4, with no problems after the recent upgrade, on a single 640GB HD.
I decided to add a new 320GB HD with a clean install of Windows XP. I thought I could then reinstall Grub, either by booting the original Linux system on the original HD or using a live CD, and evolve her computer into a dual boot arrangement. I use a dual boot system on my own computer, but I did it the easy way: I did a clean install of WinXP on a new HD, got it running, and then did a clean install of Ubuntu on a second HD. Grub found its way around and everything went smoothly.
Now I had the opposite and less desirable situation of an already installed Ubuntu system and wanting to add and integrate a new Windows install. I formatted the entire new HD as NTFS, using gparted under Ubuntu. I then tried to install WinXP from the MS CD. I changed the boot sequence in BIOS. When I booted, the system completely ignored the CD drive and went directly to the HDs to try to boot!
Problem: The computer insists on booting the HDs; it ignores the BIOS setting. Therefore, I can't boot from the CD drive and install WinXP. Here are some further symptoms:
1.) I get a Grub prompt: "grub restore>". So I tried the MS WinXP disc in my own computer. With a BIOS change, it booted into the WinXP setup program, as expected, direct from the CD. My conclusion: the WinXP installation disc is OK.
2.) I disconnected the new HD and rebooted. I was still able to boot into the original Linux system, but the CD drive was still ignored.
4.) I reconnected the new HD and DISCONNECTED the Linux drive. Rebooted. The system still ignored the CD drive, went for the HD, and ended up with an error command line prompt: "grub restore>". With my Linux system completely disconnected and a freshly partitioned HD installed, where was this Grub prompt coming from???
5.) So I disconnected BOTH drives (i.e., NO HDs installed!). Then the system booted up the WinXP CD and windows setup. But, of course, I didn't have any HD installed. When I reboot after re-connecting the new HD, the system once again ignores the CD drive and I get the Grub restore prompt. Conclusion: the CD/DVD drive is working OK.
QUESTION: Does Grub write something to the BIOS/CMOS? I didn't think it did. But then, why do I keep getting this bizarre grub prompt when the only things installed are a clean NTFS-partitioned HD and a WinXP disc in the CD drive?
As always, I hope I'm not asking for something that should be obvious. I should add that most of these boot attempts were after changing ALL three boot devices (boot priority/sequence) to the CD/DVD drive in the BIOS. Still no luck.
I'm guessing GRUB was either already on or somehow got onto the drive you intended to use for Windows. I don't know precisely what you did when you were formatting the NTFS partition, but one of those steps likely put some piece of GRUB on that disk. I'd bet that if you ran
hexdump -C /dev/sdX | less
where sdX is the target Windows drive, you'd get some GRUB-looking content on the first few sectors of the drive.
That said, it sounds like your BIOS is full of crap or otherwise is incorrectly configured. Does the BIOS have a boot menu? Can you enter the boot menu and manually select the CD drive for booting? (Just about every BIOS made in the last couple years has a boot menu - you have to whack the right key at startup.)
And no, GRUB does not write to the BIOS in any way.
Is the new hard drive connected to the same ide ribbon as the cd/dvd drive? If yes, have you checked the jumper settings to make sure one is master and the other set to slave?
Grub does not write to your BIOS, it only gets drive information from the BIOS. When you say you're changing the BIOS, are you actually going into the BIOS setup and changing the boot order and boot devices, or just selecting a boot device from a list? If you're changing the BIOS settings, it sounds like they are not being saved when you exit. You did save those settings, correct? Usually with the f10 key or selecting save on the last page. Have you encountered any messages about cmos checksum being bad? That could indicate a cmos battery going bad
Yes, I changed the BIOS to boot from the CD. There are two settings there: one for hard disk boot priority, which only matters if there are more than two HDs and the BIOS is set to first try booting from the HD. Then there are three settings for "first boot device," "second boot device," and "third boot device." Initially I set the first boot device to the CD/DVD drive. When I still couldn't boot from the CD drive, I then set all three settings to the CD drive, with the same results. Yes, I saved my settings (F10) and know they were saved, since they still have my changed settings everytime I re-enter the BIOS.
I think the next thing to try is tvynrylan's suggestion to inspect the first few sectors of the clean NTFS-formatted partition for grub info. But I just don't understand how I can still be getting a grub rescue message with only a clean newly-partitioned NTFS drive installed.
To Nexus: Both HDs and the CD/DVD drive are SATA; no IDE stuff involved.
I've never had any other problems with the BIOS. The MB is less than one year old. There have been no symptoms of failing battery. In the old days, the first sign of this was a failure of the BIOS to remember the current date and time. No such problems.
Yes, after changing the boot sequence in the BIOS, there is still the option to press a function key to bring up a boot menu while the system is booting. I accessed this a couple of times. It had a default tick next to the HD option in the list. I scrolled down and chose the CD/DVD drive option, but still the same result: no boot from the CD drive.
It seems strange that, with NO HDs installed, the BIOS manages to find and boot from the CD/DVD drive, as expected. With either HD installed, however, it ignores the CD drive and seems to be accessing a Grub system. I still need to examine the boot sectors on the clean NTFS drive. That could be very revealing.
BTW, I mentioned that I had first formatted the new drive as NTFS, but using gparted in Ubuntu. Thinking this might have somehow caused the problem, I then completely deleted the partition using gparted (it then was "unallocated space") and then re-allocated it and formatted it as NTFS using Norton Partition Magic under Windows. That didn't seem to make any difference.
I finally got around to examining the new HD I wanted to install WinXP on to see if there were any traces of Grub. Here's what I did:
I hooked the new HD up to my own dual-boot computer using a HD docking device and an eSata connection from the drive to my computer. As expected, neither WinXP nor my Ubuntu OSs could see the drive, although BIOS recognized it. This was because the drive is entirely unallocated, i.e., no partitions at all. Note that, although there were no partitions, the drive had been partitioned and formatted as both NTFS and Linux Ext3 during earlier efforts. Those earlier partitions, although deleted, were never secure-erased. Perhaps this is important.
I ran WinXP and used Norton Partition Magic to create a brand new NTFS primary partition on the new HD. This was finished so fast that I'm sure there was no complete secure-erase formatting done on the drive. Then, of course, WinXP could see the drive, empty though it be. As expected.
Then I rebooted into Ubuntu (10.4) and looked at all my HDs using gparted. Everything looked great, including the new HD (D) with NTFS file system on it. FYI, I have a 640GB HD (A) with WinXP & NTFS installed, a second 640GB HD (B) with Ubuntu 10.4 and Ext4 installed, and a third NTFS HD (C) used for data.
I then examined the first few sectors of every drive, using hexdump from a Linux terminal. I entered the following commands
Code:
gary@grande:~$ sudo hexdump -C /dev/sda | less
gary@grande:~$ sudo hexdump -C /dev/sdb | less
gary@grande:~$ sudo hexdump -C /dev/sdb6 | less
gary@grande:~$ sudo hexdump -C /dev/sdc | less
gary@grande:~$ sudo hexdump -C /dev/sdd | less
To my surprise, I found the following data present in the first part of the HDs sectors for sda (my WinXP boot drive), sdb (my Linux boot drive), sdc (my NTFS data drive), and sdd (the newly partioned NTFS drive):
Note that I also dumped the first bytes from a large Ext4 partition (sdb6) which is simply a Linux data partition not meant to boot from. The above grub traces were not found on that drive.
My Question: Given all the above, although I expected to find grub traces in my two boot drives, sda and sdb, why am I finding traces of grub on a newly partioned drive with a fresh NTFS file system installed by Partition Magic running under the WinXP OS? Is it residual data from earlier partitioning? Is it because, although I created everything under Windows, I am analysing everything using Linux tools? Is it more than interesting that my NTFS data drive (sdc) also has grub traces in its first sectors?
I would be thankful if anyone can give me an explanation of what's going on.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.