{"id":271294,"date":"2015-12-28T15:25:02","date_gmt":"2015-12-28T12:25:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=271294"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=271294","title":{"rendered":"\u041f\u0440\u044f\u043c\u043e\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0434\u0438\u0441\u043a\u0443 \u0438\u0437 python"},"content":{"rendered":"<p>       <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/e03\/2cf\/e61\/e032cfe6188049f884cb1bca3f78c6b5.jpg\" alt=\"image\"\/><\/p>\n<p>  \u0420\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u044f \u0432\u0430\u043c \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043f\u044b\u0442\u0430\u043b\u0441\u044f \u044f \u0434\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0438\u0437 \u043f\u0438\u0442\u043e\u043d\u0430 \u0434\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0436\u0435\u0441\u0442\u043a\u043e\u0433\u043e \u0434\u0438\u0441\u043a\u0430, \u0438 \u0447\u0442\u043e \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c.<\/p>\n<p>  \u041f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0443 \u043c\u0435\u043d\u044f \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0436\u0435\u0441\u0442\u043a\u0438\u0445 \u0434\u0438\u0441\u043a\u043e\u0432. \u041e\u0431\u044b\u0447\u043d\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043e\u0441\u043e\u0432\u0430\u044f Victoria \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u044e\u0449\u0430\u044f\u0441\u044f \u043f\u043e \u0441\u0435\u0442\u0438. \u041e\u043d\u0430 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u0442 \u0434\u0438\u0441\u043a\u0438 \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443, \u0447\u0442\u043e \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0448\u043b\u0438 \u043f\u043b\u0430\u0442\u044b \u043d\u0435 \u0438\u043c\u0435\u044e\u0449\u0438\u0435 \u0440\u0435\u0436\u0438\u043c\u0430 IDE, \u0447\u0442\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0435\u0442 \u0437\u0430\u0434\u0430\u0447\u0443. \u041f\u043e \u043d\u0430\u0447\u0430\u043b\u0443 \u0443 \u043c\u0435\u043d\u044f \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u0438\u0434\u0435\u044f \u0432\u0437\u044f\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u0441\u043e\u0444\u0442 \u043f\u043e\u0434 \u043b\u0438\u043d\u0443\u043a\u0441 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u043c\u0438 \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u043c\u0443 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0434\u0438\u0441\u043a\u043e\u0432. \u041f\u043e\u0441\u043b\u0435 \u0431\u0435\u0433\u043b\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430 \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u043e\u0441\u044c \u0443\u0434\u0440\u0443\u0447\u0430\u044e\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432 \u043b\u0438\u043d\u0443\u043a\u0441\u0435. \u0418\u0437 \u0441\u043e\u0444\u0442\u0430, \u0432\u0435\u0434\u0443\u0449\u0435\u0433\u043e \u043f\u0440\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0441\u0435\u043a\u0442\u043e\u0440\u0430\u043c \u0438 \u0442\u0438\u043f\u0430\u043c \u043e\u0448\u0438\u0431\u043e\u043a \u043d\u0430\u0448\u0435\u043b \u0442\u043e\u043b\u044c\u043a\u043e whdd. \u041f\u043e\u043f\u044b\u0442\u043a\u0430 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u043a\u043e\u0434\u043e\u043c whdd \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0430\u0441\u044c \u043f\u043e\u043b\u043d\u044b\u043c \u043f\u0440\u043e\u0432\u0430\u043b\u043e\u043c. \u0414\u043b\u044f \u043c\u0435\u043d\u044f, \u043d\u0438 \u0440\u0430\u0437\u0443 \u043d\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430, \u043a\u043e\u0434 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u0437\u0430\u043f\u0443\u0442\u0430\u043d\u043d\u044b\u043c. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435 \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0435\u0433\u043e \u0447\u0430\u0441\u0442\u044c \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0436\u0435\u043b\u0435\u0437\u043e\u043c.<\/p>\n<p>  \u041f\u043e\u043d\u044f\u0432, \u0447\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0435 \u043f\u0440\u0435\u0434\u0432\u0438\u0434\u0438\u0442\u0441\u044f \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043e\u0434\u043e\u0431\u043d\u0443\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e. \u041f\u043e\u043d\u0438\u043c\u0430\u044f, \u0447\u0442\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 C \u044f \u043d\u0435 \u043e\u0441\u0438\u043b\u044e \u044f \u043d\u0430\u0447\u0430\u043b \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u044f\u043c\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0438\u0441\u043a\u0430\u043c\u0438 \u0438\u0437 python, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u044f \u0447\u0430\u0441\u0442\u0435\u043d\u044c\u043a\u043e \u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0441\u044c \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 \u0438 \u043b\u044e\u0431\u043b\u044e \u0437\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0443 \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u043e\u0441\u0442\u044c. \u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u0432\u043e\u043f\u0440\u043e\u0441\u0443 \u0432 \u0441\u0435\u0442\u0438 \u043a\u043e\u0442 \u043d\u0430\u043f\u043b\u0430\u043a\u0430\u043b, \u043d\u043e \u0432\u0441\u0435 \u0436\u0435 \u044f \u0432\u044b\u044f\u0441\u043d\u0438\u043b, \u0447\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u043e\u0434\u0443\u043b\u044c fcntl \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0443 ioctl \u0437\u0430\u043f\u0440\u043e\u0441\u044b. \u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043c\u0435\u043d\u044f \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u0438\u0441\u043a\u0443. \u041d\u043e \u0432 \u043b\u0438\u043d\u0443\u043a\u0441\u0435 \u0432\u0441\u0435 \u0434\u0438\u0441\u043a\u0438 \u0441\u0447\u0438\u0442\u0430\u044e\u0442\u0441\u044f scsi \u0434\u0438\u0441\u043a\u0430\u043c\u0438, \u0430 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0434\u0438\u0441\u043a\u0443 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e ata \u043a\u043e\u043c\u0430\u043d\u0434\u044b. \u041e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c ATA Command Pass-Through, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u043e\u0431\u0435\u0440\u043d\u0443\u0442\u044c ata \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0432 scsi \u0437\u0430\u043f\u0440\u043e\u0441. \u041e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u044d\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u0447\u0435\u0440\u043f\u043d\u0443\u0442\u044c \u0438\u0437 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u0442\u0435\u043a\u0441\u0442\u043e\u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 sg3_utils. \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e \u0432\u0441\u0435 \u043d\u0430 \u043f\u0438\u0442\u043e\u043d\u0435.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432 \u043f\u0438\u0442\u043e\u043d\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u043c \u044f\u0437\u044b\u043a\u0430 C, \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0438\u0445 \u0432 ioctl, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u043e\u0434\u0443\u043b\u044c ctypes. \u041e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0441\u0442\u043e\u0438\u0442 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0435\u0434\u044b\u0445 \u0432\u043e\u043b\u043e\u0441 \u043f\u043e\u044f\u0432\u0438\u0432\u0448\u0438\u0445\u0441\u044f \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0445 \u0433\u043b\u044e\u043a\u043e\u0432 \u0441 \u044d\u0442\u0438\u043c\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u043c\u0438. \u0422\u0430\u043a \u044f \u043e\u0442\u043a\u0440\u044b\u043b \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u0437\u043d\u0430\u043d\u0438\u0435 \u043e \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0432 C. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0440\u043e\u0434\u0438\u043b\u0438\u0441\u044c \u0434\u0432\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b:<\/p>\n<p>  \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u043b\u044f ATA Pass-Through:<\/p>\n<pre><code class=\"python\">class ataCmd(ctypes.Structure):     _pack_ = 1     _fields_ = [         ('opcode', ctypes.c_ubyte),         ('protocol', ctypes.c_ubyte),         ('flags', ctypes.c_ubyte),         ('features', ctypes.c_ushort),         ('sector_count', ctypes.c_ushort),         ('lba_h_low', ctypes.c_ubyte),         ('lba_low', ctypes.c_ubyte),         ('lba_h_mid', ctypes.c_ubyte),         ('lba_mid', ctypes.c_ubyte),         ('lba_h_high', ctypes.c_ubyte),         ('lba_high', ctypes.c_ubyte),         ('device', ctypes.c_ubyte),         ('command', ctypes.c_ubyte),         ('control', ctypes.c_ubyte)] <\/code><\/pre>\n<p>  \u0418 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u043b\u044f ioctl:<\/p>\n<pre><code class=\"python\">class sgioHdr(ctypes.Structure):     _pack_ = 1     _fields_ = [         ('interface_id', ctypes.c_int),      # [i] 'S' for SCSI generic (required)         ('dxfer_direction', ctypes.c_int),   # [i] data transfer direction         ('cmd_len', ctypes.c_ubyte),         # [i] SCSI command length ( &lt;= 16 bytes)         ('mx_sb_len', ctypes.c_ubyte),       # [i] max length to write to sbp         ('iovec_count', ctypes.c_ushort),    # [i] 0 implies no scatter gather         ('dxfer_len', ctypes.c_uint),        # [i] byte count of data transfer         ('dxferp', ctypes.c_void_p),         # [i], [*io] points to data transfer memory         ('cmdp', ctypes.c_void_p),           # [i], [*i] points to command to perform         ('sbp', ctypes.c_void_p),            # [i], [*o] points to sense_buffer memory         ('timeout', ctypes.c_uint),          # [i] MAX_UINT-&gt;no timeout (unit: millisec)         ('flags', ctypes.c_uint),            # [i] 0 -&gt; default, see SG_FLAG...         ('pack_id', ctypes.c_int),           # [i-&gt;o] unused internally (normally)         ('usr_ptr', ctypes.c_void_p),        # [i-&gt;o] unused internally         ('status', ctypes.c_ubyte),          # [o] scsi status         ('masked_status', ctypes.c_ubyte),   # [o] shifted, masked scsi status         ('msg_status', ctypes.c_ubyte),      # [o] messaging level data (optional)         ('sb_len_wr', ctypes.c_ubyte),       # [o] byte count actually written to sbp         ('host_status', ctypes.c_ushort),    # [o] errors from host adapter         ('driver_status', ctypes.c_ushort),  # [o] errors from software driver         ('resid', ctypes.c_int),             # [o] dxfer_len - actual_transferred         ('duration', ctypes.c_uint),         # [o] time taken by cmd (unit: millisec)         ('info', ctypes.c_uint)]             # [o] auxiliary information <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u044d\u0442\u0438\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0434 \u043a\u0430\u0436\u0434\u043e\u0439 \u0434\u0438\u0441\u043a\u043e\u0432\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0435\u0439 \u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u043c\u0435\u0441\u0442\u0430, \u044d\u0442\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0432\u044b\u043d\u0435\u0441\u0435\u043d\u0430 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e. \u0412 \u043c\u043d\u043e\u0433\u043e\u0431\u0430\u0439\u0442\u043e\u0432\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u0445 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0431\u0430\u0439\u0442\u043e\u0432.<\/p>\n<pre><code class=\"python\">def prepareSgio(cmd, feature, count, lba, direction, sense, buf):     if direction == SG_DXFER_FROM_DEV:         buf_len = ctypes.sizeof(buf)         buf_p = ctypes.cast(buf, ctypes.c_void_p)         prot = 4 &lt;&lt; 1  # PIO Data-In     elif direction == SG_DXFER_TO_DEV:         buf_len = ctypes.sizeof(buf)         buf_p = ctypes.cast(buf, ctypes.c_void_p)         prot = 5 &lt;&lt; 1  # PIO Data-Out     else:         buf_len = 0         buf_p = None         prot = 3 &lt;&lt; 1  # Non-data      if cmd != 0xb0:  # not SMART COMMAND         prot = prot | 1  # + EXTEND     sector_lba = lba.to_bytes(6, byteorder='little')      ata_cmd = ataCmd(opcode=0x85,  # ATA PASS-THROUGH (16)                      protocol=prot,                      # flags field                      # OFF_LINE = 0 (0 seconds offline)                      # CK_COND = 1 (copy sense data in response)                      # T_DIR = 1 (transfer from the ATA device)                      # BYT_BLOK = 1 (length is in blocks, not bytes)                      # T_LENGTH = 2 (transfer length in the SECTOR_COUNT field)                      flags=0x2e,                      features=swap16(feature),                      sector_count=swap16(count),                      lba_h_low=sector_lba[3], lba_low=sector_lba[0],                      lba_h_mid=sector_lba[4], lba_mid=sector_lba[1],                      lba_h_high=sector_lba[5], lba_high=sector_lba[2],                      device=0,                      command=cmd,                      control=0)      sgio = sgioHdr(interface_id=ASCII_S, dxfer_direction=direction,                    cmd_len=ctypes.sizeof(ata_cmd),                    mx_sb_len=ctypes.sizeof(sense), iovec_count=0,                    dxfer_len=buf_len,                    dxferp=buf_p,                    cmdp=ctypes.addressof(ata_cmd),                    sbp=ctypes.cast(sense, ctypes.c_void_p), timeout=1000,                    flags=0, pack_id=0, usr_ptr=None, status=0, masked_status=0,                    msg_status=0, sb_len_wr=0, host_status=0, driver_status=0,                    resid=0, duration=0, info=0)      return sgio <\/code><\/pre>\n<p>  \u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 ata \u043a\u043e\u043c\u0430\u043d\u0434\u0443, \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438 \u0431\u0443\u0444\u0435\u0440\u044b \u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0433\u043e\u0442\u043e\u0432\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u043b\u044f ioctl \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0414\u0430\u043b\u044c\u0448\u0435 \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0431\u0443\u0444\u0435\u0440 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u0435\u0440\u043d\u0443\u0442\u0441\u044f \u0441\u0442\u0430\u0442\u0443\u0441 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 ata \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u0432 \u0441\u0442\u0430\u0442\u0443\u0441\u0430 \u0438 \u043e\u0448\u0438\u0431\u043a\u0438. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0431\u0443\u0444\u0435\u0440 \u0434\u043b\u044f \u0441\u0435\u043a\u0442\u043e\u0440\u0430, \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043d\u043d\u043e\u0433\u043e \u0441 \u0434\u0438\u0441\u043a\u0430. \u0417\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043d\u0430\u0448\u0443 \u043f\u0435\u0440\u0432\u0443\u044e ata \u043a\u043e\u043c\u0430\u043d\u0434\u0443.<\/p>\n<pre><code class=\"python\">sense = ctypes.c_buffer(64) identify = ctypes.c_buffer(512) sgio = prepareSgio(0xec, 0, 0, 0, SG_DXFER_FROM_DEV, sense, identify)  # IDENTIFY with open(dev, 'r') as fd:     if fcntl.ioctl(fd, SG_IO, ctypes.addressof(sgio)) != 0:         return None  # fcntl failed! <\/code><\/pre>\n<p>  \u0412 \u043e\u0442\u0432\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u0435\u043a\u0442\u043e\u0440 \u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e \u0434\u0438\u0441\u043a\u0435:<\/p>\n<pre><code class=\"dos\">0000000: 5a04 ff3f 37c8 1000 0000 0000 3f00 0000  Z..?7.......?... 0000010: 0000 0000 2020 2020 2020 4b4a 3131 3142  ....      KJ111B 0000020: 3942 5647 4142 4659 0300 5fea 3800 4b4a  9BVGABFY.._.8.KJ 0000030: 4f41 3341 4145 6948 6174 6863 2069 5548  OA3AAEiHathc iUH 0000040: 3741 3232 3230 4130 414c 3333 2030 2020  7A2220A0AL33 0   0000050: 2020 2020 2020 2020 2020 2020 2020 1080                .. 0000060: 0040 002f 0040 0002 0002 0700 ff3f 1000  .@.\/.@.......?.. 0000070: 3f00 10fc fb00 0001 ffff ff0f 0000 0700  ?............... 0000080: 0300 7800 7800 7800 7800 0000 0000 0000  ..x.x.x.x....... 0000090: 0000 0000 0000 1f00 0617 0000 5e00 4400  ............^.D. 00000a0: fc01 2900 6b34 697d 7347 6934 41bc 6347  ..).k4i}sGi4A.cG 00000b0: 7f40 0401 0000 0000 feff 0000 0000 0800  .@.............. 00000c0: ca00 f900 1027 0000 b088 e0e8 0000 0000  .....'.......... 00000d0: ca00 0000 0000 875a 0050 a2cc cb22 44fc  .......Z.P...&quot;D. 00000e0: 0000 0000 0000 0000 0000 0000 0000 1440  ...............@ 00000f0: 1440 0000 0000 0000 0000 0000 0000 0000  .@.............. 0000100: 0100 0b00 0000 0000 8020 f10d 20fa 0100  ......... .. ... 0000110: 0040 0404 0403 0000 0000 0502 0604 0504  .@.............. 0000120: 0506 0803 0506 0504 0505 0603 0505 0000  ................ 0000130: 3741 3342 0000 0a78 0000 bd5d d3a1 0080  7A3B...x...].... 0000140: 0000 0000 0000 0000 0000 0000 0000 0000  ................ 0000150: 0200 0000 0000 0000 0000 0000 0000 0000  ................ 0000160: 0000 0000 0000 0000 0000 0000 0000 0000  ................ 0000170: 0000 0000 0000 0000 0000 0000 0000 0000  ................ 0000180: 0000 0000 0000 0000 0000 0000 0000 0000  ................ 0000190: 0000 0000 0000 0000 0000 0000 3d00 0000  ............=... 00001a0: 0000 0000 0000 0000 0000 0000 0000 0000  ................ 00001b0: 0000 201c 0000 0000 0000 0000 1f10 2100  .. ...........!. 00001c0: 0000 0000 0000 0000 0000 0000 0000 0000  ................ 00001d0: 0000 0000 0100 e003 0000 0000 0000 0000  ................ 00001e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................ 00001f0: 0000 0000 0000 0000 0000 0000 0000 a503  ................ <\/code><\/pre>\n<p>  \u0412 \u043d\u0435\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u043f\u043e\u043b\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0434\u0438\u0441\u043a\u0435, \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e.<\/p>\n<pre><code class=\"python\">    serial = swapString(identify[20:40])     firmware = swapString(identify[46:53])     model = swapString(identify[54:93])     sectors = int.from_bytes(identify[200] + identify[201] + identify[202] + identify[203] +                              identify[204] + identify[205] + identify[206] + identify[207], byteorder='little') <\/code><\/pre>\n<p>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c:<\/p>\n<p>  \u043c\u043e\u0434\u0435\u043b\u044c: Hitachi HUA722020ALA330; \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0430: JKAOA3; \u0441\u0435\u0440\u0438\u0439\u043d\u044b\u0439 \u043d\u043e\u043c\u0435\u0440: JK11A1YAJE2N5V; \u0447\u0438\u0441\u043b\u043e \u0441\u0435\u043a\u0442\u043e\u0440\u043e\u0432: 3907029168. <\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0443\u043c\u0435\u0435\u043c \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c ata \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u0438\u0441\u043a\u0443 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043e\u0442 \u043d\u0435\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u044b. \u041f\u043e\u0442\u0438\u0445\u043e\u043d\u044c\u043a\u0443 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043c\u043e\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u043e\u0444\u043e\u0440\u043c\u0438\u043b\u0441\u044f \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u0447\u043a\u0443, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430 ata \u043a\u043e\u043c\u0430\u043d\u0434, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0447\u0442\u0435\u043d\u0438\u0435 SMART. \u041a\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u043d\u0430 \u043d\u0435\u0435 <a href=\"https:\/\/github.com\/kazenniy\/sgio\">\u0437\u0434\u0435\u0441\u044c<\/a>. \u041a\u0430\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u0434\u0430 \u0441\u0438\u043b\u044c\u043d\u043e \u043d\u0435 \u0440\u0443\u0433\u0430\u0439\u0442\u0435, \u044f \u043d\u0435 <s>\u0432\u043e\u043b\u0448\u0435\u0431\u043d\u0438\u043a<\/s> \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u0447\u0443\u0441\u044c.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0441 \u0435\u0435 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0443\u0442\u0438\u043b\u0438\u0442\u0443 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0427\u0443\u0432\u0441\u0442\u0432\u0443\u044e \u043c\u0435\u043d\u044f \u0436\u0434\u0435\u0442 \u0435\u0449\u0435 \u043c\u043d\u043e\u0433\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u0439.       <\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/274195\/\"> http:\/\/habrahabr.ru\/post\/274195\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/e03\/2cf\/e61\/e032cfe6188049f884cb1bca3f78c6b5.jpg\" alt=\"image\"\/><\/p>\n<p>  \u0420\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u044f \u0432\u0430\u043c \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043f\u044b\u0442\u0430\u043b\u0441\u044f \u044f \u0434\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0438\u0437 \u043f\u0438\u0442\u043e\u043d\u0430 \u0434\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0436\u0435\u0441\u0442\u043a\u043e\u0433\u043e \u0434\u0438\u0441\u043a\u0430, \u0438 \u0447\u0442\u043e \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c.<\/p>\n<p>  \u041f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0443 \u043c\u0435\u043d\u044f \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0436\u0435\u0441\u0442\u043a\u0438\u0445 \u0434\u0438\u0441\u043a\u043e\u0432. \u041e\u0431\u044b\u0447\u043d\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043e\u0441\u043e\u0432\u0430\u044f Victoria \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u044e\u0449\u0430\u044f\u0441\u044f \u043f\u043e \u0441\u0435\u0442\u0438. \u041e\u043d\u0430 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u0442 \u0434\u0438\u0441\u043a\u0438 \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443, \u0447\u0442\u043e \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0448\u043b\u0438 \u043f\u043b\u0430\u0442\u044b \u043d\u0435 \u0438\u043c\u0435\u044e\u0449\u0438\u0435 \u0440\u0435\u0436\u0438\u043c\u0430 IDE, \u0447\u0442\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0435\u0442 \u0437\u0430\u0434\u0430\u0447\u0443. \u041f\u043e \u043d\u0430\u0447\u0430\u043b\u0443 \u0443 \u043c\u0435\u043d\u044f \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u0438\u0434\u0435\u044f \u0432\u0437\u044f\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u0441\u043e\u0444\u0442 \u043f\u043e\u0434 \u043b\u0438\u043d\u0443\u043a\u0441 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u043c\u0438 \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u043c\u0443 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0434\u0438\u0441\u043a\u043e\u0432. \u041f\u043e\u0441\u043b\u0435 \u0431\u0435\u0433\u043b\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430 \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u043e\u0441\u044c \u0443\u0434\u0440\u0443\u0447\u0430\u044e\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432 \u043b\u0438\u043d\u0443\u043a\u0441\u0435. \u0418\u0437 \u0441\u043e\u0444\u0442\u0430, \u0432\u0435\u0434\u0443\u0449\u0435\u0433\u043e \u043f\u0440\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0441\u0435\u043a\u0442\u043e\u0440\u0430\u043c \u0438 \u0442\u0438\u043f\u0430\u043c \u043e\u0448\u0438\u0431\u043e\u043a \u043d\u0430\u0448\u0435\u043b \u0442\u043e\u043b\u044c\u043a\u043e whdd. \u041f\u043e\u043f\u044b\u0442\u043a\u0430 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u043a\u043e\u0434\u043e\u043c whdd \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0430\u0441\u044c \u043f\u043e\u043b\u043d\u044b\u043c \u043f\u0440\u043e\u0432\u0430\u043b\u043e\u043c. \u0414\u043b\u044f \u043c\u0435\u043d\u044f, \u043d\u0438 \u0440\u0430\u0437\u0443 \u043d\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430, \u043a\u043e\u0434 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u0437\u0430\u043f\u0443\u0442\u0430\u043d\u043d\u044b\u043c. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435 \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0435\u0433\u043e \u0447\u0430\u0441\u0442\u044c \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0436\u0435\u043b\u0435\u0437\u043e\u043c.<\/p>\n<p>  \u041f\u043e\u043d\u044f\u0432, \u0447\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0435 \u043f\u0440\u0435\u0434\u0432\u0438\u0434\u0438\u0442\u0441\u044f \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043e\u0434\u043e\u0431\u043d\u0443\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e. \u041f\u043e\u043d\u0438\u043c\u0430\u044f, \u0447\u0442\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 C \u044f \u043d\u0435 \u043e\u0441\u0438\u043b\u044e \u044f \u043d\u0430\u0447\u0430\u043b \u0438\u0437\u0443\u0447\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u044f\u043c\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0438\u0441\u043a\u0430\u043c\u0438 \u0438\u0437 python, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u044f \u0447\u0430\u0441\u0442\u0435\u043d\u044c\u043a\u043e \u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0441\u044c \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 \u0438 \u043b\u044e\u0431\u043b\u044e \u0437\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0443 \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u043e\u0441\u0442\u044c. \u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u0432\u043e\u043f\u0440\u043e\u0441\u0443 \u0432 \u0441\u0435\u0442\u0438 \u043a\u043e\u0442 \u043d\u0430\u043f\u043b\u0430\u043a\u0430\u043b, \u043d\u043e \u0432\u0441\u0435 \u0436\u0435 \u044f \u0432\u044b\u044f\u0441\u043d\u0438\u043b, \u0447\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u043e\u0434\u0443\u043b\u044c fcntl \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0443 ioctl \u0437\u0430\u043f\u0440\u043e\u0441\u044b. \u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043c\u0435\u043d\u044f \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u0438\u0441\u043a\u0443. \u041d\u043e \u0432 \u043b\u0438\u043d\u0443\u043a\u0441\u0435 \u0432\u0441\u0435 \u0434\u0438\u0441\u043a\u0438 \u0441\u0447\u0438\u0442\u0430\u044e\u0442\u0441\u044f scsi \u0434\u0438\u0441\u043a\u0430\u043c\u0438, \u0430 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0434\u0438\u0441\u043a\u0443 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e ata \u043a\u043e\u043c\u0430\u043d\u0434\u044b. \u041e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c ATA Command Pass-Through, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u043e\u0431\u0435\u0440\u043d\u0443\u0442\u044c ata \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0432 scsi \u0437\u0430\u043f\u0440\u043e\u0441. \u041e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u044d\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u0447\u0435\u0440\u043f\u043d\u0443\u0442\u044c \u0438\u0437 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u0442\u0435\u043a\u0441\u0442\u043e\u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 sg3_utils. \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e \u0432\u0441\u0435 \u043d\u0430 \u043f\u0438\u0442\u043e\u043d\u0435.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-271294","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/271294","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=271294"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/271294\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=271294"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=271294"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=271294"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}