debugfs - Linux


debugfs is a powerful tool used for debugging Linux kernel modules. It allows users to inspect and modify the internal state of loaded modules. It is primarily used by kernel developers and system administrators for diagnosing and resolving kernel issues.


debugfs [-hV] [module] [command [args]]


  • -h, –help: Display usage information.
  • -V, –version: Print version information.


Inspect a module’s symbol table:

debugfs -w /sys/kernel/debug/bluetooth/btusb

Modify a module’s parameter:

debugfs -w /sys/kernel/debug/cpuidle/cpuidle
write enable true

Dump a module’s debug messages:

debugfs -w /sys/kernel/debug/usbcore/usbcore
read msg_level

Common Issues

  • Module not loaded: Ensure that the target module is loaded and accessible before using debugfs.
  • Permission denied: You may need root privileges to access certain debugfs filesystems.


debugfs can be integrated with other commands for advanced troubleshooting. For example:

grep -r "target_string" /sys/kernel/debug/

Related Commands

  • lsmod: List loaded modules.
  • insmod: Insert a module into the kernel.
  • rmmod: Remove a module from the kernel.