LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Difficulty loading Vista Partition through Grub (https://www.linuxquestions.org/questions/linux-software-2/difficulty-loading-vista-partition-through-grub-693009/)

ajungstein 12-26-2008 12:12 AM

Difficulty loading Vista Partition through Grub
 
Dear Linux Community,

I was hoping you could help me with a problem I have been having. I installed Gentoo using a minimal install CD with a grub bootloader and unfortunately I am having trouble booting my existing windows partition. When grub starts, I get the option to boot through linux (which works as expected) or boot through windows Vista. I select the windows Vista option and I get the following respective window displaying the following error message:

Code:

  Booting 'Microsoft Windows Vista'
rootnoverify (hd0,0)
chainloader +1

Error 13: Invalid or unsupported executable format

Press any key to continue...

Since this process fails, I tried using the grub command line to gain some insight on my problem. I utilize the TAB completion interface to verify what is going on. After I type rootnoverify( and use the tab completion it successfully shows that one of the possible disks to boot from is hd0.

When I type rootnoverify(hd0, and use tab completion, I get the following message:

Code:

Possible partitions are:
Partition num: 0, Filesystem type unknown, partition type 0x7
Partition num: 1, Filesystem type is ext2fs, partition type 0x83
Partition num: 2, Filesystem type unknown, partition type 0x82
Partition num: 3, Filesystem type is ext2fs, partition type 0x83

My partitions are set in the following manner:
Partition 0: Windows vista partition
Partition 1: Linux boot partition
Partition 2: Linux swap partition
Partition 3: Linux root partition

At first, I thought that my windows partition might be damaged and the filesystem type cannot be detected by grub. I loaded linux in order to gain some more insight regarding my current partitions and their respective filetypes. I ran the following commands in the linux terminal with the following results:

Code:

#fdisk /dev/sda
The number of cylinders for this disk is set to 19457. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
  (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help):p

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/trac, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier 0x495d0lab

  Device  Boot    Start    End      Blocks  Id  System
/dev/sda1  *          1  17322    139132336    7  HPFS/NTFS
/dev/sda2  *      17322  17326        38727+  83  Linux
/dev/sda3          17327  17389      506047+  82  Linux swap / Solaris
/dev/sda4          17390  19457    16611210  83  Linux

I am confused since linux recognizes my filesystem type for the windows partition sda1, whereas grub has a problem recognizing the NTFS filesystem type. I am guessing that the problem might be the the filesystem type is HPFS/NTFS.

I was hoping someone could help me fix this issue. At this point, recovering the files in my windows partition is my top priority. I am willing to reinstall linux at any time. Please note that I have no preference in terms of using grub as a bootloader. I used to have the default windows boot loader load both windows or Ubuntu at any time and worked perfectly. Any insight regarding on how to solve this problem would be greatly appreciated. Thanks!

htnakirs 12-26-2008 12:46 AM

IT seems the active partition option has not been set. Search up on this. The Vista partition needs to be set Active. You get this option when installing grub, I am not sure how to edit the menu.lst file afterwards.

billymayday 12-26-2008 12:58 AM

Try adding

makeactive

between rootnoverify and chainloader

syg00 12-26-2008 01:42 AM

Looks like an extraneous blank in the rootnoverify - after the comma.

james2b 12-26-2008 02:30 AM

Only one partition can be flagged as; "active or boot" for each drive. And so for your drive, the sda1 (ntfs, windows partition) must be marked as the only active boot partition. You can fix that by booting to a Linux tool called; GParted, here; http://gparted.sourceforge.net/ , also here is the grub site; http://www.gnu.org/software/grub/manual/grub.html ,also in your grub boot file for windows Vista you need to have it look like this; title Vista
root (hd0,0)
makeactive
chainloader +1
You can not use the makeactive option with rootnoverify because that sets the grub's root device without mounting, and the grub needs to mount a partition to make it active. To list all partitions most people use this here; fdisk -l , and windows XP and Vista will show the filesystem type as HPFS/NTFS, so that is correct, but you may need to run that check disk tool from booted to windows disk to repair the Vista NTFS file system. Also for grub every item must be exactly correct, and your; rootnoverify (hd0, 0) has a extra space which can not be there, it must be like this with no spaces; (hd0,0).

syg00 12-26-2008 02:46 AM

Quote:

Originally Posted by james2b (Post 3387442)
Only one partition can be flagged as; "active or boot" for each drive. And so for your drive, the sda1 (ntfs, windows partition) must be marked as the only active boot partition.

No true for Linux (at least) boot-loaders.
This is a legend perpetuated because the Windoze boot-loaders check this flag. grub and lilo don't care - and neither they should.
If using either of these, the boot flag is irrelevant. I have found some BIOS code that checks for it though - obviously influenced by Redmond.

ajungstein 12-26-2008 01:10 PM

Thank you for all the responses. I tried the following but unfortunately did not succeed. I have listed the results for each attempt to fix my problem.

syg00: You are right. There is an extraneous blank in my initial post. It was a typo I made when copying the information. I actually did not have a blank in my original grub configuration.

billymayday: I tried adding the command makeactive between rootnoverify and chainloader. Unfortunately I get the same error as my initial post. That is:
Code:

Error 13: Invalid or unsupported executable format
james2b: I haven't tried the gparted boot through a live cd yet. I assume that I am supposed to eliminate the boot flag on my linux boot partition and try to re-boot windows through grub. I'll be trying this shortly.

Thank you everyone for all the help. Any additional help would be appreciated.

syg00 12-26-2008 04:17 PM

Let's see your /boot/grub/menu.lst

CJS 12-26-2008 05:55 PM

In order to get a clearer picture of your setup, how about downloading the "boot_info_script.txt" to your desktop, and then do the following as root user:
Code:

bash ~/Desktop/boot_info_script.txt
That will create a "RESULTS.txt" file in the same directory from where the script is run, namely your desktop; please copy/paste the contents of that file to your next post. That will help clarify your setup and hopefully what your problem might be.


All times are GMT -5. The time now is 12:29 PM.