-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to get device /dev/nvme1 info #4
Comments
Good day, please try 0.1.4, it should now skip devices with smartctl errors. |
Appreciate the fix! No longer crashes! 👍 Digging further, it's ewout@enthoo ~ % sudo smartctl -a /dev/nvme1 -j
{
"json_format_version": [
1,
0
],
"smartctl": {
"version": [
7,
2
],
"svn_revision": "5155",
"platform_info": "x86_64-linux-5.13.13-arch1-1",
"build_info": "(local build)",
"argv": [
"smartctl",
"-a",
"/dev/nvme1",
"-j"
],
"exit_status": 0
},
"device": {
"name": "/dev/nvme1",
"info_name": "/dev/nvme1",
"type": "nvme",
"protocol": "NVMe"
},
"model_name": "ADATA SX6000LNP",
"serial_number": "2K38291DQ2XG",
"firmware_version": "V9002s45",
"nvme_pci_vendor": {
"id": 4332,
"subsystem_id": 4332
},
"nvme_ieee_oui_identifier": 57420,
"nvme_controller_id": 1,
"nvme_version": {
"string": "1.3",
"value": 66304
},
"nvme_number_of_namespaces": 1,
"nvme_namespaces": [
{
"id": 1,
"size": {
"blocks": 250069680,
"bytes": 128035676160
},
"capacity": {
"blocks": 250069680,
"bytes": 128035676160
},
"utilization": {
"blocks": 250069680,
"bytes": 128035676160
},
"formatted_lba_size": 512
}
],
"user_capacity": {
"blocks": 250069680,
"bytes": 128035676160
},
"logical_block_size": 512,
"local_time": {
"time_t": 1630504706,
"asctime": "Wed Sep 1 15:58:26 2021 CEST"
},
"smart_status": {
"passed": true,
"nvme": {
"value": 0
}
},
"nvme_smart_health_information_log": {
"critical_warning": 0,
"temperature": 44,
"available_spare": 100,
"available_spare_threshold": 32,
"percentage_used": 0,
"data_units_read": 181694,
"data_units_written": 164990,
"host_reads": 761961,
"host_writes": 687549,
"controller_busy_time": 0,
"power_cycles": 364,
"power_on_hours": 2,
"unsafe_shutdowns": 8,
"media_errors": 0,
"num_err_log_entries": 8,
"warning_temp_time": 0,
"critical_comp_time": 0
},
"temperature": {
"current": 44
},
"power_cycle_count": 364,
"power_on_time": {
"hours": 2
}
}
free(): invalid pointer
[1] 31142 abort sudo smartctl -a /dev/nvme1 -j |
JSON looks fine but I guess the problem is that invalid pointer is printed to stdout. can u run smartctl with 2>/dev/null and check the output? |
It does the correct thing. errors are sent to stderr indeed. 😺 ewout@enthoo ~ % sudo smartctl -a /dev/nvme1 -j 2>/dev/null
{
"json_format_version": [
1,
0
],
"smartctl": {
"version": [
7,
2
],
"svn_revision": "5155",
"platform_info": "x86_64-linux-5.13.13-arch1-1",
"build_info": "(local build)",
"argv": [
"smartctl",
"-a",
"/dev/nvme1",
"-j"
],
"exit_status": 0
},
"device": {
"name": "/dev/nvme1",
"info_name": "/dev/nvme1",
"type": "nvme",
"protocol": "NVMe"
},
"model_name": "ADATA SX6000LNP",
"serial_number": "2K38291DQ2XG",
"firmware_version": "V9002s45",
"nvme_pci_vendor": {
"id": 4332,
"subsystem_id": 4332
},
"nvme_ieee_oui_identifier": 57420,
"nvme_controller_id": 1,
"nvme_version": {
"string": "1.3",
"value": 66304
},
"nvme_number_of_namespaces": 1,
"nvme_namespaces": [
{
"id": 1,
"size": {
"blocks": 250069680,
"bytes": 128035676160
},
"capacity": {
"blocks": 250069680,
"bytes": 128035676160
},
"utilization": {
"blocks": 250069680,
"bytes": 128035676160
},
"formatted_lba_size": 512
}
],
"user_capacity": {
"blocks": 250069680,
"bytes": 128035676160
},
"logical_block_size": 512,
"local_time": {
"time_t": 1630506916,
"asctime": "Wed Sep 1 16:35:16 2021 CEST"
},
"smart_status": {
"passed": true,
"nvme": {
"value": 0
}
},
"nvme_smart_health_information_log": {
"critical_warning": 0,
"temperature": 44,
"available_spare": 100,
"available_spare_threshold": 32,
"percentage_used": 0,
"data_units_read": 181694,
"data_units_written": 164990,
"host_reads": 761961,
"host_writes": 687549,
"controller_busy_time": 0,
"power_cycles": 364,
"power_on_hours": 2,
"unsafe_shutdowns": 8,
"media_errors": 0,
"num_err_log_entries": 8,
"warning_temp_time": 0,
"critical_comp_time": 0
},
"temperature": {
"current": 44
},
"power_cycle_count": 364,
"power_on_time": {
"hours": 2
}
}
[1] 31424 abort sudo smartctl -a /dev/nvme1 -j 2> /dev/null |
then I guess the prob. is with exit code. can u give echo $? plz |
root@enthoo ~ # shd -y
: /dev/nvme1Unable to get device /dev/nvme1 info: EOF while parsing a value at line 1 column 0
Disk Model Serial Temp PoH PCC Int Capacity RRate Firmware
-------------------------------------------------------------------------------------------------------
nvme0 Samsung SSD 980 PRO 1TB S5GXNG0N906899Y 52 C 934 376 nvme 1.00 TB 1B2QGXA7
sda Crucial_CT128MX100SSD1 14180C1C7F37 36 C 21412 3263 sat 128.04 GB MU01
sdb WDC WD20EZRZ-00Z5HB0 WD-WCC4M7TX4AHP 34 C 13699 1070 sat 2.00 TB 5400 80.00A80
root@enthoo ~ # echo $?
0 |
no, mean running smartctl directly |
Woops. Brainfart there. Apologies. Here you go: [1] 33599 abort sudo smartctl -a /dev/nvme1 -j 2> /dev/null
134 ewout@enthoo ~ % echo $?
134 |
that's the problem. it doesn't exit with 0 and the executor function doesn't return the output. you should report the bug to smartmontools guys to let the fix that memleak, on my side I'll replace the function a bit later to more safe executor to let it obtain stdout even if a command crashed. |
When invoking
shd
on my machine I get thrown the following error:My machine uses the following disk layout:
The text was updated successfully, but these errors were encountered: