SCSI vs. IDE detection
Paul Jimenez
pj at place.org
Tue Mar 23 22:45:11 CET 2004
On Tuesday, Mar 23, 2004, Justin Beckley writes:
>Hello Everyone,
>
>I have just gotten started with FAI. We are going to be using to
>install many different types of machines. Some of these machines have
>SCSI drives and some have IDE only. Right now I have an installation
>that works for one type of drives, but not the other. I can easily
>change which type of drive it is and that fixes the problem, but that is
>a hassle. I would like to know if anyone has found a good way to let
>the system decide if it is SCSI or IDE, and based on that decision
>figure out which drives to partition?
>
>Justin Beckley
I look in proc. My /far/fai/config/class dir contains a a file
'06diskdetect' that's executable and looks like this:
#! /bin/sh
# default to HDA if no one overrides us
disk="HDA"
# if there's a pdc202xx detected, we should use it
if [ -e /proc/ide/pdc202xx ]; then
disk="HDE"
fi
# are any SCSI devices attached?
if grep -q "^Attached devices: none" /proc/scsi/scsi; then
:
else
disk="SCSI"
# we want also get the filename in front of each
# line. So do not use cat, use grep
[ "$verbose" ] && cat /proc/scsi/scsi
[ "$debug" ] && grep -H . /proc/scsi/*/*
fi
echo $disk
# we always want to be able to boot
echo BOOT
echo MBR
echo GRUB
More information about the linux-fai
mailing list