Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking at a system with Debian/Lenny on a couple of old IDE PATA drives (several RAID-1 partitions including /boot) and a relatively recently added SATA drive. The system works fine but I've been poking around the GRUB setup in anticipation of upgrading the old drives...

If I go straight to the grub command line when the boot menu appears and inspect the drives there (using

grub> root (<TAB>...)

) then I see hd0 and hd1 as the PATAs and hd2 as the SATA.

However, after the system boots up if I do the same thing then I see hd0 is now the SATA and hd1 and hd2 are the PATAs. (Also, the system maps /dev/sda,c,b to SATA,PATA,PATA.)

This makes me a bit nervous about making changes from the grub> prompt once the machine has booted. So:

Why does the device order seen by grub change between these 2 cases ?


Correct functioning of some GRUB commands seems to rely on being correct. Currently it contains a single line:

(hd0)   /dev/md0

(Which is the RAID1 /boot) but I've no idea where that came from (this system goes back to woody I think)! grub-mkdevicemap wants to regenerate this as hd[0,1,2]->sd[a,b,c](but I haven't let it). update-grub tells me: warning: grub-probe can't find drive for /dev/sdb1. Any suggestions as to what a healthy should look like, in light of the changing enumeration order ? (It's unclear to me whether it should contain the pre- or post- boot device enumeration order).

share|improve this question
up vote 2 down vote accepted

The pre-boot drive ordering seemed to correspond to the the order in the BIOS boot-menu. Making changes there had no effect on the post-boot ordering, so I just changed it to be the same as the post-boot order, and a fresh generated post-boot now contains some content which is valid pre-boot too.

Achieved the desired result: I feel a lot more comfortable about messing around in the pre- or post-boot grub shells, and I know whera a >grub setup (hd1) (hd1,0) is really going.

share|improve this answer
Actually that makes sense...pre-boot = BIOS. post-boot = devicemap – Software Mechanic May 16 '11 at 12:42

Edit your /boot/grub/ file to reflect the boot time mapping, and it should be perfectly safe to use the command line grub utility.

share|improve this answer

maybe at boot time your grub does a drive mapping:

look here

Don't know how actual this is, but I remember times you could only boot from the primary HDD and you needed to use the mapping thing to boot correctly. Look in yout config of grub, maybe thats it what grub does.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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