Where Are sysctl Settings Stored on Linux?
sysctl.d layers /etc over /run over /usr/lib with lexical order. The dirs plus override rules.
Last updated
sysctl settings live in /etc/sysctl.d/*.conf for admin choices, /run/sysctl.d for runtime, and /usr/lib/sysctl.d for vendor packages, with legacy /etc/sysctl.conf still read. systemd-sysctl applies them at boot; the man page documents the exact precedence.
Files sort lexically across all dirs, so 99-custom.conf beats 10-default.conf anywhere. Same filename in /etc shadows the vendor twin; a symlink to /dev/null disables one. Runtime values surface under /proc/sys, writable live with sysctl -w for testing before persisting.
Where Linux sysctl stores this, by platform
/etc/sysctl.d
Admin .conf files here with two digit prefixes for order. Vendor files in /usr/lib stay untouched; shadow or null symlink them from /etc instead. Apply with sysctl --system.
Frequently asked questions
sysctl setting reverts after reboot, why
You wrote it live with sysctl -w or into a vendor file that updates replace. Persist in /etc/sysctl.d with a late sorting name and confirm with sysctl --system.
how do i disable a vendor sysctl file
Symlink /dev/null to the same filename under /etc/sysctl.d. That masks the /usr/lib twin without editing packaged files that upgrades overwrite.
Notice an outdated path? Let us know.