I am using Linux and i need to restore my grub, so i go into commandline on live CD, and i enter 'grub', then 'root (hd0,6)', but it says that the disk does not exist. This is how everything looks like:





  • /dev/sda5
  • unallocated
  • /dev/sda7 -- This is the partition i need the number from!
  • /dev/sda8
  • /dev/sda6

That's how it looks like in Gparted. (all on one harddisk.)

(everything with a dot is a partition in a partition (dev/sda3))


You may just have to experiment.

Using Grub's commandline tab-completion can help show you what Grub is seeing. By default Grub is probably numbering the partitions in order, starting from (hd0,0), like this:

  • (hd0,0) -- /dev/sda1
  • (hd0,1) -- /dev/sda2
  • not numbered -- /dev/sda3
    • (hd0,2) -- /dev/sda5
    • not numbered -- unallocated
    • (hd0,3) -- /dev/sda7
    • (hd0,4) -- /dev/sda8
    • (hd0,5) -- /dev/sda6

Based on this, (hd0,3) is your best bet.

This assumes your ordering in the question is how partitions are physically ordered on the disc. In particular, this is how your drive should appear under Grub v1; Grub v2's enumeration may differ.

  • in fact, Grub2 numbers partitions starting at 1, so the numbers should match the /dev/sdaN nodes. thus in Grub2, /dev/sda1 is seen as (hd0,1) ; /dev/sda2 as (hd0,2) , etc. – quack quixote Feb 20 '10 at 7:03

Have you tried typing "root (" and hitting tab to list the disks? You should be able to list the disks and count to see if maybe sda7 is showing up as (hd0,5) or something weird.


If you're looking to locate the grub boot files, you can use the 'find command' to determine the partition type.

For example:

grub> find /grub/stage1
find /grub/stage1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.