Continuing the discussion from Boot freezes after starting Grub successfully | btrfs filesystem errors:
Do you have a recommendation on how to test the disk after reformatting and before installation?
I use f3 which is in Fedora repo. Short how-to:
Optional: I start with blkdiscard on the whole device, e.g. /dev/sda or /dev/nvme0n1 to totally wipe it. No file systems no partition map. Nothing. This results in complete data loss. I also use this command again at the end of testing so the device is erased before reprovisioning/reinstallation.
- Format the device (partitioning is not necessary) with any file system. Btrfs, ext[234], xfs, f2fs, fat, makes no difference.
- Mount it normally, e.g.
/mnt f3 write /mntf3 read /mnt
That’s it. The man page has much more info on how to read the results, and the rationale of f3, what specific issues it’s designed to detect.
SMART tests different things and it’s a bit of a black box. But I think it’s OK to to a smartctl -t short test since it should test things that file systems can’t. The long test is primarily a read sectors test, and I think we’re better off writing patterns over the entire block device and reading them back in to verify with F/OSS than entirely relying on the firmware.
The smart test can be done anytime, the order doesn’t matter. It isn’t affected by, nor will it affect the steps above.
Use smartctl -x or smartctl -a to reveal the self-test log for the results/status. e.g.
Self-test Log (NVMe Log 0x06, NSID 0xffffffff)
Self-test status: No self-test in progress
Num Test_Description Status Power_on_Hours Failing_LBA NSID Seg SCT Code
0 Short Completed without error 82 - - - - -
If there are errors with any tests, replace the drive - hopefully under warranty.