On Sun, Dec 03, 2006 at 10:39:01AM +0200, Ira Abramov wrote:
> I'm booting a PXE image on a node that I want to back up with partimage.
> I have to detect the disk it uses for it's root. right now I'm guessing
> it with the result of this:
>
> sfdisk -d /dev/sd? /dev/hd? /dev/cciss/???? 2>/dev/null | awk 'NR==1 {print
> $(NF)}'
>
> is there a more correct or exact way to deduce this by asking the kernel
> what it would boot if PXE was not active?
"the kernel" or the BIOS? Please be more specific about what exactly
your boot process is, e.g. where is your kernel loaded from etc.
Assuming you mean "the BIOS", that is - a machine that has in its BIOS
CMOS setup a setting to do a specific boot order, and e.g. the first is
boot from network, second boot from (a specific) local disk:
I am not sure there is a portable, documented way to do this.
I did similar things for specific machines (or types of machines) by
dding /dev/nvram (after modprobe nvram) before and after changing a
specific setting in the BIOS CMOS setup, and comparing the results (e.g.
with 'cmp -l'). If you only need to do that for few machines, or many
but of the exact same type (including BIOS version etc.), this can be a
rather good way. IIRC I even changed settings this way (by writing to
/dev/nvram a copy of the intended setup) but it did not always work.
--
Didi
=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]