2

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).

timday
  • 856
  • 1
  • 10
  • 24

3 Answers3

2

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.

timday
  • 856
  • 1
  • 10
  • 24
1

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.

Teddy
  • 5,134
  • 1
  • 22
  • 27
0

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.

evildead
  • 892
  • 5
  • 11