Good News,
Perhaps you’ve read my last article related to the Raspberry Pi 5, where I explore what kind of NVMe SSD experience one can get for a mere $25 or less spent on Amazon. And, the TLDR is that for under $25 I was able to purchase a brand new PCI-E M.2 HAT for the Pi 5, as well as a name brand Gen 3 128 GB SSD. The SK Hynix SSD was not brand new, it was pulled from something but SMART showed that it had less than 300GB written to it, so IMO absolutely worth buying.
So in that write up, I discuss the PCI link speed situation… basically, the Pi is only certified for Gen 2… but Gen 3 offers nearly double the speed! Immediately, I was conflicted. Even at Gen 2 speed, this already beats using SD card storage by a MILE. Way more reliable, MUCH faster, and much larger. There is no down side, other than costing a small bit more. Since this runs my server, I could have happily stuck with Gen 2 and still gotten more than my money’s worth in terms of bang-for-buck computing goodness out of the upgrade. However, many folks on the net reported no issues whatsoever running at 3.0 link speed, so I figured I’d try it, run several benchmarks, use it for several days. If I saw even one error, minor or otherwise, Gen 3 would be officially off the table.
Now, I’d be willing to bet that what I did next was not entirely necessary. But basically, there are some files you can read back from a system directory in linux which will tell you if you’re having NVME errors. Non-volatile memory advanced error reporting, or NVMAER for short. I go into more detail in the original article.
I run many scripts via cron on this machine. The ease of scripting as a sysadmin’s tool is a large part of what makes *nix such an excellent platform for power users. So… I wrote up a script, which runs once per hour. It checks for any of three types of NVMAER errors; when it does this, it appends a time stamped line to a log file stating wether or not it found errors. If It does find any, it will say which kind of errors they were, and I’ll know WHEN they happened.
Now, I’m sure what I am doing here is entirely redundant. I’d be very surprised if the system logs don’t already store all this and more, but it doesn’t tax this system to run a small script once per hour, and it gave me more confidence that if anything wonky did happen at Gen 3 speed that I wouldn’t possibly miss it! The last thing I wanted was to have minor errors which weren’t obvious, then down the road I end up with corrupt files.
I figured I’d share that script, because it came out pretty clean. And, it is a really good example of how one can go about building the tool, which solves a given problem. The multiple error types which are possibly made it just interesting enough, in my opinion. AND, even if this may be entirely redundant, just the ease of use made it worth it for me. So maybe you’ll find it of use yourself if you’re also self-validating PCIE 3 speeds on your Pi 5 SSD.
#!/bin/bash
LOGFILE="/var/log/cronlog/nvmaer.log" # Log file. You'll want to change this! The directory must already exist.
# Define color codes
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Current date
DATE=$(date)
LOG_DATE=$(date +"%m/%d/%Y %H:%M")
echo "CHECK DATE: $DATE"
# Initialize variables
exit_code=0
log_entry=""
# Function to check errors
check_errors() {
local error_type="$1"
local file_path="$2"
echo "Checking for $error_type errors..."
# Capture the output of the command
errors=$(awk '$2 != 0' "$file_path")
# Check if errors is empty
if [ -z "$errors" ]; then
# No errors found
echo -e "${GREEN}PASSED${NC}"
log_entry+=" $error_type PASSED"
else
# Errors detected
echo -e "${YELLOW}ERRORS DETECTED!${NC}"
echo "$errors"
log_entry+=" $error_type ERRORS DETECTED!"
log_entry+=$'\n'"$errors"
# Set the exit code to indicate problems
exit_code=1
fi
echo "- - - - - - - - - - - - - - - - - - - -"
}
# Check for FATAL errors
check_errors "FATAL" "/sys/devices/platform/axi/1000110000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/aer_dev_fatal"
# Check for NONFATAL errors
check_errors "NONFATAL" "/sys/devices/platform/axi/1000110000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/aer_dev_nonfatal"
# Check for CORRECTABLE errors
check_errors "CORRECTABLE" "/sys/devices/platform/axi/1000110000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/aer_dev_correctable"
# Log results
if [ $exit_code -eq 0 ]; then
# No errors detected
echo -e "CHECK $LOG_DATE -- NO ERRORS, ${GREEN}[CHECK PASSED]${NC}" >> "$LOGFILE"
else
# Errors detected
echo "$log_entry" >> "$LOGFILE"
fi
# Exit with the appropriate exit code
exit $exit_code
Original article: https://lostgeek.net/pi5nvme


So This was annoying though. This hat is sold as being 2230 / 2242 compatible… and it is. But they don’t give you the nut and screw for 2230 drives, the shorter position.
board.








The OpenWRT project is a completely free and open source linux system intended to replace the firmware on your router / wireless AP. It has tons of packages available and has a very active community and development scene. I’ve used it for years, it is incredibly good firmware. If you’ve never heard of it think DD-WRT but better, in my opinion.
laptop you just bought, but on many laptops the SATA connector PCB is separate from the motherboard. That is the case with this one, both the HDD and ODD (optical disc drive) connectors are on small PCBs connected via ribbon cable. If you screw up, replace it… That said, check to verify you can get your hands on a new one first — if you care. And if you want a prettier or more, plug and play solution then do a web search for “slim DVD to hard drive adapter”. You can buy something more elegant for under ten dollars. I did this because I could. It cost nothing. There was no risk, this is a motherboard I use as a server, so I don’t use an optical drive anyway. Some bulk storage though, without sacrificing the IOPS of the 256 GB SSD though… that’d be cool.
So, with the modification being done here you can really use just about any SATA drive. However, unless you find a source of 12V somewhere on the laptop motherboard or come up with it somehow then you’ll probably want to avoid 3.5″ desktop size drives. Notebook HDDs and any SSD will happily run on 5 volts, as far as I know. That said, we need to get a bit creative though, because while the stock ODD connector does have power it only has 3.3 volts. That’s it, 3.3V some control pins and ground.
Why wouldn’t that work?? Well, look back to the second to last image — the one with the two connectors. The desktop / full size power connector uses wider spacing between the pins. So while as you can see I did physically plug this into a hard drive, the pins do not each land correctly one to one on a pad. Even if they did, the pins in the power portion of the slim ODD connector only have ground and 3.3v. For notebook drives we need 5v. For fullsize drives, we need 5v and 12v.
Part way done. I’ve stood up all the power pins, to carefully remove them without tearing PCB traces or damaging the pads. The pins were wiggled back and fourth, and fell right off.



