Determine BIOS Drive Order
Hello, all. I was wondering if anyone had a clue as to how to determine BIOS drive ordering from within Linux. I'm essentially looking for a way to take a device name (i.e., /dev/hda1) and translate it into a GRUB style device description (i.e., "(hd0,0)"). I ask this particularly because my machine, for instance, tends to order its SATA controllers in a rather peculiar way (i.e., (hd0,0) => /dev/sde under 2.6.17, (hd0,0) => /dev/sdc under 2.6.14, etc.).
The real reason I want this information is because I am currently in the process of essentially trying to remake the rescue disk portion of Norton Ghost out of a bootable Linux CD, ntfsprogs, and some of my own added scripts. I see a lot of potential here, since using Linux would allow one to include a number of different storage mechanisms for writing the image file (SSH, NFS, Samba, ext3, etc.) and also allows me access to ntfsprogs, which has pretty much done all of the work for me. I have successfully saved and restored a bootable rescue image using dd (for the MBR), ntfsclone, ntfsresize, and relocntfs. So far, I have had no trouble restoring the image to partitions of different sizes and drives of different geometries than the original.
The problem comes in when I change the partition on which the restore is occurring (i.e., image created using /dev/hda1 and restored onto /dev/hda2). The Windows bootloader file C:\boot.ini needs to know which drive it should mount as C: and it wants a description in the format "multi(0)disk(0)rdisk(0)partition(1)" which is kind of similar to GRUB's "(hd0,0)". I need to be able to generate the former given a device name (such as /dev/sda1).
Suggestions and thoughts are most welcome. Thanks for reading!