暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

MacOS 检查SSD磁盘寿命(smartctl) , 查看传感器数据(风扇,温度等)(istats)

digoal 2021-01-06
1773

作者

digoal

日期

2021-06-14

标签

PostgreSQL , smartctl , smartmontools , iStats


背景

1、查看传感器数据

https://github.com/Chris911/iStats

sudo gem install iStats

istats 或 iStats

```
digoaldeMini:blog digoal$ istats
--- CPU Stats ---
CPU temp: 51.75°C ▁▂▃▅▆▇

--- Fan Stats ---
Total fans in system: 1
Fan 0 speed: 1735 RPM ▁▂▃▅▆▇

--- Battery Stats ---
No battery on system

For more stats run istats extra and follow the instructions.
```

2、查看ssd磁盘寿命

安装homebrew

https://blog.csdn.net/m0_46197393/article/details/106752367#:~:text=Homebrew%20%E6%98%AF%E4%B8%80%E6%AC%BE%20Mac%20OS%20%E5%B9%B3%E5%8F%B0%E4%B8%8B%E7%9A%84%E8%BD%AF%E4%BB%B6%E5%8C%85%E7%AE%A1%E7%90%86%E5%B7%A5%E5%85%B7%EF%BC%8C%E6%8B%A5%E6%9C%89%20%E5%AE%89%E8%A3%85%20%E3%80%81%E5%8D%B8%E8%BD%BD%E3%80%81%E6%9B%B4%E6%96%B0%E3%80%81%E6%9F%A5%E7%9C%8B%E3%80%81%E6%90%9C%E7%B4%A2%E7%AD%89%E5%BE%88%E5%A4%9A%E5%AE%9E%E7%94%A8%E7%9A%84%E5%8A%9F%E8%83%BD%E3%80%82%20%E5%AE%98%E6%96%B9%E5%9C%B0%E5%9D%80,%2Finstall%2Fmaster%2Finstall.sh%29%E2%80%9D%20%20%E9%80%9A%E5%B8%B8%E5%9B%BD%E5%86%85%E8%AE%BF%E9%97%AE%E4%B8%8D%E5%88%B0%EF%BC%8C%E4%BC%9A%E5%87%BA%E7%8E%B0%E4%B8%8B%E9%9D%A2%E7%9A%84%E9%97%AE%E9%A2%98%20curl%3A%20%2835%29%20LibreSSL%20SSL_connect%3A%20SS

方法一:使用中科大镜像源进行访问脚本文件

```
/usr/bin/ruby -e "$(curl -fsSL https://cdn.jsdelivr.net/gh/ineo6/homebrew-install/install)"

cd "$(brew --repo)"
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git

mkdir "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
```

安装smartmontools

https://www.xiaoyuanjiu.com/18668.html#:~:text=%E6%A3%80%E6%9F%A5macOS%20SSD%E5%AF%BF%E5%91%BD%E6%95%99%E7%A8%8B%20%E9%80%9A%E8%BF%87Spotlight%E6%90%9C%E5%AF%BB%E5%8A%9F%E8%83%BD%EF%BC%88%E7%82%B9%E9%80%89%E6%A1%8C%E9%9D%A2%E5%8F%B3%E4%B8%8A%E8%A7%92%E6%94%BE%E5%A4%A7%E9%95%9C%EF%BC%89%E5%AF%BB%E6%89%BE%E3%80%8C%20%E7%BB%88%E7%AB%AF%E6%9C%BA%20%E3%80%8D%EF%BC%8C%E6%89%BE%E5%88%B0%E5%90%8E,%E7%82%B9%E5%87%BB%E7%BB%88%E7%AB%AF%E6%9C%BA%E6%89%A7%E8%A1%8C%20%E3%80%82%20%EF%BC%88%E5%A6%82%E6%9E%9C%E6%98%AFM1%20Mac%E7%94%B5%E8%84%91%E8%A6%81%E5%85%88%E7%82%B9%E7%BB%88%E7%AB%AF%E6%9C%BA%E5%8F%B3%E9%94%AE%E9%80%89%E6%8B%A9%E3%80%8C%E5%8F%96%E5%BE%97%E8%B5%84%E8%AE%AF%E3%80%8D%EF%BC%8C%E5%B9%B6%E4%B8%94%E5%B0%86%E3%80%8CRosetta%20%E3%80%8D%E5%8B%BE%E9%80%89%E5%90%8E%E6%89%8D%E8%83%BD%E6%89%A7%E8%A1%8C%E6%8C%87%E4%BB%A4%E5%AE%89%E8%A3%85%EF%BC%89

brew install smartmontools

查看磁盘ID

```
digoaldeMini:~ digoal$ diskutil list
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *251.0 GB disk0
1: EFI ⁨EFI⁩ 314.6 MB disk0s1
2: Apple_APFS ⁨Container disk1⁩ 250.7 GB disk0s2

/dev/disk1 (synthesized):
#: TYPE NAME SIZE IDENTIFIER
0: APFS Container Scheme - +250.7 GB disk1
Physical Store disk0s2
1: APFS Volume ⁨sys - 数据⁩ 37.1 GB disk1s1
2: APFS Volume ⁨Preboot⁩ 284.5 MB disk1s3
3: APFS Volume ⁨Recovery⁩ 622.9 MB disk1s4
4: APFS Volume ⁨VM⁩ 20.5 KB disk1s5
5: APFS Volume ⁨sys⁩ 15.3 GB disk1s6
6: APFS Snapshot ⁨com.apple.os.update-...⁩ 15.3 GB disk1s6s1
```

检查磁盘寿命

```
digoaldeMini:~ digoal$ smartctl -a disk0
smartctl 7.2 2020-12-30 r5155 [Darwin 20.5.0 x86_64] (local build)
Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Number: APPLE SSD AP0256M
Serial Number: C079265017GJRDWAK
Firmware Version: 1161.100
PCI Vendor/Subsystem ID: 0x106b
IEEE OUI Identifier: 0x000000
Controller ID: 0
NVMe Version: <1.2
Number of Namespaces: 1
Local Time is: Sun Jun 13 23:56:50 2021 CST
Firmware Updates (0x02): 1 Slot
Optional Admin Commands (0x0004): Frmw_DL
Optional NVM Commands (0x0004): DS_Mngmt
Maximum Data Transfer Size: 256 Pages

Supported Power States
St Op Max Active Idle RL RT WL WT Ent_Lat Ex_Lat
0 + 0.00W - - 0 0 0 0 0 0

=== START OF SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

SMART/Health Information (NVMe Log 0x02)
Critical Warning: 0x00
Temperature: 45 Celsius
Available Spare: 100%
Available Spare Threshold: 99%
Percentage Used: 0%
Data Units Read: 9,021,969 [4.61 TB]
Data Units Written: 8,449,812 [4.32 TB]
Host Read Commands: 205,855,346
Host Write Commands: 92,399,005
Controller Busy Time: 0
Power Cycles: 99
Power On Hours: 141
Unsafe Shutdowns: 46
Media and Data Integrity Errors: 0
Error Information Log Entries: 0

Read 1 entries from Error Information Log failed: GetLogPage failed: system=0x38, sub=0x0, code=745
```

PostgreSQL 许愿链接

您的愿望将传达给PG kernel hacker、数据库厂商等, 帮助提高数据库产品质量和功能, 说不定下一个PG版本就有您提出的功能点. 针对非常好的提议,奖励限量版PG文化衫、纪念品、贴纸、PG热门书籍等,奖品丰富,快来许愿。开不开森.

9.9元购买3个月阿里云RDS PostgreSQL实例

PostgreSQL 解决方案集合

德哥 / digoal's github - 公益是一辈子的事.

digoal's wechat

文章转载自digoal,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论