1.让机器能有外网
2,安装工具
sudo apt-get install smartmontools
3,输入查询命令
sudo smartctl -x /dev/sda |egrep 'Device Model|User Capacity|Sector Size|173|Logical Sectors Written|Percentage Used Endurance Indicator'
4,计算擦写次数

计算方法:2578270620(0x018后面的数字)×512(Size后面的数字)÷ 1024 ÷ 1024 ÷ 1024 ÷ 64 (硬盘大小是64G)


















![[oeasy]python0072_整数类型_int_integer_整型变量](https://img-blog.csdnimg.cn/img_convert/652b3be561f0441892198122b83757cb.png)