Inspect Linux Framebuffer Devices Through /proc/fb
A black screen after a driver change sends most people straight to /proc/fb to see what the kernel thinks is there. This guide checks whether the interface exists, reads what it reports, and treats an empty result as data rather than a fault. It follows proc_fb(5) from Linux man-pages 6.7, installed here with package version 6.7-2.
The route
Jump straight to the step you need, or tick off Done means at the end.
Allow about ten minutes. You need a shell and a running Linux system with /proc mounted. Everything here only reads kernel status: nothing loads a graphics driver, creates /dev/fb0, changes the console, or restarts a service.
1. Check whether the interface is present
Start with a file test rather than reading the file blind. That way you can tell a missing procfs entry apart from an entry that exists but happens to hold no lines:
if test -r /proc/fb; then
printf '%s\n' '/proc/fb is readable'
else
status=$?
printf 'Cannot read /proc/fb (test status %s)\n' "$status" >&2
exit 1
fi
The manpage defines /proc/fb as framebuffer information exposed when the kernel was compiled with CONFIG_FB. That compile-time flag is the real boundary here: no user-space utility can bolt this procfs interface onto a kernel that was built without the option. A failed readability test can also just mean procfs is not mounted, or access is restricted.
Checkpoint
Run the test and confirm it prints either /proc/fb is readable or the diagnostic. Do not swap in ls /dev/fb* as a substitute: device nodes and the procfs report answer different questions.
2. Read the report without changing anything
Once the file test succeeds, print it directly:
$ cat /proc/fb
A machine with registered framebuffer information shows one or more text lines describing the entries. On this host it produces no output at all, and that is a valid observation: the file is available, it just currently has nothing to report. An empty result is not proof that a monitor is unplugged, that the graphics stack is broken, or that a DRM device is missing.
Save a diagnostic snapshot when you are investigating a machine remotely. The redirection creates or replaces only the named report file, so pick a path you own:
report="${TMPDIR:-/tmp}/proc-fb.$$.txt"
cat /proc/fb > "$report"
printf 'Saved %s\n' "$report"
sed -n '1,20p' "$report"
No elevated privilege is needed for this in the normal case. The shell expands $$ to the current process ID, which cuts down on collisions between short-lived reports. Remember this file is kernel-reported state, not a configuration you can edit and reload.
3. Turn the result into a script check that actually helps
For automation, test the interface first, then separately test whether it has any content. Keep those two conditions apart:
if test ! -r /proc/fb; then
printf '%s\n' 'framebuffer procfs interface unavailable' >&2
exit 2
fi
if test -s /proc/fb; then
printf '%s\n' 'framebuffer information is present'
cat /proc/fb
else
printf '%s\n' 'no framebuffer information reported'
fi
test -s only checks for a non-zero file size. It does not interpret driver names, count devices, or promise that a framebuffer is usable for any particular application, and that modest claim is far easier to keep true across kernels and hardware.
Checkpoint
Check the exit status right after running your script:
$ printf '%s\n' "$?"
0
The example above only exits with status 2 when the interface is unavailable. An available but empty report is an ordinary result, so it exits successfully. If your caller needs to treat that case differently too, add exit 1 inside the else branch, but document that your policy is stricter than the procfs interface itself.
4. Investigate missing or surprising output
First make sure you are looking at the host you think you are looking at:
$ uname -r
$ findmnt -T /proc/fb
$ stat /proc/fb
findmnt and stat are both read-only diagnostics. If findmnt cannot show a proc filesystem at all, look at how this environment is put together before drawing any conclusions. Containers, rescue systems and restricted sandboxes can all present a different view of procfs than the host kernel sees.
If the entry is absent, check the running kernel's build configuration where it is available:
config="/boot/config-$(uname -r)"
if test -r "$config"; then
grep '^CONFIG_FB=' "$config" || printf '%s\n' 'CONFIG_FB is not set in this config'
else
printf 'Kernel config is not readable at %s\n' "$config" >&2
fi
A missing configuration file is not evidence that CONFIG_FB is disabled: plenty of distributions keep configuration elsewhere, compress it, or leave it out entirely. Resist the urge to change boot parameters or bolt on a random framebuffer module just because this one file came back empty.
5. Keep the boundary clear
/proc/fb is an information interface, not a control panel. Reading it cannot select a resolution, enable a console, bind a driver, or repair a display, and it does not replace checks for DRM, a desktop session, a display server, or a particular application. Use the narrow result for the narrow question it actually answers: what framebuffer information does this running kernel expose through procfs?
There is nothing to undo here, because every command in this guide is read-only. If you saved a snapshot under /tmp, remove that one file once you have collected the evidence you needed:
rm -- "$report"
Only run that cleanup after confirming $report still names the intended file. Do not swap in a broad wildcard or an unreviewed variable.
Done means
- Tested readability of
/proc/fbbefore trying to interpret its contents. - Recorded whether the report was populated or empty.
- Split your script's logic so an unavailable interface and an available empty report are handled separately.
- Checked procfs and kernel context before blaming a graphics driver.
- Made no service, boot, device-node or kernel configuration changes.