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