← Documents Documentation/ABI/testing/pstore GitHub 원문 ↗

Linux 6.18.37 · ABI / testing

Pstore persistent crash-record ABI

Platform-dependent persistent storage의 crash·panic records를 /sys/fs/pstore와 /dev/pstore에 노출하고 filename prefix, delete reclaim, kmsg_bytes target, single-backend 선택을 정의합니다.

Source pathDocumentation/ABI/testing/pstore
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

Reboot-persistent crash records

pstore:1-25

Pstore backend는 dying moments의 records를 generic interface로 보여 줍니다. Panic 때 console tail을 저장하며 dmesg prefix는 console log, mce prefix는 fatal hardware error의 architecture data를 뜻합니다.

Boot-time copy와 delete reclaim

pstore:27-36

Record를 읽은 뒤 file을 제거하면 persistent device가 공간을 재사용할 수 있습니다. Boot 직후 모든 file을 다른 곳에 저장하고 erase하는 동작이 기대됩니다.

kmsg_bytes와 backend 선택

pstore:38-47

kmsg_bytes는 oops·panic마다 저장할 target amount를 바꾸며 backend record size에 따라 적어도 target에 도달할 때까지 여러 file을 만들 수 있습니다. 기본은 10 Kbytes이고 backend는 하나만 사용합니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

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

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

Platform persistent storage의 generic interface

1-25
항목내용
What/sys/fs/pstore/... 및 /dev/pstore/...
Date2011년 3월
KernelVersion2.6.39
Contact[email protected]
DescriptionPlatform-dependent persistent storage를 위한 generic interface입니다.

System reboot 사이에 일부 data를 보존하는 mechanism을 제공하는 platform은 이 driver에 등록해 dying moments에 capture한 record를 보여 주는 generic interface를 제공할 수 있습니다. Panic의 경우 console log 마지막 부분을 capture하지만 다른 유용한 data도 저장할 수 있습니다.

# mount -t pstore -o kmsg_bytes=8000 - /sys/fs/pstore

$ ls -l /sys/fs/pstore/
total 0
-r--r--r-- 1 root root 7896 Nov 30 15:38 dmesg-erst-1

이 interface의 user가 다르면 filename prefix도 달라집니다. 현재 두 가지를 정의합니다.

Prefix의미
dmesg저장된 console log
mceFatal hardware error에서 얻은 architecture-dependent data

Persistent record 공간 회수

27-36

File의 information을 읽은 뒤 file을 제거하면 기반 persistent storage device에 공간을 나중에 재사용해도 된다는 signal을 보냅니다.

$ rm /sys/fs/pstore/dmesg-erst-1

다음 catastrophe에 대비해 공간을 비우도록 /sys/fs/pstore/의 모든 file은 boot 직후 다른 곳에 저장하고 persistent store에서 erase할 것으로 기대합니다.

Pstore 저장량과 backend

38-47

kmsg_bytes mount option은 각 oops/panic에서 저장하는 target data 양을 바꿉니다. Pstore는 기반 persistent storage의 record size를 기준으로 적어도 이 양에 도달할 때까지 file을 하나 또는 여러 개 저장합니다. 기본값은 10 Kbytes입니다.

Pstore는 한 번에 backend 하나만 지원합니다. 여러 backend를 사용할 수 있다면 boot 때 kernel에 pstore.backend= argument를 전달해 선호 backend를 설정할 수 있습니다.

Pstore crash record lifecycle
Oops or panicCapture console tail or architecture dataPersistent backend recordsSurvive reboot
Mount pstoreRead dmesg-* or mce-* filesSave records elsewhereRemove pstore filesBackend reclaims space
kmsg_bytes target, default 10 KbytesBackend record sizeOne or multiple files until at least target
Multiple available backendspstore.backend= boot argumentExactly one active backend

Backend가 crash record를 reboot 사이에 보존하고 boot userspace가 이를 archive한 뒤 file delete로 storage를 회수한다.