差分
このページの2つのバージョン間の差分を表示します。
— |
memo:examine_esp_corruption [2020-10-18 12:27] (現在) Decomo 作成 |
||
---|---|---|---|
行 1: | 行 1: | ||
+ | ====== メモ:FreeBSDでESPが壊れる問題の調査 ====== | ||
+ | |||
+ | NVMe SSD上に確保したESPが、当初は問題ないのに何らかのタイミングで不具合が発生し、ESPとして認識されなくなる問題の調査記録。 | ||
+ | |||
+ | diskinfo | ||
+ | < | ||
+ | $ diskinfo -v /dev/nvd0 | ||
+ | /dev/nvd0 | ||
+ | 4096 # sectorsize | ||
+ | 960197124096 | ||
+ | 234423126 | ||
+ | 0 # stripesize | ||
+ | 0 # stripeoffset | ||
+ | SAMSUNG MZQLB960HAJR-00007 | ||
+ | S437NY0KCxxxxx | ||
+ | Yes # TRIM/UNMAP support | ||
+ | 0 # Rotation rate in RPM | ||
+ | |||
+ | $ sudo diskinfo -v / | ||
+ | / | ||
+ | 4096 # sectorsize | ||
+ | 960197124096 | ||
+ | 234423126 | ||
+ | 0 # stripesize | ||
+ | 0 # stripeoffset | ||
+ | No # TRIM/UNMAP support | ||
+ | Unknown | ||
+ | |||
+ | $ sudo diskinfo -v /dev/nvd0p1 | ||
+ | /dev/nvd0p1 | ||
+ | 4096 # sectorsize | ||
+ | 536870912 | ||
+ | 131072 | ||
+ | 0 # stripesize | ||
+ | 24576 # stripeoffset | ||
+ | 8 # Cylinders according to firmware. | ||
+ | 255 # Heads according to firmware. | ||
+ | 63 # Sectors according to firmware. | ||
+ | SAMSUNG MZQLB960HAJR-00007 | ||
+ | S437NY0KCxxxxx | ||
+ | Yes # TRIM/UNMAP support | ||
+ | 0 # Rotation rate in RPM | ||
+ | </ | ||
+ | |||
+ | S.M.A.R.T. | ||
+ | < | ||
+ | $ sudo smartctl -a / | ||
+ | smartctl 7.0 2018-12-30 r4883 [FreeBSD 12.1-RELEASE-p3 amd64] (local build) | ||
+ | Copyright (C) 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org | ||
+ | |||
+ | === START OF INFORMATION SECTION === | ||
+ | Model Number: | ||
+ | Serial Number: | ||
+ | Firmware Version: | ||
+ | PCI Vendor/ | ||
+ | IEEE OUI Identifier: | ||
+ | Total NVM Capacity: | ||
+ | Unallocated NVM Capacity: | ||
+ | Controller ID: 4 | ||
+ | Number of Namespaces: | ||
+ | Namespace 1 Size/ | ||
+ | Namespace 1 Utilization: | ||
+ | Namespace 1 Formatted LBA Size: 4096 | ||
+ | Local Time is: Sun Oct 18 11:31:24 2020 JST | ||
+ | Firmware Updates (0x17): | ||
+ | Optional Admin Commands (0x000f): | ||
+ | Optional NVM Commands (0x001f): | ||
+ | Maximum Data Transfer Size: 512 Pages | ||
+ | Warning | ||
+ | Critical Comp. Temp. Threshold: | ||
+ | Namespace 1 Features (0x02): | ||
+ | |||
+ | Supported Power States | ||
+ | St Op | ||
+ | 0 + 10.60W | ||
+ | |||
+ | Supported LBA Sizes (NSID 0x1) | ||
+ | Id Fmt Data Metadt | ||
+ | 0 - | ||
+ | 1 + 4096 | ||
+ | |||
+ | === START OF SMART DATA SECTION === | ||
+ | SMART overall-health self-assessment test result: PASSED | ||
+ | |||
+ | SMART/ | ||
+ | Critical Warning: | ||
+ | Temperature: | ||
+ | Available Spare: | ||
+ | Available Spare Threshold: | ||
+ | Percentage Used: 0% | ||
+ | Data Units Read: 2,313,153 [1.18 TB] | ||
+ | Data Units Written: | ||
+ | Host Read Commands: | ||
+ | Host Write Commands: | ||
+ | Controller Busy Time: 306 | ||
+ | Power Cycles: | ||
+ | Power On Hours: | ||
+ | Unsafe Shutdowns: | ||
+ | Media and Data Integrity Errors: | ||
+ | Error Information Log Entries: | ||
+ | Warning | ||
+ | Critical Comp. Temperature Time: 0 | ||
+ | Temperature Sensor 1: 43 Celsius | ||
+ | Temperature Sensor 2: 47 Celsius | ||
+ | Temperature Sensor 3: 54 Celsius | ||
+ | </ | ||
+ | |||
+ | gpart | ||
+ | < | ||
+ | > gpart show nvd0 | ||
+ | => 6 234423115 | ||
+ | 6 | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | 199360518 | ||
+ | 222953478 | ||
+ | 230817798 | ||
+ | </ | ||
+ | |||
+ | ESPをゼロフィル | ||
+ | < | ||
+ | $ sudo dd if=/ | ||
+ | dd: / | ||
+ | 131073+0 records in | ||
+ | 131072+0 records out | ||
+ | 536870912 bytes transferred in 4.088874 secs (131300437 bytes/sec) | ||
+ | |||
+ | $ sudo dd if=/ | ||
+ | 131072+0 records in | ||
+ | 131072+0 records out | ||
+ | 536870912 bytes transferred in 6.493961 secs (82672331 bytes/sec) | ||
+ | |||
+ | $ cat ~/ | ||
+ | All zeroes. | ||
+ | </ | ||
+ | |||
+ | ESPを作る | ||
+ | < | ||
+ | $ sudo newfs_msdos -F 32 -S 4096 -c 1 nvd0p1 | ||
+ | / | ||
+ | BytesPerSec=4096 SecPerClust=1 ResSectors=4 FATs=2 Media=0xf0 SecPerTrack=63 Heads=255 HiddenSecs=0 HugeSectors=131072 FATsecs=128 RootCluster=2 FSInfo=1 Backup=2 | ||
+ | |||
+ | $ mkdir /tmp/esp | ||
+ | $ sudo mount -t msdosfs /dev/nvd0p1 /tmp/esp | ||
+ | $ mkdir -p / | ||
+ | $ cp / | ||
+ | $ echo ' | ||
+ | $ sync | ||
+ | $ sync | ||
+ | $ sync | ||
+ | $ sudo umount /tmp/esp | ||
+ | |||
+ | $ dd if=/ | ||
+ | 131072+0 records in | ||
+ | 131072+0 records out | ||
+ | 536870912 bytes transferred in 6.256422 secs (85811175 bytes/sec) | ||
+ | $ cat ~/ | ||
+ | tr: Illegal byte sequence | ||
+ | All zeroes. | ||
+ | </ | ||
+ | |||
+ | イメージのsha1 | ||
+ | < | ||
+ | $ sha1 ~/ | ||
+ | SHA1 (/ | ||
+ | SHA1 (/ | ||
+ | </ | ||
+ | |||
+ | 再起動1回目後のイメージ | ||
+ | < | ||
+ | $ sudo dd if=/ | ||
+ | 131072+0 records in | ||
+ | 131072+0 records out | ||
+ | 536870912 bytes transferred in 6.461511 secs (83087514 bytes/sec) | ||
+ | |||
+ | $ sha1 ~/ | ||
+ | SHA1 (/ | ||
+ | </ | ||