Article Title: how to sleep a hard disk in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Man hdparm
Hdparm-Y/dev/hd *: Enable hard disk sleep mode;
Hdparm-y/dev/hd *: Enable the hard disk to power down;
Hdparm-S [num]/dev/hd *: Set the timeout value to enable the hard disk to sleep;
There seems to be no parameter to wake up hdparm on the hard disk. In fact, when you perform an operation on the hard disk, it will automatically wake up the hard disk. ioctl has a parameter to wake up the hard disk. You can view the corresponding header file of the hard disk operation.
For details, refer to the source code of hdparm. ioctl is actually used to operate the corresponding register of the hard disk.