トップ «前の日記(2021-08-04(Wed)) 最新 次の日記(2021-08-06(Fri))» 編集

屑俺日記

僕の備忘録(PC、UN*X、ネットワーク関連が中心)なんです。
自分の書いたところは適当(な時とか)に書き換えますので御了承を。


2021-08-05(Thu) 壊れかけたハードウェアの息吹が

一部にエラーのあるSSD

%util

[木  8月  5 09:51:51 2021] ata2: limiting SATA link speed to 3.0 Gbps
[木  8月  5 09:51:51 2021] ata2.00: exception Emask 0x10 SAct 0x1e00000 SErr 0x400100 action 0x6 frozen
[木  8月  5 09:51:51 2021] ata2.00: irq_stat 0x08000000, interface fatal error
[木  8月  5 09:51:51 2021] ata2: SError: { UnrecovData Handshk }
[木  8月  5 09:51:51 2021] ata2.00: failed command: WRITE FPDMA QUEUED
[木  8月  5 09:51:51 2021] ata2.00: cmd 61/40:a8:00:07:8a/05:00:00:00:00/40 tag 21 ncq dma 688128 out
                                      res 40/00:a8:00:07:8a/00:00:00:00:00/40 Emask 0x10 (ATA bus error)
[木  8月  5 09:51:51 2021] ata2.00: status: { DRDY }
[木  8月  5 09:51:51 2021] ata2.00: failed command: WRITE FPDMA QUEUED
[木  8月  5 09:51:51 2021] ata2.00: cmd 61/40:b0:40:0c:8a/05:00:00:00:00/40 tag 22 ncq dma 688128 out
                                      res 40/00:a8:00:07:8a/00:00:00:00:00/40 Emask 0x10 (ATA bus error)
[木  8月  5 09:51:51 2021] ata2.00: status: { DRDY }
[木  8月  5 09:51:51 2021] ata2.00: failed command: WRITE FPDMA QUEUED
[木  8月  5 09:51:51 2021] ata2.00: cmd 61/40:b8:80:11:8a/05:00:00:00:00/40 tag 23 ncq dma 688128 out
                                      res 40/00:a8:00:07:8a/00:00:00:00:00/40 Emask 0x10 (ATA bus error)
[木  8月  5 09:51:51 2021] ata2.00: status: { DRDY }
[木  8月  5 09:51:51 2021] ata2.00: failed command: WRITE FPDMA QUEUED
[木  8月  5 09:51:51 2021] ata2.00: cmd 61/40:c0:c0:16:8a/05:00:00:00:00/40 tag 24 ncq dma 688128 out
                                      res 40/00:a8:00:07:8a/00:00:00:00:00/40 Emask 0x10 (ATA bus error)
[木  8月  5 09:51:51 2021] ata2.00: status: { DRDY }
[木  8月  5 09:51:51 2021] ata2: hard resetting link
[木  8月  5 09:51:51 2021] ata2: SATA link up 3.0 Gbps (SStatus 123 SControl 320)
[木  8月  5 09:51:51 2021] ata2.00: configured for UDMA/133
[木  8月  5 09:51:51 2021] ata2: EH complete

に、ディスクイメージをddrescueやってみた。

# time ddrescue -f ../DISK.img /dev/sdb log
GNU ddrescue 1.23
Press Ctrl-C to interrupt
     ipos:  120034 MB, non-trimmed:        0 B,  current rate:  70778 kB/s
     opos:  120034 MB, non-scraped:        0 B,  average rate:  62812 kB/s
non-tried:    8001 MB,  bad-sector:        0 B,    error rate:       0 B/s
  rescued:  120034 MB,   bad areas:        0,        run time:     31m 50s
pct rescued:   93.75%, read errors:        0,  remaining time:      2m 25s
                              time since last successful read:         n/a
Copying non-tried blocks... Pass 1 (forwards)
ddrescue: Write error: No space left on device
 
real    31m59.446s
user    0m6.376s
sys     2m52.582s

SSDのサイズは、ディスクイメージより少し小さかったけど、 ディスクのパーテーションがずっと小さかったためか起動に問題はなかった。
何よりも奇怪なのは%utilだろうな。

温度湿度気圧センサー

Pi and BME280

一年半近く放置であった。ピンヘッダは比較的初期に はんだづけしていたが、少し隙間ができたのが気に入らず、 気分も盛り下がっていた。

本当は昨日だけど、コンデジのバッテリが切れており 時間も迫っていたので記録は今日になった。

Pi                                         SSCI-022361
1: 3.3V  ---------+          +---------------  SDO
2: SDA   ----+    |    +-----|---------------  SCK
3: SCL   ----|----|----+     |     +---------  SDI
4:           +----|----------|-----+    +----  CSB
5: GND   ---------|----------+----------|----  GND
6:                |                     +----  VCore
7:                +---------------------+----  Vio

RasPi3と繋ぐために 適当にはんだづけ。

/samplecodes/BME280 $ sudo i2cdetect  -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- 76 --

毎回見えた。

SWのgithubからサンプルコードをgit cloneさしてもらった。
pip install smbus2。

/BME280/Python27 $ sudo python bme280_sample.py 
temp : 31.67  ℃
pressure : 1003.12 hPa
hum :  64.52 %

bme280_sample.py は print 文を print()に 書き換えるだけで、python3で動いた。

$ sudo python3 py3_bme280_sample.py 
temp : 31.33  ℃
pressure : 1003.14 hPa
hum :  64.53 %

リンクはご自由にどうぞ。でもURLや内容が変った場合はあしからず。

index.htmlは ここから。