0

I have installed win7 in my disk c:,and the file system format is ntfs. there is another disk e: (fat32 format). I have download grub4dos,and initrd.gz, vmlinuz,and debian7.5.iso in c:.

  1. edit the boot.ini

    [boot loader]    
    [operating systems]    
    c:\grldr.mbr="Grub4dos"    
    
  2. edit the menu.lst

    title    Install Debian 7.5    
    kernel    (hd0,0)/vmlinuz     
    initrd    (hd0,0)/initrd.gz    
    boot 
    

when rebooting my pc, i can enter grub ui, click "Install Debian 7.5", get error:

kernel    (hd0,0)/vmlinuz   file not found.    

Maybe the reason is filesystem format, debian7.5.iso and vmlinuz and initrd.gz can not be read under ntfs, so i cut the files into e: disk, how to edit the menu.lst now?

It is a typo ,i fix it.

1 Answer 1

1

(hdD,P) means "hard drive (hence hd) device → device number D → partition number P". GRUB numbers devices (inside their class) and partitions (inside a device) starting from 0.

In your entry for the initrd image you've got this right: (hd0,0) selects the first partition of the first hard drive device, but in your entry for the kernel you for some reason dropped the partition number, and (hd0,) has no sense ((hd0) does but it refers to the whole device which you don't want if your device has partitions).

So I'd say the fix is to change

kernel (hd0,)/vmlinuz

to

kernel (hd0,0)/vmlinuz

Note that this change should fix the situation for volume C:. If you want this to apply to volume E: you have to deduce which hard drive and partision number on it the volume E: uses and fix those (hd0,0) to read something like (hd0,2).

To get this information, the easiest (probably) is to use the diskpart Windows tool:

  1. Start the command prompt, cmd.exe, (possibly with elevated privileges—I don't know for sure).
  2. There, run

    diskpart
    

    it presents you with its own shell, where you execute its commands. At any time you might enter help and hit the Return key to get help.

    The next steps are carried out in the diskpart's shell.

  3. Run

    list disk
    

    to get the numbered list of disks attached to the computer. They are conveniently indexed starting with 0—just what GRUB uses.

  4. Run

    select disk N
    

    where N is the number of disk you're interested in to change the tool's context to that disk.

  5. Run

    list partition
    

    to get the list of partisions of the selected disk. Note that the partitions are numbered from 1.

  6. Run

    select partition M
    

    to change the tool's context to the partition number M of the selected disk.

  7. Run

    detail partition
    

    to get the detailed information about the selected partition, including the volume letter it's attached as.

    Rinse and repeat until you've found the partition for your volume E:. When you're done, you have two numbers to construct the (hdD,P) spec.

You can quit diskpart by entering exit.

3
  • how can i get all the file names in the selected partition?
    – showkey
    May 26, 2014 at 22:43
  • @it_is_a_literature, with diskpart? No way--it only deals with disks, partitions and volumes; not with file systems. But once you know the partition you need (detail partition called on it lists the volume you're looking for--say, E:), just fire up Windows Explorer and browse that volume (E:, that is).
    – kostix
    May 27, 2014 at 9:56
  • i fount that when the drive number is 3 in diskpart ,you should minus 1 into 2 in your menu.lst.
    – showkey
    May 28, 2014 at 1:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .