Solve: So You Like to Suffer—Manually Troubleshooting NVMe on Your Raspberry Pi
Solve: So You Like to Suffer—Manually Troubleshooting NVMe on Your
Raspberry Pi
Some folks like menus. Others like to learn by doing things the long,
hard way. This post is for the latter.
If you’re the type who prefers to run commands one at a time, read their output in real time, and interpret things like a UNIX mystic at a mountain temple, then grab a cup of tea and settle in.
If you’re the type who prefers to run commands one at a time, read their output in real time, and interpret things like a UNIX mystic at a mountain temple, then grab a cup of tea and settle in.
Step 1: Make Sure nvme-cli Is Installed
Your Pi won’t know what to do with NVMe unless you give it the tools. Run:
If that works, you’re in business. If not, suffer more. (Or check your
/etc/apt/sources.list.)
Your Pi won’t know what to do with NVMe unless you give it the tools. Run:
Step 2: See If Your Drive Even Exists
Try:
If you see /dev/nvme0n1, that’s your drive. If not, check your physical
adapter, reseat the cable, or confirm you’re not running into power
limits. If it shows up intermittently, check for undervoltage.
Try:
Step 3: Check Kernel Messages
Your Pi’s dmesg logs will often whisper secrets about your hardware:
You’re looking for clues—timeouts, PCIe negotiation failures, or
temperature warnings. This is where suffering pays off.
Your Pi’s dmesg logs will often whisper secrets about your hardware:
Step 4: View SMART Stats
This will tell you about temperature, lifespan, errors, and how much data has been written:
Don’t be scared of the output. Look for “Temperature” and “Percentage
Used.” If you see anything over 80% used on a drive you just bought—send
it back.
This will tell you about temperature, lifespan, errors, and how much data has been written:
Step 5: Confirm TRIM/Discard Support
TRIM helps your SSD stay fast over time. Run this:
If it trims a chunk of data and doesn’t return an error, you're good. If
not, your file system or kernel may not support it.
TRIM helps your SSD stay fast over time. Run this:
Step 6: Run a Write Test
This writes 100MB of zeros to your drive:
If it’s slower than ~150 MB/s on a Pi 5, something might be up. But also,
it’s Pi Linux. Manage expectations.
This writes 100MB of zeros to your drive:
Step 7: Run a Read Test
Now read the file back into the void:
Delete the file afterward if you’re feeling tidy:
You’ve Done It
You’ve just manually replicated what our script does in one menu click. And you learned stuff, didn’t you?
You can now create your own bash script, or keep living the dream one command at a time.
Now read the file back into the void:
You’ve just manually replicated what our script does in one menu click. And you learned stuff, didn’t you?
You can now create your own bash script, or keep living the dream one command at a time.
Need Raspberry Pi Expertise?
We'd love to help you with your Raspberry Pi projects. Feel free to reach out to us at info@pacificw.com.
Written by Aaron Rose, software engineer and technology writer at Tech-Reader.blog.
Comments
Post a Comment