Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 ?

Also:

Correct functioning of some GRUB commands seems to rely on device.map 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 device.map 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
add comment

3 Answers

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 devices.map 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 –  Anand Jeyahar May 16 '11 at 12:42
add comment

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

share|improve this answer
add comment

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
add comment

Your Answer

 
discard

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.