Getting Serial Number of the Hard Drive Provided by the manufacturer through PHP : How can it be done? I want to store it in a file.
OS : windows 2000,XP,ME,Vista.
On *nix based machine you can also use ls /dev/disk/by-id/
because hdparm
need root permission (see Patrick Daryll G. answer).
&1', $output);
echo 'HDD: '.$output[0].'
';
$outputs = explode('_', $outputs[0]);
$outputs = end($outputs);
echo 'HDD-SN: '.$output.'
';
and you will get something like this
HDD: ata-HGST_XXX1234567890XX_ABCD123456789X // -_
HDD-SN: ABCD123456789X // Your HDD Serial Number