My TrueNAS Scale host accesses hard drives through an HBA array card (lsi2308).
I need to change the value in the files under this directory (/sys/class/scsi_disk/*/manage_start_stop) from 0 to 1. If not, the C0 value in the SATA hard drive’s SMART data will increase by 1 after shutting down, indicating that the hard drive’s heads did not reset, which poses a risk of damage to the hard drive.
However, when I execute the command echo 1 > /sys/class/scsi_disk/0:0:0:0/manage_start_stop
I receive an error: echo: write error: Input/output error.
Additionally, increasing write permissions with chmod 666 /sys/class/scsi_disk/*/manage_start_stop does not work.
What should I do to successfully modify this file?
That is not true. ID 192 (C0) is Power-Off_Retract_Count and it is perfectly normal. No head damage will occur. The drives are designed for when there is a loss of power, the heads magnetically (some may have a light spring but I have not seen one in a very long time) return to the PARK location while the platter is spinning at full speed. The heads are floating all the way to the PARK location.
If you disagree, please post a link to the resource you have stating otherwise.
As for modifying the file, you cannot. The file system is mounted as read-only. Okay, you can change that file if you really wanted to (need to mount as R/W) however any update to TrueNAS will overwrite the changes you made. If this is a real problem, submit a bug report.