Try being more specific. What operating system, what do you mean by "registration numbers"?
For example, you can query a drive on capabilities and vendor strings under Linux with the hdparm command:
# hdparm -i /dev/hda /dev/hda: Model=WDC WD307AA-00BAA0, FwRev=10.09K11, SerialNo=WD-WMA2F2556865 Config={ HardSect NotMFM HdSw>15uSec SpinMotCtl Fixed DTR>5Mbs FmtGap +Req } RawCHS=16383/16/63, TrkSize=57600, SectSize=600, ECCbytes=40 BuffType=DualPortCache, BuffSize=2048kB, MaxMultSect=16, MultSect=1 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=60074784 IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120} PIO modes: pio0 pio1 pio2 pio3 pio4 DMA modes: mdma0 mdma1 mdma2 udma0 udma1 *udma2 udma3 udma4 AdvancedPM=no WriteCache=enabled Drive Supports : Reserved : ATA-1 ATA-2 ATA-3 ATA-4
And if the serial number is what you're looking for, here's a Perl script to extract it:
#!/usr/bin/perl my $query = qx{hdparm -i /dev/hda} or die $!; print "HDD serial number is: $1\n" if $query =~ m/SerialNo=([^,\s]+)/s;
The output on my system is:
HDD serial number is: WD-WMA2F2556865
In reply to Re: Can Perl read the hard drive registration #?
by calin
in thread Can Perl read the hard drive registration #?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |