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