/proc/sys/directory is different from others in
/proc/because it not only provides information about the system but also allows the system administrator to immediately enable and disable kernel features.
Use caution when changing settings on a production system using the various files in the
/proc/sys/directory. Changing the wrong setting may render the kernel unstable, requiring a system reboot.
For this reason, be sure the options are valid for that file before attempting to change any value in
A good way to determine if a particular file can be configured, or if it is only designed to provide information, is to list it with the
-loption at the shell prompt. If the file is writable, it may be used to configure the kernel. For example, a partial listing of
/proc/sys/fslooks like the following:
-r--r--r-- 1 root root 0 May 10 16:14 dentry-state -rw-r--r-- 1 root root 0 May 10 16:14 dir-notify-enable -r--r--r-- 1 root root 0 May 10 16:14 dquot-nr -rw-r--r-- 1 root root 0 May 10 16:14 file-max -r--r--r-- 1 root root 0 May 10 16:14 file-nr
In this listing, the files
file-maxcan be written to and, therefore, can be used to configure the kernel. The other files only provide feedback on current settings.
Changing a value within a
/proc/sys/file is done by echoing the new value into the file. For example, to enable the System Request Key on a running kernel, type the command:
echo 1 > /proc/sys/kernel/sysrq
This changes the value for
/proc/sys/configuration files contain more than one value. To correctly send new values to them, place a space character between each value passed with the
echocommand, such as is done in this example:
echo 4 2 45 > /proc/sys/kernel/acct
Any configuration changes made using the
echocommand disappear when the system is restarted. To make configuration changes take effect after the system is rebooted, refer to Section 5.4, “Using the
/proc/sys/directory contains several subdirectories controlling different aspects of a running kernel.
This directory provides parameters for particular devices on the system. Most systems have at least two directories,
raid/. Customized kernels can have other directories, such as
parport/, which provides the ability to share one parallel port between multiple device drivers.
cdrom/directory contains a file called
info, which reveals a number of important CD-ROM parameters:
CD-ROM information, Id: cdrom.c 3.20 2003/12/17 drive name: hdc drive speed: 48 drive # of slots: 1 Can close tray: 1 Can open tray: 1 Can lock tray: 1 Can change speed: 1 Can select disk: 0 Can read multisession: 1 Can read MCN: 1 Reports media changed: 1 Can play audio: 1 Can write CD-R: 0 Can write CD-RW: 0 Can read DVD: 0 Can write DVD-R: 0 Can write DVD-RAM: 0 Can read MRW: 0 Can write MRW: 0 Can write RAM: 0
This file can be quickly scanned to discover the qualities of an unknown CD-ROM. If multiple CD-ROMs are available on a system, each device is given its own column of information.
Various files in
/proc/sys/dev/cdrom, such as
checkmedia, can be used to control the system's CD-ROM. Use the
echocommand to enable or disable these features.
If RAID support is compiled into the kernel, a
/proc/sys/dev/raid/directory becomes available with at least two files in it:
speed_limit_max. These settings determine the acceleration of RAID devices for I/O intensive tasks, such as resyncing the disks.