式年遷宮、同じことでも技術を忘れないように記録を残しながらやろう。
まだエラーは出てないが、たまたま smartctl -a の結果をGeminiに見せたら もうやばいねって言われた。Reallocated_Sector_Ct が 15 なのであかんと。
回復不能セクター(Offline_Uncorrectable)と代替処理保留中のセクター (Current_Pending_Sector)が検出されています。重要なデータが保存されて いる場合は、直ちに別のドライブへバックアップを取り、交換を検討してください。
だそうで。2018年ころ買って壊れたPCからの再利用品なので もう引っ張る意味ないか。ということで交換。
もとのSSD(壊れそうなやつ)のgptがこれ。
start size index contents
0 1 PMBR
1 1 Pri GPT header
2 32 Pri GPT table
34 14 Unused
48 209715200 1 GPT part - NetBSD RAIDFrame component
209715248 16777216 2 GPT part - NetBSD swap
226492464 7949151 Unused
234441615 32 Sec GPT table
234441647 1 Sec GPT header
新しいSSD(USB-SATA接続でsd0につながっている)に真似して作っていく。
gpt create sd0 gpt add -b 48 -l system2026b -s 209715200 -t raid sd0 gpt add -b $((48+209715200)) -l swap2026b -t swap sd0 : ブートコードをラベル名指定で書く gpt biosboot -L swap2026b sd0 /dev/rsd0: Partition 1 marked as bootable : ディスク番号を調べる dkctl sd0 listwedges /dev/rsd0: 2 wedges: dk7: system2026b, 209715200 blocks at 48, type: raidframe dk8: swap2026b, 40354399 blocks at 209715248, type: swap : ふむふむdk7ね
壊れそうSSDは /dev/raid2 の構成員なので、入れ替え。
: RAIDframeに参加させる raidctl -a /dev/dk7 raid2 : 確認 raidctl -s raid2 | head -3 Components: /dev/dk5: optimal /dev/dk3: optimal Spares: /dev/dk7: spare : 壊れそうなwd1は wd1 なんだがdk3? それともdk5かな? dkctl wd1 listwedgeinfo /dev/rwd1: 2 wedges: dk3: system2025b, 209715200 blocks at 48, type: raidframe dk4: swap2025b, 16777216 blocks at 209715248, type: swap : はいdk3でしたー。では、/dev/dk3 をFAILさせよう。 raidctl -F /dev/dk3 raid2 : 再構築が始まっているか確認 raidctl -s raid2 raidctl -S raid2 Reconstruction is 5% complete. Parity Re-write is 100% complete. Reconstruction status: 5% |** | ETA: 15:45 / : 15分くらいね。待ちましょう(-SはC-cで止めても平気)。
gpt biosboot -L system2026b sd0 /dev/rsd0: Partition 1 marked as bootable installboot -v -o timeout=4 /dev/rdk7 /usr/mdec/bootxx_ffsv2 File system: /dev/rdk7 Primary bootstrap: /usr/mdec/bootxx_ffsv2 Boot options: timeout 4, flags 0, speed 9600, ioaddr 0, console pc