On Tue, 15 Apr 2008, sudha kar wrote:
> Date: Tue, 15 Apr 2008 17:39:56 +0530
> From: sudha kar <[EMAIL PROTECTED]>
> Reply-To: <[email protected]>
> To: <[email protected]>
> Subject: [twincling] Physical drive
>
> Hi all,
> I am scanning all the connected hard disks(scsi) using scsi inquiry command
> starting from PHYSICALDRIVE0 to PHYSICALDRIVE255. Is there anyway(scsi
> command) to identify the drive in which OS is installed or OS is running
> from, out of those drives I detected from the scanning? Thanks in advance.
>
> --
> Regards
> Sudhakara Rao Murala
>
The steps required would be:
for each physical-drive
detect the boot partition
extract magic-number from the executable
lookup table (magic-number :: OS)
print os-name
end
The magic number information can be used from the file
/usr/share/misc/magic
With SCSI INQUIRY command you can try this approach
set the EVPD bit to 1
process the 96th byte onwards data or VPD (Vital Product Data) buffer
to extract the information.
However, i have found this to work for device related information
eg. IOmege external Zip drive related information, but OS related
information would not be there in most of the cases.
Hope this helps.
thanks
Saifi.