Friend was getting annoyed with figuring out physical drive information in all his zpools so wrote this.
It dumps all the devices in a zpool looking up the device id, device info and serial number.
Its been tested on FreeNAS 8.3 and 9.3 so far.
To use it copy the attached file and rename it to remove the ".txt" extension.
Login as root on your FreeNas box and execute it with python.
For my zpool is called tank.
"python zpool-drive-info.py tank"
Have another friend using it capture state of his build, in case he cant get the same information back later if something is in an error state.
I have attached v1.0.5
I am a developer though havn't used python much so maybe its a bit naive.
I am also not an expert on FreeNAS or ZFS but I believe I havn't made serious errors.
This script does not write any data to disk or change any confguration state.
It only executes the following commands to collect information and present it.
# "zpool status"
# "camcontrol devlist"
# "glabel status"
# "smartctl -i /dev/<device>" - this is run for each device to lookup serial
WARNING - Any script you find on the internet might be doing bad things so in general you should not just grab it and run it. Either you should understand it or someone you trust understands it before running it.
Example output. I hid the serial numbers in the example.
It dumps all the devices in a zpool looking up the device id, device info and serial number.
Its been tested on FreeNAS 8.3 and 9.3 so far.
To use it copy the attached file and rename it to remove the ".txt" extension.
Login as root on your FreeNas box and execute it with python.
For my zpool is called tank.
"python zpool-drive-info.py tank"
Have another friend using it capture state of his build, in case he cant get the same information back later if something is in an error state.
I have attached v1.0.5
I am a developer though havn't used python much so maybe its a bit naive.
I am also not an expert on FreeNAS or ZFS but I believe I havn't made serious errors.
This script does not write any data to disk or change any confguration state.
It only executes the following commands to collect information and present it.
# "zpool status"
# "camcontrol devlist"
# "glabel status"
# "smartctl -i /dev/<device>" - this is run for each device to lookup serial
WARNING - Any script you find on the internet might be doing bad things so in general you should not just grab it and run it. Either you should understand it or someone you trust understands it before running it.
Example output. I hid the serial numbers in the example.
Code:
[root@tonk] /mnt/tank/b1# python zpool-drive-info.py tank pool: tank vdev: raidz1-0 (1) id: gptid/9c686292-6436-11e2-bf42-3cd92b042ab1 device: ada0 driveinfo: <Hitachi HDS5C3030ALA630 MEAOA5C0> serial: [Serial Hidden] id: gptid/9d22503a-6436-11e2-bf42-3cd92b042ab1 device: ada1 driveinfo: <Hitachi HDS5C3030ALA630 MEAOA5C0> serial: [Serial Hidden] id: gptid/9dd96a31-6436-11e2-bf42-3cd92b042ab1 device: ada2 driveinfo: <Hitachi HDS5C3030ALA630 MEAOA5C0> serial: [Serial Hidden] id: gptid/9e8ffacf-6436-11e2-bf42-3cd92b042ab1 device: ada3 driveinfo: <Hitachi HDS5C3030ALA630 MEAOA5C0> serial: [Serial Hidden] id: gptid/9f4ca51b-6436-11e2-bf42-3cd92b042ab1 device: ada4 driveinfo: <Hitachi HDS5C3030ALA630 MEAOA5C0> serial: [Serial Hidden] id: gptid/a00e3056-6436-11e2-bf42-3cd92b042ab1 device: ada5 driveinfo: <Hitachi HDS5C3030ALA630 MEAOA5C0> serial: [Serial Hidden]
Attachments
Last edited: