Скрипт вывода основных данных по использованию SSD
Добавлено: 24 май 2020, 19:27
Так где-то на предыдущих страницах так же разбирались с 241 параметром на моем ssd и так не решили что там за число 

Лучше через день - два.
Код: Выделить всё
...
if [[ `dpkg -l| grep smartmontools` = "" ]]
...
man dpkg
выдал dpkg - package manager for Debian
whereis
присутствует?Код: Выделить всё
➜ ~ rpm -qa | grep smartmontools
smartmontools-7.2-2.fc33.x86_64
smartmontools
можно смело удалять.apt
не будет, и ещё многого из того, что в используется в сценарии.Эти как правило есть везде и всегда в любом дистре
А этой вполне может не быть во многих инсталляциях, xfce/mate/etc
smartmontools
, сценарий работает?А я и не с претензиямиdemonlibra писал(а): ↑17 мар 2021, 10:02На универсальность не претендую. Чем пользуюсь, там и проверял.
Код: Выделить всё
➜ ~ sudo smartctl -A /dev/nvme0
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.11.0-051100rc6-generic] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF SMART DATA SECTION ===
SMART/Health Information (NVMe Log 0x02)
Critical Warning: 0x00
Temperature: 52 Celsius
Available Spare: 100%
Available Spare Threshold: 5%
Percentage Used: 15%
Data Units Read: 32 718 258 [16,7 TB]
Data Units Written: 33 863 354 [17,3 TB]
Host Read Commands: 340 575 062
Host Write Commands: 291 253 349
Controller Busy Time: 7 472
Power Cycles: 1 105
Power On Hours: 969
Unsafe Shutdowns: 90
Media and Data Integrity Errors: 150
Error Information Log Entries: 3
Warning Comp. Temperature Time: 569
Critical Comp. Temperature Time: 83
Temperature Sensor 1: 52 Celsius
Temperature Sensor 2: 55 Celsius
Thermal Temp. 2 Transition Count: 641
Thermal Temp. 2 Total Time: 17763104
➜ ~ inxi -S
System: Host: aryabov-workbook Kernel: 5.11.0-051100rc6-generic x86_64 bits: 64 Desktop: MATE 1.24.0
Distro: Linux Mint 20.1 Ulyssa
➜ ~ apt policy smartmontools
smartmontools:
Установлен: 7.1-1build1
Кандидат: 7.1-1build1
Таблица версий:
*** 7.1-1build1 500
500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages
100 /var/lib/dpkg/status
➜ ~
Код: Выделить всё
sudo smartctl -A /dev/sdb
[sudo] пароль для demonlibra:
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-67-generic] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF READ SMART DATA SECTION ===
SMART Attributes Data Structure revision number: 1
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
5 Reallocated_Sector_Ct 0x0033 100 100 010 Pre-fail Always - 0
9 Power_On_Hours 0x0032 098 098 000 Old_age Always - 8876
12 Power_Cycle_Count 0x0032 094 094 000 Old_age Always - 5090
177 Wear_Leveling_Count 0x0013 098 098 000 Pre-fail Always - 36
179 Used_Rsvd_Blk_Cnt_Tot 0x0013 100 100 010 Pre-fail Always - 0
181 Program_Fail_Cnt_Total 0x0032 100 100 010 Old_age Always - 0
182 Erase_Fail_Count_Total 0x0032 100 100 010 Old_age Always - 0
183 Runtime_Bad_Block 0x0013 100 100 010 Pre-fail Always - 0
187 Reported_Uncorrect 0x0032 100 100 000 Old_age Always - 0
190 Airflow_Temperature_Cel 0x0032 073 052 000 Old_age Always - 27
195 Hardware_ECC_Recovered 0x001a 200 200 000 Old_age Always - 0
199 UDMA_CRC_Error_Count 0x003e 100 100 000 Old_age Always - 0
235 Unknown_Attribute 0x0012 099 099 000 Old_age Always - 435
241 Total_LBAs_Written 0x0032 099 099 000 Old_age Always - 9428905748
demonlibra@demonlibra-Extensa-2540:~$ inxi -S
System: Host: demonlibra-Extensa-2540 Kernel: 5.4.0-67-generic x86_64 bits: 64 Desktop: Cinnamon 4.8.6
Distro: Linux Mint 20.1 Ulyssa
demonlibra@demonlibra-Extensa-2540:~$ apt policy smartmontools
smartmontools:
Установлен: 7.1-1build1
Кандидат: 7.1-1build1
Таблица версий:
*** 7.1-1build1 500
500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages
100 /var/lib/dpkg/status
Код: Выделить всё
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.11.6-051106-generic] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Family: Phison Driven OEM SSDs
Device Model: SPCC Solid State Disk
Serial Number: 01D3075B1B3700144453
Firmware Version: SAFM01.7
User Capacity: 240 057 409 536 bytes [240 GB]
Sector Size: 512 bytes logical/physical
Rotation Rate: Solid State Device
Form Factor: 2.5 inches
Device is: In smartctl database [for details use: -P show]
ATA Version is: ACS-2 (minor revision not indicated)
SATA Version is: SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is: Wed Mar 17 12:23:38 2021 +05
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
General SMART Values:
Offline data collection status: (0x00) Offline data collection activity
was never started.
Auto Offline Data Collection: Disabled.
Self-test execution status: ( 0) The previous self-test routine completed
without error or no self-test has ever
been run.
Total time to complete Offline
data collection: ( 30) seconds.
Offline data collection
capabilities: (0x79) SMART execute Offline immediate.
No Auto Offline data collection support.
Suspend Offline collection upon new
command.
Offline surface scan supported.
Self-test supported.
Conveyance Self-test supported.
Selective Self-test supported.
SMART capabilities: (0x0003) Saves SMART data before entering
power-saving mode.
Supports SMART auto save timer.
Error logging capability: (0x01) Error logging supported.
General Purpose Logging supported.
Short self-test routine
recommended polling time: ( 1) minutes.
Extended self-test routine
recommended polling time: ( 2) minutes.
Conveyance self-test routine
recommended polling time: ( 3) minutes.
SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x000b 100 100 050 Pre-fail Always - 0
9 Power_On_Hours 0x0012 100 100 000 Old_age Always - 7718
12 Power_Cycle_Count 0x0012 100 100 000 Old_age Always - 1621
168 SATA_Phy_Error_Count 0x0012 100 100 000 Old_age Always - 12359
170 Bad_Blk_Ct_Erl/Lat 0x0003 100 100 010 Pre-fail Always - 0/784
173 MaxAvgErase_Ct 0x0012 100 100 000 Old_age Always - 124 (Average 48)
192 Unsafe_Shutdown_Count 0x0012 100 100 000 Old_age Always - 98
194 Temperature_Celsius 0x0023 070 070 030 Pre-fail Always - 30 (Min/Max 29/30)
218 CRC_Error_Count 0x000b 100 100 050 Pre-fail Always - 12142
231 SSD_Life_Left 0x0013 100 100 000 Pre-fail Always - 99
241 Lifetime_Writes_GiB 0x0012 100 100 000 Old_age Always - 9198
SMART Error Log Version: 1
No Errors Logged
SMART Self-test log structure revision number 1
Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Extended offline Completed without error 00% 5390 -
# 2 Short offline Completed without error 00% 5385 -
# 3 Short offline Completed without error 00% 5371 -
# 4 Short offline Completed without error 00% 5357 -
# 5 Short offline Completed without error 00% 5347 -
# 6 Short offline Completed without error 00% 5336 -
# 7 Short offline Completed without error 00% 5323 -
# 8 Short offline Completed without error 00% 5321 -
# 9 Short offline Completed without error 00% 5315 -
#10 Short offline Completed without error 00% 5300 -
#11 Short offline Completed without error 00% 5286 -
#12 Short offline Completed without error 00% 5270 -
#13 Short offline Completed without error 00% 5256 -
#14 Short offline Completed without error 00% 5245 -
#15 Short offline Completed without error 00% 5236 -
#16 Short offline Completed without error 00% 5228 -
#17 Short offline Completed without error 00% 5214 -
#18 Short offline Completed without error 00% 5200 -
#19 Short offline Completed without error 00% 5186 -
#20 Short offline Completed without error 00% 5170 -
#21 Short offline Completed without error 00% 5156 -
SMART Selective self-test log data structure revision number 1
SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS
1 0 0 Not_testing
2 0 0 Not_testing
3 0 0 Not_testing
4 0 0 Not_testing
5 0 0 Not_testing
Selective self-test flags (0x0):
After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.
Код: Выделить всё
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.11.6-051106-generic] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Number: XPG GAMMIX S5
Serial Number: 2K1620115069
Firmware Version: V9002s45
PCI Vendor/Subsystem ID: 0x10ec
IEEE OUI Identifier: 0x00e04c
Controller ID: 1
Number of Namespaces: 1
Namespace 1 Size/Capacity: 1 024 209 543 168 [1,02 TB]
Namespace 1 Formatted LBA Size: 512
Local Time is: Wed Mar 17 12:23:57 2021 +05
Firmware Updates (0x02): 1 Slot
Optional Admin Commands (0x0006): Format Frmw_DL
Optional NVM Commands (0x0014): DS_Mngmt Sav/Sel_Feat
Maximum Data Transfer Size: 32 Pages
Warning Comp. Temp. Threshold: 115 Celsius
Critical Comp. Temp. Threshold: 120 Celsius
Supported Power States
St Op Max Active Idle RL RT WL WT Ent_Lat Ex_Lat
0 + 8.00W - - 0 0 0 0 0 0
1 + 4.00W - - 1 1 1 1 0 0
2 + 3.00W - - 2 2 2 2 0 0
3 - 0.0128W - - 3 3 3 3 4000 8000
4 - 0.0080W - - 4 4 4 4 8000 30000
Supported LBA Sizes (NSID 0x1)
Id Fmt Data Metadt Rel_Perf
0 + 512 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: 40 Celsius
Available Spare: 100%
Available Spare Threshold: 32%
Percentage Used: 0%
Data Units Read: 3 064 654 [1,56 TB]
Data Units Written: 5 213 407 [2,66 TB]
Host Read Commands: 21 537 828
Host Write Commands: 57 778 600
Controller Busy Time: 0
Power Cycles: 111
Power On Hours: 65
Unsafe Shutdowns: 18
Media and Data Integrity Errors: 0
Error Information Log Entries: 0
Warning Comp. Temperature Time: 0
Critical Comp. Temperature Time: 0
Error Information (NVMe Log 0x01, max 8 entries)
Num ErrCount SQId CmdId Status PELoc LBA NSID VS
0 1 0 0x0000 0x0000 0x000 0 0 -
6 1219368206019475265 0 0x0000 0x0000 0x000 0 0 -
dpkg
на whereis
.gnome-screenshot
.Код: Выделить всё
Обнаружены следующие накопители:
NAME SIZE MODEL SERIAL
sda 223,6G SPCC_Solid_State_Disk 01D3075B1B3700144453
sdb 1,8T TOSHIBA_HDWD120 994EPN8CS
nvme0n1 953,9G XPG GAMMIX S5 2K1620115069
------------------------------------------------------
Обнаружены следующие накопители SSD:
NAME SIZE MODEL SERIAL
sda 223,6G SPCC_Solid_State_Disk 01D3075B1B3700144453
------------------------------------------------------
Введите идентификатор накопителя из поля NAME: /dev/sd
0
в последнем запросе - обламывается
Код: Выделить всё
Обнаружены следующие накопители:
NAME SIZE MODEL SERIAL
sda 223,6G SPCC_Solid_State_Disk 01D3075B1B3700144453
sdb 1,8T TOSHIBA_HDWD120 994EPN8CS
nvme0n1 953,9G XPG GAMMIX S5 2K1620115069
------------------------------------------------------
Обнаружены следующие накопители SSD:
NAME SIZE MODEL SERIAL
sda 223,6G SPCC_Solid_State_Disk 01D3075B1B3700144453
------------------------------------------------------
Введите идентификатор накопителя из поля NAME: /dev/sda
Модель: SPCC Solid State Disk
Серийный номер: 01D3075B1B3700144453
Объем: 240 057 409 536 bytes [240 GB]
Всего занято на разделах: 0 Гбайт
Размер сектора: 512 байт
241 Lifetime_Writes_GiB: 9198
Всего записано данных (TBW): 8.982 ТБайт
9 Power_On_Hours: 7737
Всего отработано: 7737 часов = 322 дней = 0.88 лет
Введите дату установки накопителя (в формате год-месяц-число): 2016-03-12
Накопитель использовался 17% времени с момента установки
Средний объем записываемых данных: 5.0 ГБайт в день или 1.7 Тбайт в год
Введите гарантированный производителем объем записываемых данных (Тбайт): 0
Runtime error (func=(main), adr=25): Divide by zero
(standard_in) 1: syntax error
./ssd-tbw.sh: строка 230: ((: < 30 : синтаксическая ошибка: ожидается операнд (неверный маркер «< 30 »)
./ssd-tbw.sh: строка 232: ((: < 50 : синтаксическая ошибка: ожидается операнд (неверный маркер «< 50 »)
Израсходованный ресурс: % за 5.0 лет (% в год)
Теоретический срок эксплуатации (лет): 0
Теоретический срок эксплуатации (лет) с учетом свободного места: 0
Убрал суффикс sd. Теперь можно ввести
nvme0n1
.Не надо вводить 0. Надо ввести то, что обещает производитель.