{"id":103199,"date":"2024-08-23T18:57:11","date_gmt":"2024-08-23T10:57:11","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=103199"},"modified":"2024-08-23T18:57:11","modified_gmt":"2024-08-23T10:57:11","slug":"linux-ssd-hdd","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/linux-ssd-hdd.html","title":{"rendered":"\u5224\u65adlinux\u78c1\u76d8\u662f\u56fa\u6001\u786c\u76d8\u8fd8\u662f\u673a\u68b0\u786c\u76d8\u7684\u65b9\u6cd5"},"content":{"rendered":"
\u5224\u65adlinux\u78c1\u76d8\u662f\u56fa\u6001\u786c\u76d8\u8fd8\u662f\u673a\u68b0\u786c\u76d8\u7684\u4e09\u79cd\u65b9\u6cd5\uff1a<\/p>\n
<\/p>\n
\u5224\u65adcat \/sys\/block\/*\/queue\/rotational\u7684\u8fd4\u56de\u503c\uff08\u5176\u4e2d*\u4e3a\u4f60\u7684\u786c\u76d8\u8bbe\u5907\u540d\u79f0\uff0c\u4f8b\u5982sda\u7b49\u7b49\uff09\uff0c\u5982\u679c\u8fd4\u56de1 \u5219\u8868\u793a\u78c1\u76d8\u53ef\u65cb\u8f6c\uff0c\u90a3\u4e48\u5c31\u662fHDD\u4e86\uff1b<\/p>\n
\u5982\u679c\u8fd4\u56de0\uff0c\u5219\u8868\u793a\u78c1\u76d8\u4e0d\u53ef\u4ee5\u65cb\u8f6c\uff0c\u90a3\u4e48\u5c31\u662fSSD\u4e86\u3002<\/p>\n
[pythontab@pythontab.com ~]$ cat \/sys\/block\/sda\/queue\/rotational\r\n0\r\n[pythontab@pythontab.com ~]$ grep ^ \/sys\/block\/*\/queue\/rotational\r\n\/sys\/block\/ram0\/queue\/rotational:1\r\n\/sys\/block\/sda\/queue\/rotational:0\r\n\/sys\/block\/sdb\/queue\/rotational:0\r\n\/sys\/block\/sdc\/queue\/rotational:0\r\n\/sys\/block\/sdd\/queue\/rotational:0\r\n<\/pre>\n\u8fd9\u79cd\u65b9\u6cd5\u6709\u4e2a\u95ee\u9898\uff0c\u90a3\u5c31\u662f\/sys\/block\/\u4e0b\u9762\u4e0d\u53ea\u6709\u786c\u76d8\uff0c\u8fd8\u53ef\u80fd\u6709\u522b\u7684\u5757\u8bbe\u5907\uff0c\u5b83\u4eec\u90fd\u5728\u5e72\u6270\u4f60\u7684\u5224\u65ad\u3002<\/p>\n
\u65b9\u6cd5\u4e8c<\/strong><\/span><\/div>\n\u4f7f\u7528lsblk\u547d\u4ee4\u8fdb\u884c\u5224\u65ad\uff0c\u53c2\u6570-d\u8868\u793a\u663e\u793a\u8bbe\u5907\u540d\u79f0\uff0c\u53c2\u6570-o\u8868\u793a\u4ec5\u663e\u793a\u7279\u5b9a\u7684\u5217\u3002<\/p>\n
[pythontab@pyhontab.com ~]$ lsblk -d -o name,rota\r\nNAME ROTA\r\nsda 0\r\nsdb 0\r\nsdc 0\r\nsdd 0\r\n<\/pre>\n\u8fd9\u79cd\u65b9\u6cd5\u7684\u4f18\u52bf\u5728\u4e8e\u5b83\u53ea\u5217\u51fa\u4e86\u4f60\u8981\u770b\u7684\u5185\u5bb9\uff0c\u7ed3\u679c\u6bd4\u8f83\u7b80\u6d01\u660e\u4e86\u3002\u8fd8\u662f\u90a3\u4e2a\u89c4\u5219\uff0cROTA\u662f1\u7684\u8868\u793a\u53ef\u4ee5\u65cb\u8f6c\uff0c\u53cd\u4e4b\u5219\u4e0d\u80fd\u65cb\u8f6c\u3002<\/p>\n
<\/p>\n
\u65b9\u6cd5\u4e09<\/strong><\/span><\/div>\n\u53ef\u4ee5\u901a\u8fc7fdisk\u547d\u4ee4\u67e5\u770b\uff0c\u53c2\u6570-l\u8868\u793a\u5217\u51fa\u78c1\u76d8\u8be6\u60c5\u3002\u5728\u8f93\u51fa\u7ed3\u679c\u4e2d\uff0c\u4ee5Disk\u5f00\u5934\u7684\u884c\u8868\u793a\u78c1\u76d8\u7b80\u4ecb\uff0c\u4e0b\u9762\u662f\u4e00\u4e9b\u8be6\u7ec6\u53c2\u6570\uff0c\u6211\u4eec\u53ef\u4ee5\u8bd5\u7740\u5728\u8fd9\u4e9b\u53c2\u6570\u4e2d\u5bfb\u627e\u4e00\u4e9bHDD\u7279\u6709\u7684\u5173\u952e\u5b57\uff0c\u6bd4\u5982\uff1a\u201dheads\u201d\uff08\u78c1\u5934\uff09\uff0c\u201dtrack\u201d\uff08\u78c1\u9053\uff09\u548c\u201dcylinders\u201d\uff08\u67f1\u9762\uff09\u3002<\/p>\n
\u4e0b\u9762\u5206\u522b\u662fHDD\u548cSSD\u7684\u8f93\u51fa\u7ed3\u679c<\/p>\n
Disk \/dev\/sda: 120.0 GB, 120034123776 bytes\r\n255 heads, 63 sectors\/track, 14593 cylinders\r\nUnits = cylinders of 16065 * 512 = 8225280 bytes\r\nSector size (logical\/physical): 512 bytes \/ 512 bytes\r\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\r\nDisk identifier: 0x00074f7d\r\n[pythontab@pyhontab.com ~]$ sudo fdisk -l\r\nDisk \/dev\/nvme0n1: 238.5 GiB, 256060514304 bytes, 500118192 sectors\r\nUnits: sectors of 1 * 512 = 512 bytes\r\nSector size (logical\/physical): 512 bytes \/ 512 bytes\r\nI\/O size (minimum\/optimal): 512 bytes \/ 512 bytes\r\nDisklabel type: dos\r\nDisk identifier: 0xad91c214\r\n......\r\n<\/pre>\n\u5176\u4ed6\u65b9\u6cd5<\/strong><\/span><\/div>\n\u53ef\u4ee5\u4f7f\u7528\u7b2c\u4e09\u65b9\u5de5\u5177\u5224\u65ad\uff0c\u6bd4\u5982smartctl\uff0c\u8fd9\u4e9b\u5de5\u5177\u7684\u7ed3\u679c\u5c55\u793a\u6bd4\u8f83\u76f4\u89c2\uff0c\u4f46\u662f\u9700\u8981\u5355\u72ec\u5b89\u88c5\u3002<\/p>\n
\n\u539f\u6587\u6765\u81ea\uff1ahttp:\/\/www.pythontab.com\/html\/2018\/linuxkaiyuan_0507\/1288.html<\/a><\/p>\n