{"id":94895,"date":"2024-05-01T18:25:11","date_gmt":"2024-05-01T10:25:11","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=94895"},"modified":"2024-05-01T18:25:11","modified_gmt":"2024-05-01T10:25:11","slug":"linux-test-drive-operation","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/linux-test-drive-operation.html","title":{"rendered":"Linux\u4e2d\u68c0\u6d4b\u786c\u76d8\u64cd\u4f5c"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u4f7f\u7528 hdparm \u548c dd \u547d\u4ee4\u6765\u68c0\u6d4b\u4f60\u7684\u786c\u76d8\u901f\u5ea6\u3002\u5b83\u4e3a\u5404\u79cd\u786c\u76d8\u7684 ioctls \u63d0\u4f9b\u4e86\u547d\u4ee4\u884c\u754c\u9762\uff0c\u8fd9\u662f\u7531 Linux \u7cfb\u7edf\u7684 ATA \/ IDE \/ SATA \u8bbe\u5907\u9a71\u52a8\u7a0b\u5e8f\u5b50\u7cfb\u7edf\u6240\u652f\u6301\u7684\u3002\u6709\u4e9b\u9009\u9879\u53ea\u80fd\u7528\u6700\u65b0\u7684\u5185\u6838\u624d\u80fd\u6b63\u5e38\u5de5\u4f5c\uff08\u8bf7\u786e\u4fdd\u5b89\u88c5\u4e86\u6700\u65b0\u7684\u5185\u6838\uff09\u3002\u6211\u4e5f\u63a8\u8350\u4f7f\u7528\u6700\u65b0\u7684\u5185\u6838\u6e90\u4ee3\u7801\u7684\u5305\u542b\u5934\u6587\u4ef6\u6765\u7f16\u8bd1 hdparm \u547d\u4ee4\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n
\u5982\u4f55\u4f7f\u7528 hdparm \u547d\u4ee4\u6765\u68c0\u6d4b\u786c\u76d8\u7684\u4f20\u8f93\u901f\u5ea6<\/strong><\/div>\n

\u4ee5 root \u7ba1\u7406\u5458\u6743\u9650\u767b\u5f55\u5e76\u6267\u884c\u547d\u4ee4\uff1a<\/p>\n

$ sudo hdparm -tT \/dev\/sda\r\n<\/pre>\n

\u6216\u8005\uff0c<\/p>\n

$ sudo hdparm -tT \/dev\/hda\r\n<\/pre>\n

\u8f93\u51fa\uff1a<\/p>\n

\/dev\/sda:\r\nTiming cached reads: 7864 MB in 2.00 seconds = 3935.41 MB\/sec\r\nTiming buffered disk reads: 204 MB in 3.00 seconds = 67.98 MB\/sec\r\n<\/pre>\n

\u4e3a\u4e86\u68c0\u6d4b\u66f4\u7cbe\u51c6\uff0c\u8fd9\u4e2a\u64cd\u4f5c\u5e94\u8be5\u91cd\u590d2-3\u6b21 \u3002\u8fd9\u663e\u793a\u4e86\u65e0\u9700\u8bbf\u95ee\u78c1\u76d8\uff0c\u76f4\u63a5\u4ece Linux \u7f13\u51b2\u533a\u7f13\u5b58\u4e2d\u8bfb\u53d6\u7684\u901f\u5ea6\u3002\u8fd9\u4e2a\u6d4b\u91cf\u5b9e\u9645\u4e0a\u662f\u88ab\u6d4b\u7cfb\u7edf\u7684\u5904\u7406\u5668\u3001\u9ad8\u901f\u7f13\u5b58\u548c\u5b58\u50a8\u5668\u7684\u541e\u5410\u91cf\u7684\u6307\u6807\u3002\u8fd9\u662f\u4e00\u4e2a for \u5faa\u73af\u7684\u4f8b\u5b50\uff0c\u8fde\u7eed\u8fd0\u884c\u6d4b\u8bd5 3 \u6b21\uff1a<\/p>\n

for i in 1 2 3; do hdparm -tT \/dev\/hda; done\r\n<\/pre>\n

\u8fd9\u91cc\uff0c<\/p>\n

-t \uff1a\u6267\u884c\u8bbe\u5907\u8bfb\u53d6\u65f6\u5e8f\r\n-T \uff1a\u6267\u884c\u7f13\u5b58\u8bfb\u53d6\u65f6\u95f4\r\n\/dev\/sda \uff1a\u786c\u76d8\u8bbe\u5907\u6587\u4ef6\r\n<\/pre>\n

\u8981 \u627e\u51fa SATA \u786c\u76d8\u7684\u8fde\u63a5\u901f\u5ea6 \uff0c\u8bf7\u8f93\u5165\uff1a<\/p>\n

sudo hdparm -I \/dev\/sda | grep -i speed\r\n<\/pre>\n

\u8f93\u51fa\uff1a<\/p>\n

* Gen1 signaling speed (1.5Gb\/s)\r\n* Gen2 signaling speed (3.0Gb\/s)\r\n* Gen3 signaling speed (6.0Gb\/s)\r\n<\/pre>\n

\u4ee5\u4e0a\u8f93\u51fa\u8868\u660e\u6211\u7684\u786c\u76d8\u53ef\u4ee5\u4f7f\u7528 1.5Gb\/s\u30013.0Gb\/s \u6216 6.0Gb\/s \u7684\u901f\u5ea6\u3002\u8bf7\u6ce8\u610f\uff0c\u60a8\u7684 BIOS\/\u4e3b\u677f\u5fc5\u987b\u652f\u6301 SATA-II\/III \u624d\u884c\uff1a<\/p>\n

$ dmesg | grep -i sata | grep 'link up'<\/pre>\n

\"\"<\/p>\n

dd \u547d\u4ee4<\/strong><\/div>\n

\u4f60\u4f7f\u7528 dd \u547d\u4ee4\u4e5f\u53ef\u4ee5\u83b7\u53d6\u5230\u76f8\u5e94\u7684\u901f\u5ea6\u4fe1\u606f\uff1a<\/p>\n

dd if=\/dev\/zero of=\/tmp\/output.img bs=8k count=256k\r\nrm \/tmp\/output.img\r\n<\/pre>\n

\u8f93\u51fa\uff1a<\/p>\n

262144+0 records in\r\n262144+0 records out\r\n2147483648 bytes (2.1 GB) copied, 23.6472 seconds, `90.8 MB\/s`\r\n<\/pre>\n

\u4e0b\u9762\u662f \u63a8\u8350\u7684 dd \u547d\u4ee4\u53c2\u6570\uff1a<\/p>\n

dd if=\/dev\/input.file of=\/path\/to\/output.file bs=block-size count=number-of-blocks oflag=dsync\r\n## GNU dd syntax ##\r\ndd if=\/dev\/zero of=\/tmp\/test1.img bs=1G count=1 oflag=dsync\r\n## OR alternate syntax for GNU\/dd ##\r\ndd if=\/dev\/zero of=\/tmp\/testALT.img bs=1G count=1 conv=fdatasync\r\n<\/pre>\n

\u8fd9\u662f\u4e0a\u9762\u547d\u4ee4\u7684\u7b2c\u4e09\u4e2a\u547d\u4ee4\u7684\u8f93\u51fa\u7ed3\u679c\uff1a<\/p>\n

1+0 records in\r\n1+0 records out\r\n1073741824 bytes (1.1 GB, 1.0 GiB) copied, 4.23889 s, 253 MB\/s\r\n<\/pre>\n
\u201c\u78c1\u76d8\u4e0e\u5b58\u50a8\u201d - GUI \u5de5\u5177<\/strong><\/div>\n

\u60a8\u8fd8\u53ef\u4ee5\u4f7f\u7528\u4f4d\u4e8e\u201c\u7cfb\u7edf>\u7ba1\u7406>\u78c1\u76d8\u5b9e\u7528\u7a0b\u5e8f\u201d\u83dc\u5355\u4e2d\u7684\u78c1\u76d8\u5b9e\u7528\u7a0b\u5e8f\u3002\u8bf7\u6ce8\u610f\uff0c\u5728\u6700\u65b0\u7248\u672c\u7684 Gnome \u4e2d\uff0c\u5b83\u7b80\u79f0\u4e3a\u201c\u78c1\u76d8\u201d\u3002<\/p>\n

\u5982\u4f55\u4f7f\u7528 Linux \u4e0a\u7684\u201c\u78c1\u76d8\u201d\u6d4b\u8bd5\u6211\u7684\u786c\u76d8\u7684\u6027\u80fd\uff1f<\/strong><\/span><\/div>\n

\u8981\u6d4b\u8bd5\u786c\u76d8\u7684\u901f\u5ea6\uff1a<\/p>\n

\u4ece\u201c\u6d3b\u52a8\u6982\u89c8\u201d\u4e2d\u6253\u5f00\u201c\u78c1\u76d8\u201d\uff08\u6309\u952e\u76d8\u4e0a\u7684 super \u952e\u5e76\u952e\u5165\u201cdisks\u201d\uff09
\n\u4ece\u201c\u5de6\u4fa7\u7a97\u683c\u201d\u7684\u5217\u8868\u4e2d\u9009\u62e9\u201c\u78c1\u76d8\u201d
\n\u9009\u62e9\u83dc\u5355\u6309\u94ae\u5e76\u4ece\u83dc\u5355\u4e2d\u9009\u62e9\u201c\u6d4b\u8bd5\u78c1\u76d8\u6027\u80fd\u2026\u2026\u201d
\n\u5355\u51fb\u201c\u5f00\u59cb\u6027\u80fd\u6d4b\u8bd5\u2026\u2026\u201d\u5e76\u6839\u636e\u9700\u8981\u8c03\u6574\u4f20\u8f93\u901f\u7387\u548c\u8bbf\u95ee\u65f6\u95f4\u53c2\u6570\u3002
\n\u9009\u62e9\u201c\u5f00\u59cb\u6027\u80fd\u6d4b\u8bd5\u201d\u6765\u6d4b\u8bd5\u4ece\u78c1\u76d8\u8bfb\u53d6\u6570\u636e\u7684\u901f\u5ea6\u3002\u9700\u8981\u7ba1\u7406\u6743\u9650\u8bf7\u8f93\u5165\u5bc6\u7801\u3002
\n\u4ee5\u4e0a\u64cd\u4f5c\u7684\u5feb\u901f\u89c6\u9891\u6f14\u793a\uff1a<\/p>\n


\n