xref: /OK3568_Linux_fs/kernel/Documentation/ABI/testing/pstore (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunWhat:		/sys/fs/pstore/... (or /dev/pstore/...)
2*4882a593SmuzhiyunDate:		March 2011
3*4882a593SmuzhiyunKernelVersion: 2.6.39
4*4882a593SmuzhiyunContact:	tony.luck@intel.com
5*4882a593SmuzhiyunDescription:	Generic interface to platform dependent persistent storage.
6*4882a593Smuzhiyun
7*4882a593Smuzhiyun		Platforms that provide a mechanism to preserve some data
8*4882a593Smuzhiyun		across system reboots can register with this driver to
9*4882a593Smuzhiyun		provide a generic interface to show records captured in
10*4882a593Smuzhiyun		the dying moments.  In the case of a panic the last part
11*4882a593Smuzhiyun		of the console log is captured, but other interesting
12*4882a593Smuzhiyun		data can also be saved::
13*4882a593Smuzhiyun
14*4882a593Smuzhiyun		    # mount -t pstore -o kmsg_bytes=8000 - /sys/fs/pstore
15*4882a593Smuzhiyun
16*4882a593Smuzhiyun		    $ ls -l /sys/fs/pstore/
17*4882a593Smuzhiyun		    total 0
18*4882a593Smuzhiyun		    -r--r--r-- 1 root root 7896 Nov 30 15:38 dmesg-erst-1
19*4882a593Smuzhiyun
20*4882a593Smuzhiyun		Different users of this interface will result in different
21*4882a593Smuzhiyun		filename prefixes.  Currently two are defined:
22*4882a593Smuzhiyun
23*4882a593Smuzhiyun		- "dmesg" - saved console log
24*4882a593Smuzhiyun		- "mce"   - architecture dependent data from fatal h/w error
25*4882a593Smuzhiyun
26*4882a593Smuzhiyun		Once the information in a file has been read, removing
27*4882a593Smuzhiyun		the file will signal to the underlying persistent storage
28*4882a593Smuzhiyun		device that it can reclaim the space for later re-use::
29*4882a593Smuzhiyun
30*4882a593Smuzhiyun		    $ rm /sys/fs/pstore/dmesg-erst-1
31*4882a593Smuzhiyun
32*4882a593Smuzhiyun		The expectation is that all files in /sys/fs/pstore/
33*4882a593Smuzhiyun		will be saved elsewhere and erased from persistent store
34*4882a593Smuzhiyun		soon after boot to free up space ready for the next
35*4882a593Smuzhiyun		catastrophe.
36*4882a593Smuzhiyun
37*4882a593Smuzhiyun		The 'kmsg_bytes' mount option changes the target amount of
38*4882a593Smuzhiyun		data saved on each oops/panic. Pstore saves (possibly
39*4882a593Smuzhiyun		multiple) files based on the record size of the underlying
40*4882a593Smuzhiyun		persistent storage until at least this amount is reached.
41*4882a593Smuzhiyun		Default is 10 Kbytes.
42*4882a593Smuzhiyun
43*4882a593Smuzhiyun		Pstore only supports one backend at a time. If multiple
44*4882a593Smuzhiyun		backends are available, the preferred backend may be
45*4882a593Smuzhiyun		set by passing the pstore.backend= argument to the kernel at
46*4882a593Smuzhiyun		boot time.
47