nvme_dev_self_test(2)

✨ nvme_dev_self_test ✨

okay bestie, we're in the libnvme API manual and today's main character is nvme_dev_self_test(2) πŸ’…


πŸŽ€ NAME πŸŽ€

nvme_dev_self_test β€” start or abort a self test 🩺✨


🌸 SYNOPSIS 🌸

int nvme_dev_self_test (struct nvme_dev_self_test_args *args );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • args β€” the struct nvme_dev_self_test argument structure. it's giving "here's everything you need, hand it over" 🫢

πŸ’– DESCRIPTION πŸ’–

so like. the Device Self-test command either starts a device self-test operation or aborts one, no in-between, pick a lane. a device self-test operation is a diagnostic testing sequence that tests the integrity and functionality of the controller, and ngl it may also include testing of the media associated with namespaces 🌈

and here's the lowkey iconic part: the controller may return a response to this command immediately while it runs the self-test in the background. it's doing side quests while you get your answer back, no cap 😭

now the nsid field, pay attention bestie, this is the whole vibe check:

  • set the 'nsid' field to 0 to not include namespaces in the test πŸ™…β€β™€οΈ
  • set to 0xffffffff to test all namespaces πŸ‘‘
  • all other values test a specific namespace, if present 🎯

⭐ RETURN ⭐

the nvme command status if a response was received (peep enum nvme_status_field for that) β€” or -1 with errno set otherwise πŸ™ˆ

fr fr, if you get -1, go check errno, that's where the tea is πŸ“

and that's the whole page, periodt πŸ’œ this lil slice of the libnvme API manual is the nvme_dev_self_test(2) page, dated July 2026, and yes we're obsessed with her. now go run that self test, you got this 🧚🌸

πŸ“¦ where this page comes from