IT 공부내용 정리/Linux

터미널 명령어 - fsck / e2fsck 파일 시스템을 검사하고 싶을 때

따뜻한 차가움 2025. 3. 31. 10:12

사용 버전 : Linux 우분투(레드햇 계열) 24.04.01 LTS 버전
사용한 시스템 지역/언어 : 대한민국/한글

man fsck 원문

더보기

FSCK(8)                      System Administration                     FSCK(8)

NAME
       fsck - check and repair a Linux filesystem

SYNOPSIS
       fsck [-lsAVRTMNP] [-r [fd]] [-C [fd]] [-t fstype] [filesystem...] [--]
       [fs-specific-options]

DESCRIPTION
       fsck is used to check and optionally repair one or more Linux
       filesystems. filesystem can be a device name (e.g., /dev/hdc1,
       /dev/sdb2), a mount point (e.g., /, /usr, /home), or a filesystem label
       or UUID specifier (e.g., UUID=8868abf6-88c5-4a83-98b8-bfc24057f7bd or
       LABEL=root). Normally, the fsck program will try to handle filesystems
       on different physical disk drives in parallel to reduce the total
       amount of time needed to check all of them.

       If no filesystems are specified on the command line, and the -A option
       is not specified, fsck will default to checking filesystems in
       /etc/fstab serially. This is equivalent to the -As options.

       The exit status returned by fsck is the sum of the following
       conditions:

       0
           No errors

       1
           Filesystem errors corrected

       2
           System should be rebooted

       4
           Filesystem errors left uncorrected

       8
           Operational error

       16
           Usage or syntax error

       32
           Checking canceled by user request

       128
           Shared-library error

       The exit status returned when multiple filesystems are checked is the
       bit-wise OR of the exit statuses for each filesystem that is checked.

       In actuality, fsck is simply a front-end for the various filesystem
       checkers (fsck.fstype) available under Linux. The filesystem-specific
       checker is searched for in the PATH environment variable. If the PATH
       is undefined then fallback to /sbin.

       Please see the filesystem-specific checker manual pages for further
       details.

OPTIONS
       -l
           Create an exclusive flock(2) lock file (/run/fsck/<diskname>.lock)
           for whole-disk device. This option can be used with one device only
           (this means that -A and -l are mutually exclusive). This option is
           recommended when more fsck instances are executed in the same time.
           The option is ignored when used for multiple devices or for
           non-rotating disks. fsck does not lock underlying devices when
           executed to check stacked devices (e.g. MD or DM) - this feature is
           not implemented yet.

       -r [fd]
           Report certain statistics for each fsck when it completes. These
           statistics include the exit status, the maximum run set size (in
           kilobytes), the elapsed all-clock time and the user and system CPU
           time used by the fsck run. For example:

           /dev/sda1: status 0, rss 92828, real 4.002804, user 2.677592, sys
           0.86186

           GUI front-ends may specify a file descriptor fd, in which case the
           progress bar information will be sent to that file descriptor in a
           machine parsable format. For example:

           /dev/sda1 0 92828 4.002804 2.677592 0.86186

       -s
           Serialize fsck operations. This is a good idea if you are checking
           multiple filesystems and the checkers are in an interactive mode.
           (Note: e2fsck(8) runs in an interactive mode by default. To make
           e2fsck(8) run in a non-interactive mode, you must either specify
           the -p or -a option, if you wish for errors to be corrected
           automatically, or the -n option if you do not.)

       -t fslist
           Specifies the type(s) of filesystem to be checked. When the -A flag
           is specified, only filesystems that match fslist are checked. The
           fslist parameter is a comma-separated list of filesystems and
           options specifiers. All of the filesystems in this comma-separated
           list may be prefixed by a negation operator 'no' or '!', which
           requests that only those filesystems not listed in fslist will be
           checked. If none of the filesystems in fslist is prefixed by a
           negation operator, then only those listed filesystems will be
           checked.

           Options specifiers may be included in the comma-separated fslist.
           They must have the format opts=fs-option. If an options specifier
           is present, then only filesystems which contain fs-option in their
           mount options field of /etc/fstab will be checked. If the options
           specifier is prefixed by a negation operator, then only those
           filesystems that do not have fs-option in their mount options field
           of /etc/fstab will be checked.

           For example, if opts=ro appears in fslist, then only filesystems
           listed in /etc/fstab with the ro option will be checked.

           For compatibility with Mandrake distributions whose boot scripts
           depend upon an unauthorized UI change to the fsck program, if a
           filesystem type of loop is found in fslist, it is treated as if
           opts=loop were specified as an argument to the -t option.

           Normally, the filesystem type is deduced by searching for filesys
           in the /etc/fstab file and using the corresponding entry. If the
           type cannot be deduced, and there is only a single filesystem given
           as an argument to the -t option, fsck will use the specified
           filesystem type. If this type is not available, then the default
           filesystem type (currently ext2) is used.

       -A
           Walk through the /etc/fstab file and try to check all filesystems
           in one run. This option is typically used from the /etc/rc system
           initialization file, instead of multiple commands for checking a
           single filesystem.

           The root filesystem will be checked first unless the -P option is
           specified (see below). After that, filesystems will be checked in
           the order specified by the fs_passno (the sixth) field in the
           /etc/fstab file. Filesystems with a fs_passno value of 0 are
           skipped and are not checked at all. Filesystems with a fs_passno
           value of greater than zero will be checked in order, with
           filesystems with the lowest fs_passno number being checked first.
           If there are multiple filesystems with the same pass number, fsck
           will attempt to check them in parallel, although it will avoid
           running multiple filesystem checks on the same physical disk.

           fsck does not check stacked devices (RAIDs, dm-crypt, ...) in
           parallel with any other device. See below for
           FSCK_FORCE_ALL_PARALLEL setting. The /sys filesystem is used to
           determine dependencies between devices.

           Hence, a very common configuration in /etc/fstab files is to set
           the root filesystem to have a fs_passno value of 1 and to set all
           other filesystems to have a fs_passno value of 2. This will allow
           fsck to automatically run filesystem checkers in parallel if it is
           advantageous to do so. System administrators might choose not to
           use this configuration if they need to avoid multiple filesystem
           checks running in parallel for some reason - for example, if the
           machine in question is short on memory so that excessive paging is
           a concern.

           fsck normally does not check whether the device actually exists
           before calling a filesystem specific checker. Therefore
           non-existing devices may cause the system to enter filesystem
           repair mode during boot if the filesystem specific checker returns
           a fatal error. The /etc/fstab mount option nofail may be used to
           have fsck skip non-existing devices. fsck also skips non-existing
           devices that have the special filesystem type auto.

       -C [fd]
           Display completion/progress bars for those filesystem checkers
           (currently only for ext[234]) which support them. fsck will manage
           the filesystem checkers so that only one of them will display a
           progress bar at a time. GUI front-ends may specify a file
           descriptor fd, in which case the progress bar information will be
           sent to that file descriptor.

       -M
           Do not check mounted filesystems and return an exit status of 0 for
           mounted filesystems.

       -N
           Don’t execute, just show what would be done.

       -P
           When the -A flag is set, check the root filesystem in parallel with
           the other filesystems. This is not the safest thing in the world to
           do, since if the root filesystem is in doubt things like the
           e2fsck(8) executable might be corrupted! This option is mainly
           provided for those sysadmins who don’t want to repartition the root
           filesystem to be small and compact (which is really the right
           solution).

       -R
           When checking all filesystems with the -A flag, skip the root
           filesystem. (This is useful in case the root filesystem has already
           been mounted read-write.)

       -T
           Don’t show the title on startup.

       -V
           Produce verbose output, including all filesystem-specific commands
           that are executed.

       -?, --help
           Display help text and exit.

       --version
           Display version information and exit.

FILESYSTEM SPECIFIC OPTIONS
       Options which are not understood by fsck are passed to the
       filesystem-specific checker!

       These options must not take arguments, as there is no way for fsck to
       be able to properly guess which options take arguments and which don’t.

       Options and arguments which follow the -- are treated as
       filesystem-specific options to be passed to the filesystem-specific
       checker.

       Please note that fsck is not designed to pass arbitrarily complicated
       options to filesystem-specific checkers. If you’re doing something
       complicated, please just execute the filesystem-specific checker
       directly. If you pass fsck some horribly complicated options and
       arguments, and it doesn’t do what you expect, don’t bother reporting it
       as a bug. You’re almost certainly doing something that you shouldn’t be
       doing with fsck. Options to different filesystem-specific fsck’s are
       not standardized.

ENVIRONMENT
       The fsck program’s behavior is affected by the following environment
       variables:

       FSCK_FORCE_ALL_PARALLEL
           If this environment variable is set, fsck will attempt to check all
           of the specified filesystems in parallel, regardless of whether the
           filesystems appear to be on the same device. (This is useful for
           RAID systems or high-end storage systems such as those sold by
           companies such as IBM or EMC.) Note that the fs_passno value is
           still used.

       FSCK_MAX_INST
           This environment variable will limit the maximum number of
           filesystem checkers that can be running at one time. This allows
           configurations which have a large number of disks to avoid fsck
           starting too many filesystem checkers at once, which might overload
           CPU and memory resources available on the system. If this value is
           zero, then an unlimited number of processes can be spawned. This is
           currently the default, but future versions of fsck may attempt to
           automatically determine how many filesystem checks can be run based
           on gathering accounting data from the operating system.

       PATH
           The PATH environment variable is used to find filesystem checkers.

       FSTAB_FILE
           This environment variable allows the system administrator to
           override the standard location of the /etc/fstab file. It is also
           useful for developers who are testing fsck.

       LIBBLKID_DEBUG=all
           enables libblkid debug output.

       LIBMOUNT_DEBUG=all
           enables libmount debug output.

FILES
       /etc/fstab

AUTHORS
       Theodore Ts’o <tytso@mit.edu>>, Karel Zak <kzak@redhat.com>

SEE ALSO
       fstab(5), mkfs(8), fsck.ext2(8) or fsck.ext3(8) or e2fsck(8),
       fsck.cramfs(8), fsck.jfs(8), fsck.nfs(8), fsck.minix(8), fsck.msdos(8),
       fsck.vfat(8), fsck.xfs(8), reiserfsck(8)

REPORTING BUGS
       For bug reports, use the issue tracker at
       https://github.com/util-linux/util-linux/issues.

AVAILABILITY
       The fsck command is part of the util-linux package which can be
       downloaded from Linux Kernel Archive
       <https://www.kernel.org/pub/linux/utils/util-linux/>.

util-linux 2.39.3                 2023-11-21                           FSCK(8)

man fsck 번역기 번역본

더보기

FSCK (8) 시스템 관리 FSCK (8)

이름
       FSCK- Linux 파일 시스템을 점검하고 수리하십시오

개요
       fsck [-lsavrtmnp] [-r [fd]] [-c [fd]] [-t fstype] [FileSystem ...] [-]
       [FS- 특이 적 옵션]

설명
       FSCK는 하나 이상의 Linux를 확인하고 선택적으로 수리하는 데 사용됩니다.
       파일 시스템. 파일 시스템은 장치 이름 (예 : /dev /hdc1,
       /dev /sdb2), 마운트 포인트 (예 : /, /usr, /home) 또는 파일 시스템 레이블
       또는 UUID 지정자 (예 : UUID = 8868ABF6-88C5-4A83-98B8-BFC24057F7BD 또는
       레이블 = 루트). 일반적으로 FSCK 프로그램은 파일 시스템을 처리하려고합니다
       다른 물리 디스크에서 총계를 줄이기 위해 병렬로 드라이브
       그들 모두를 확인하는 데 필요한 시간.

명령 줄에 파일 시스템이 지정되지 않은 경우 -A 옵션
       지정되지 않으면 FSCK는 파일 시스템을 확인하는 데 기본값이됩니다.
       /etc/fstab 일련의. 이것은 옵션과 동일합니다.

FSCK에 의해 반환 된 종료 상태는 다음의 합입니다.
       정황:

0
           오류가 없습니다

1
           파일 시스템 오류가 수정되었습니다

2
           시스템을 재부팅해야합니다

4
           파일 시스템 오류는 수정되지 않은 상태로 남았습니다

8
           작동 오류

16
           사용 또는 구문 오류

32
           사용자 요청으로 취소 확인

128
           공유 라이브러리 오류

여러 파일 시스템이 확인되면 종료 상태가
       확인 된 각 파일 시스템의 비트 현행 또는 출구 상태.

실제로, FSCK는 단순히 다양한 파일 시스템의 프론트 엔드입니다.
       Linux에서 사용할 수있는 Checkers (FSCK.FSTYPE). 파일 시스템 별
       체커는 경로 환경 변수에서 검색됩니다. 길이라면
       정의되지 않은 다음 /sbin 로의 폴백입니다.

자세한 내용은 파일 시스템 별 체커 매뉴얼 페이지를 참조하십시오
       세부.

옵션
       -엘
           독점 플록 생성 (2) 잠금 파일 (/run/fsck/<DiskName> .Lock)
           전체 디스크 장치의 경우. 이 옵션은 하나의 장치에서만 사용할 수 있습니다
           (이것은 -a와 -l이 상호 배타적이라는 것을 의미합니다). 이 옵션은입니다
           더 많은 FSCK 인스턴스가 동시에 실행될 때 권장됩니다.
           옵션은 여러 장치에 사용될 때 또는
           비 회전 디스크. FSCK는 언제 기본 장치를 잠그지 않습니다
           스택 된 장치 (예 : MD 또는 DM)를 확인하기 위해 실행 -이 기능은 다음과 같습니다.
           아직 구현되지 않았습니다.

-R [FD]
           완료되면 각 FSCK에 대한 특정 통계를보고하십시오. 이것들
           통계에는 출구 상태, 최대 실행 세트 크기가 포함됩니다 (
           Kilobytes), 경과 된 모든 클록 시간 및 사용자 및 시스템 CPU
           FSCK 실행에 사용되는 시간. 예를 들어:

/dev/sda1 : 상태 0, RSS 92828, Real 4.002804, 사용자 2.677592, SYS
           0.86186

GUI 프론트 엔드는 파일 디스크립터 FD를 지정할 수 있으며,이 경우
           진행률 바 정보는 해당 파일 디스크립터로 전송됩니다.
           기계 구문 분석 형식. 예를 들어:

/dev/sda1 0 92828 4.002804 2.677592 0.86186

-에스
           FSCK 작업 직렬화. 확인하는 경우 좋은 생각입니다
           다중 파일 시스템과 체커는 대화식 모드입니다.
           (참고 : E2FSCK (8)는 기본적으로 대화식 모드로 실행됩니다.
           E2FSCK (8) 비 결과 모드에서 실행되면 지정해야합니다.
           오류를 수정하려는 경우 -p 또는 -a 옵션
           그렇지 않은 경우 자동 또는 -N 옵션.)

-t fslist
           확인할 파일 시스템의 유형을 지정합니다. -a 깃발 일 때
           지정되며 FSLIST와 일치하는 파일 시스템 만 확인됩니다. 그만큼
           FSList 매개 변수는 파일 시스템의 쉼표로 구분 된 목록입니다
           옵션 지정자. 이 쉼표로 분리 된 모든 파일 시스템이 분리되었습니다
           목록은 부정 연산자 'no'또는 '!'에 의해 접두사를 할 수 있습니다.
           FSLIST에 나열되지 않은 해당 파일 시스템 만
           확인. FSLIST의 파일 시스템 중 어느 것도
           부정 연산자, 그러면 나열된 파일 시스템 만 있습니다
           확인.

옵션 지정자는 쉼표로 구분 된 FSLIST에 포함될 수 있습니다.
           형식 opts = fs-option이 있어야합니다. 옵션 지정자 인 경우
           존재하는 다음 FS-Option을 포함하는 파일 시스템 만
           /etc /fstab의 마운트 옵션 필드가 확인됩니다. 옵션 인 경우
           Specifier
           마운트 옵션 필드에 FS-Option이없는 파일 시스템
           /etc /fstab의 확인이 확인됩니다.

예를 들어, opts = ro가 fslist에 나타나면 파일 시스템 만
           RO 옵션을 사용하여 /etc /fstab에 나열되어 있습니다.

부팅 스크립트의 Mandrake 분포와의 호환성
           FSCK 프로그램에 대한 무단 UI 변경에 의존합니다.
           FileSystem 유형의 루프는 FSLIST에서 발견되며 마치 마치 처리됩니다.
           opts = 루프는 -t 옵션에 대한 인수로 지정되었습니다.

일반적으로 파일 시스템 유형은 filesys를 검색하여 추론됩니다.
           /etc /fstab 파일에서 해당 항목을 사용합니다. 만약
           유형은 추론 할 수 없으며 단일 파일 시스템 만 있습니다.
           -t 옵션에 대한 인수로 FSCK는 지정된 것을 사용합니다.
           파일 시스템 유형. 이 유형을 사용할 수 없으면 기본값이 있습니다
           파일 시스템 유형 (현재 ext2)이 사용됩니다.

-에이
           /etc /fstab 파일을 통과하고 모든 파일 시스템을 확인하십시오.
           한 번에. 이 옵션은 일반적으로 /etc /rc 시스템에서 사용됩니다
           확인을위한 여러 명령 대신 초기화 파일을 확인합니다
           단일 파일 시스템.

-P 옵션이없는 한 루트 파일 시스템은 먼저 확인됩니다.
           지정 (아래 참조). 그 후 파일 시스템이 체크인됩니다
           FS_Passno (여섯 번째) 필드에서 지정된 순서
           /etc/fstab 파일. fs_passno 값이 0 인 파일 시스템은입니다
           건너 뛰고 전혀 점검하지 않습니다. fs_passno가있는 파일 시스템
           0보다 큰 값은 순서대로 확인됩니다.
           FS_Passno 번호가 가장 낮은 파일 시스템은 먼저 확인됩니다.
           패스 번호가 동일한 여러 파일 시스템이있는 경우 FSCK
           피할 수는 있지만 동시에 확인하려고 시도합니다.
           동일한 물리 디스크에서 여러 파일 시스템 검사를 실행합니다.

FSCK는 쌓인 장치 (Raids, DM-Crypt, ...)를 확인하지 않습니다.
           다른 장치와 평행합니다. 아래를 참조하십시오
           fsck_force_all_parallel 설정. /sys 파일 시스템은 사용됩니다
           장치 간의 종속성을 결정합니다.

따라서 /etc /fstab 파일의 매우 일반적인 구성은
           fs_passno 값 1을 갖고 모든 것을 설정하는 루트 파일 시스템
           FS_Passno 값이 2의 다른 파일 시스템.
           FSCK는 파일 시스템 검사기를 자동으로 실행하는 경우
           그렇게하는 것이 유리합니다. 시스템 관리자는 선택하지 않을 수 있습니다
           여러 파일 시스템을 피해야하는 경우이 구성을 사용하십시오.
           어떤 이유로 든 병렬로 실행되는 확인 - 예를 들어,
           문제의 기계는 메모리가 부족하여 과도한 페이징이
           우려.

FSCK는 일반적으로 장치가 실제로 존재하는지 확인하지 않습니다.
           파일 시스템 특정 검사기를 호출하기 전에. 그러므로
           존재하지 않는 장치로 인해 시스템이 파일 시스템에 들어갈 수 있습니다
           파일 시스템 특정 검사기가 반환되는 경우 부팅 중 수리 모드
           치명적인 오류. /etc /fstab 마운트 옵션 nofail이 사용될 수 있습니다
           FSCK가 존재하지 않는 장치를 건너 뛰십시오. FSCK는 또한 존재하지 않는 건너 뜁니다
           특수 파일 시스템 유형 자동이있는 장치.

-C [FD]
           해당 파일 시스템 검사기에 대한 완료/진행 막대를 표시합니다
           (현재 Ext [234]에 대해서만). FSCK가 관리합니다
           파일 시스템 검사기는 그 중 하나만이
           한 번에 진행률 바. GUI 프론트 엔드는 파일을 지정할 수 있습니다
           디스크립터 FD,이 경우 진행률 표시 줄 정보는
           해당 파일 디스크립터로 전송되었습니다.

-중
           장착 파일 시스템을 확인하지 말고 0의 종료 상태를 반환하십시오.
           장착 파일 시스템.

-N
           실행하지 말고 수행 할 작업을 보여주십시오.

-피
           -A 플래그가 설정되면 루트 파일 시스템을 병렬로 확인하십시오.
           다른 파일 시스템. 이것은 세상에서 가장 안전한 것이 아닙니다.
           루트 파일 시스템이 의심되는 경우
           E2FSCK (8) 실행 파일이 손상 될 수 있습니다! 이 옵션은 주로입니다
           뿌리를 반복하고 싶지 않은 Sysadmins에게 제공
           FileSystem은 작고 컴팩트해야합니다 (실제로 옳습니다.
           해결책).

-아르 자형
           -A 플래그로 모든 파일 시스템을 확인할 때 루트를 건너 뜁니다.
           파일 시스템. (루트 파일 시스템이 이미
           읽기 쓰기가 장착되었습니다.)

-티
           스타트 업에 제목을 표시하지 마십시오.

-다섯
           모든 파일 시스템 별 명령을 포함하여 장점 출력을 생성합니다
           실행됩니다.

-?, --돕다
           도움말 텍스트와 종료를 표시합니다.

--버전
           버전 정보 및 종료.

파일 시스템 특정 옵션
       FSCK가 이해하지 못하는 옵션은
       파일 시스템 별 검사기!

FSCK가
       어떤 옵션이 논쟁을 취하고 그렇지 않은지 제대로 추측 할 수 있습니다.

다음을 따르는 옵션과 주장은 다음과 같이 취급됩니다.
       파일 시스템 별 옵션을 파일 시스템별로 전달합니다
       체커.

FSCK는 임의로 복잡한 통과로 설계되지 않았습니다.
       파일 시스템 별 체커에 대한 옵션. 당신이 뭔가를하고 있다면
       복잡한 경우 파일 시스템 별 검사기를 실행하십시오
       곧장. FSCK를 통과하면 끔찍한 복잡한 옵션과
       논쟁, 그리고 그것은 당신이 기대하는 것을하지 않고보고하지 마십시오.
       버그로. 당신은 거의 확실하지 않은 일을하고 있습니다
       FSCK와 함께. 다른 파일 시스템 별 FSCK에 대한 옵션
       표준화되지 않았습니다.

환경
       FSCK 프로그램의 행동은 다음 환경의 영향을받습니다.
       변수 :

FSCK_FORCE_ALL_PARALLEL
           이 환경 변수가 설정되면 FSCK는 모든 것을 확인하려고합니다.
           지정된 파일 시스템의
           파일 시스템은 동일한 장치에있는 것으로 보입니다. (이것은 유용합니다
           RAID 시스템 또는 고급 스토리지 시스템과 같은 고급 스토리지 시스템
           IBM 또는 EMC와 같은 회사) FS_Passno 값은 다음과 같습니다.
           여전히 사용됩니다.

fsck_max_inst
           이 환경 변수는 최대 수를 제한합니다
           한 번에 실행할 수있는 파일 시스템 검사기. 이것은 허용합니다
           FSCK를 피하기 위해 많은 수의 디스크가있는 구성
           너무 많은 파일 시스템 검사기를 한 번에 시작하여 과부하 할 수 있습니다.
           시스템에서 사용 가능한 CPU 및 메모리 리소스. 이 값이라면
           제로, 그런 다음 무제한 수의 프로세스를 스폰 할 수 있습니다. 이것은
           현재 기본값이지만 미래 버전의 FSCK는
           얼마나 많은 파일 시스템 검사를 기준으로 실행할 수 있는지 자동으로 결정하십시오.
           운영 체제에서 회계 데이터 수집.


           경로 환경 변수는 파일 시스템 검사기를 찾는 데 사용됩니다.

fstab_file
           이 환경 변수를 사용하면 시스템 관리자가 가능합니다
           /etc /fstab 파일의 표준 위치를 무시하십시오. 그것은 또한
           FSCK를 테스트하는 개발자에게 유용합니다.

libblkid_debug = 모두
           libblkid 디버그 출력을 활성화합니다.

libmount_debug = 모두
           libmount 디버그 출력을 활성화합니다.

파일
       /etc/fstab

저자
       Theodore ts'o <tytso@mit.edu >>, karel zak <kzak@redhat.com>

참조하십시오
       FSTAB (5), MKFS (8), FSCK.EXT2 (8) 또는 FSCK.EXT3 (8) 또는 E2FSCK (8),
       fsck.cramfs (8), fsck.jfs (8), fsck.nfs (8), fsck.minix (8), fsck.msdos (8),
       FSCK.VFAT (8), FSCK.XFS (8), ReiserFSCK (8)

보고 버그
       버그 보고서는 문제 추적기를 사용하십시오
       https://github.com/util-linux/util-linux/issues.

유효성
       FSCK 명령은 Util-Linux 패키지의 일부입니다.
       Linux 커널 아카이브에서 다운로드했습니다
       <https://www.kernel.org/pub/linux/utils/util-linux/>.

Util-Linux 2.39.3 2023-11-21 FSCCK (8)

 

man e2fsck 원문

더보기

E2FSCK(8)                   System Manager's Manual                  E2FSCK(8)

NAME
       e2fsck - check a Linux ext2/ext3/ext4 file system

SYNOPSIS
       e2fsck  [  -pacnyrdfkvtDFV ] [ -b superblock ] [ -B blocksize ] [ -l|-L
       bad_blocks_file ] [ -C fd ] [ -j external-journal ] [  -E  extended_op‐
       tions ] [ -z undo_file ] device

DESCRIPTION
       e2fsck is used to check the ext2/ext3/ext4 family of file systems.  For
       ext3  and  ext4 file systems that use a journal, if the system has been
       shut down uncleanly without any errors, normally, after  replaying  the
       committed  transactions   in  the  journal,  the  file system should be
       marked as clean.   Hence, for file systems that use journaling,  e2fsck
       will  normally replay the journal and exit, unless its superblock indi‐
       cates that further checking is required.

       device is a block device (e.g., /dev/sdc1) or file containing the  file
       system.

       Note  that in general it is not safe to run e2fsck on mounted file sys‐
       tems.  The only exception is if the -n option is specified, and -c, -l,
       or -L options are not specified.   However, even if it is  safe  to  do
       so,  the  results printed by e2fsck are not valid if the file system is
       mounted.   If e2fsck asks whether or not you should check a file system
       which is mounted, the only correct answer is ``no''.  Only experts  who
       really know what they are doing should consider answering this question
       in any other way.

       If  e2fsck  is run in interactive mode (meaning that none of -y, -n, or
       -p are specified), the program will ask the user to  fix  each  problem
       found  in  the  file system.  A response of 'y' will fix the error; 'n'
       will leave the error unfixed; and 'a' will fix the problem and all sub‐
       sequent problems; pressing Enter will  proceed  with  the  default  re‐
       sponse,  which is printed before the question mark.  Pressing Control-C
       terminates e2fsck immediately.

OPTIONS
       -a     This option does the same thing as the -p option.   It  is  pro‐
              vided  for  backwards  compatibility  only; it is suggested that
              people use -p option whenever possible.

       -b superblock
              Instead of using the normal superblock, use an  alternative  su‐
              perblock  specified by superblock.  This option is normally used
              when the primary superblock has been corrupted.  The location of
              backup superblocks is dependent on the file system's  blocksize,
              the  number of blocks per group, and features such as sparse_su‐
              per.

              Additional backup superblocks can be  determined  by  using  the
              mke2fs  program  using  the -n option to print out where the su‐
              perblocks exist, supposing mke2fs  is  supplied  with  arguments
              that  are  consistent with the file system's layout (e.g. block‐
              size, blocks per group, sparse_super, etc.).

              If an alternative superblock is specified and the file system is
              not opened read-only, e2fsck will make sure that the primary su‐
              perblock is updated appropriately upon completion  of  the  file
              system check.

       -B blocksize
              Normally,  e2fsck will search for the superblock at various dif‐
              ferent block sizes in an attempt to find the  appropriate  block
              size.   This  search  can  be fooled in some cases.  This option
              forces e2fsck to only try locating the superblock at a  particu‐
              lar blocksize.  If the superblock is not found, e2fsck will ter‐
              minate with a fatal error.

       -c     This  option  causes  e2fsck to use badblocks(8) program to do a
              read-only scan of the device in order to find  any  bad  blocks.
              If any bad blocks are found, they are added to the bad block in‐
              ode to prevent them from being allocated to a file or directory.
              If  this option is specified twice, then the bad block scan will
              be done using a non-destructive read-write test.

       -C fd  This option causes e2fsck to write completion information to the
              specified file descriptor so that the progress of the file  sys‐
              tem  check  can  be monitored.  This option is typically used by
              programs which are running e2fsck.  If the file descriptor  num‐
              ber is negative, then absolute value of the file descriptor will
              be  used,  and  the progress information will be suppressed ini‐
              tially.  It can later be enabled by sending the e2fsck process a
              SIGUSR1 signal.  If the file descriptor specified is  0,  e2fsck
              will print a completion bar as it goes about its business.  This
              requires that e2fsck is running on a video console or terminal.

       -d     Print   debugging  output  (useless  unless  you  are  debugging
              e2fsck).

       -D     Optimize directories in file system.  This option causes  e2fsck
              to  try  to optimize all directories, either by re-indexing them
              if the file system supports directory indexing,  or  by  sorting
              and compressing directories for smaller directories, or for file
              systems using traditional linear directories.

              Even  without the -D option, e2fsck may sometimes optimize a few
              directories --- for example, if directory  indexing  is  enabled
              and  a directory is not indexed and would benefit from being in‐
              dexed, or if the index structures are corrupted and need  to  be
              rebuilt.   The -D option forces all directories in the file sys‐
              tem to be optimized.  This can  sometimes  make  them  a  little
              smaller  and  slightly  faster  to  search, but in practice, you
              should rarely need to use this option.

              The -D option will detect directory entries with duplicate names
              in a single directory, which e2fsck normally  does  not  enforce
              for performance reasons.

       -E extended_options
              Set  e2fsck  extended options.  Extended options are comma sepa‐
              rated, and may take an argument using  the  equals  ('=')  sign.
              The following options are supported:

                   ea_ver=extended_attribute_version
                          Set  the  version  of  the extended attribute blocks
                          which e2fsck will require while  checking  the  file
                          system.   The version number may be 1 or 2.  The de‐
                          fault extended attribute version format is 2.

                   journal_only
                          Only replay the journal if required, but do not per‐
                          form any further checks or repairs.

                   fragcheck
                          During pass 1, print a detailed report of  any  dis‐
                          contiguous blocks for files in the file system.

                   discard
                          Attempt  to  discard  free  blocks  and unused inode
                          blocks after the full file system check  (discarding
                          blocks is useful on solid state devices and sparse /
                          thin-provisioned storage). Note that discard is done
                          in  pass  5  AFTER  the  file  system has been fully
                          checked and only if it does not contain recognizable
                          errors. However there might be  cases  where  e2fsck
                          does not fully recognize a problem and hence in this
                          case this option may prevent you from further manual
                          data recovery.

                   nodiscard
                          Do not attempt to discard free blocks and unused in‐
                          ode  blocks.  This option is exactly the opposite of
                          discard option. This is set as default.

                   no_optimize_extents
                          Do not offer to optimize the extent tree  by  elimi‐
                          nating unnecessary width or depth.  This can also be
                          enabled in the options section of /etc/e2fsck.conf.

                   optimize_extents
                          Offer to optimize the extent tree by eliminating un‐
                          necessary  width  or depth.  This is the default un‐
                          less otherwise specified in /etc/e2fsck.conf.

                   inode_count_fullmap
                          Trade off using memory for  speed  when  checking  a
                          file  system  with  a  large  number  of hard-linked
                          files.  The amount of  memory  required  is  propor‐
                          tional  to  the number of inodes in the file system.
                          For large file systems, this  can  be  gigabytes  of
                          memory.   (For  example, a 40TB file system with 2.8
                          billion inodes will consume  an  additional  5.7  GB
                          memory if this optimization is enabled.)  This opti‐
                          mization  can also be enabled in the options section
                          of /etc/e2fsck.conf.

                   no_inode_count_fullmap
                          Disable the inode_count_fullmap optimization.   This
                          is   the   default  unless  otherwise  specified  in
                          /etc/e2fsck.conf.

                   readahead_kb
                          Use this many KiB of memory to pre-fetch metadata in
                          the hopes of reducing e2fsck runtime.   By  default,
                          this  is  set to the size of two block groups' inode
                          tables (typically 4MiB on a regular ext4  file  sys‐
                          tem);  if  this  amount is more than 1/50th of total
                          physical memory, readahead is disabled.  Set this to
                          zero to disable readahead entirely.

                   bmap2extent
                          Convert block-mapped files to extent-mapped files.

                   fixes_only
                          Only fix damaged metadata; do not optimize htree di‐
                          rectories or compress extent trees.  This option  is
                          incompatible with the -D and -E bmap2extent options.

                   check_encoding
                          Force  verification of encoded filenames in case-in‐
                          sensitive directories.  This is the default mode  if
                          the file system has the strict flag enabled.

                   unshare_blocks
                          If  the  file  system  has  shared  blocks, with the
                          shared blocks read-only feature enabled,  then  this
                          will  unshare  all shared blocks and unset the read-
                          only feature bit. If there is not enough free  space
                          then  the  operation  will fail.  If the file system
                          does not have the read-only  feature  bit,  but  has
                          shared  blocks anyway, then this option will have no
                          effect. Note when using this option, if there is  no
                          free  space  to  clone blocks, there is no prompt to
                          delete files and instead the operation will fail.

                          Note that unshare_blocks implies the "-f" option  to
                          ensure  that  all  passes  are run. Additionally, if
                          "-n" is also specified, e2fsck will simulate  trying
                          to  allocate  enough  space  to deduplicate. If this
                          fails, the exit code will be non-zero.

       -f     Force checking even if the file system seems clean.

       -F     Flush the file system device's buffer caches  before  beginning.
              Only really useful for doing e2fsck time trials.

       -j external-journal
              Set the pathname where the external-journal for this file system
              can be found.

       -k     When combined with the -c option, any existing bad blocks in the
              bad  blocks  list are preserved, and any new bad blocks found by
              running badblocks(8) will be added to the  existing  bad  blocks
              list.

       -l filename
              Add  the  block numbers listed in the file specified by filename
              to the list of bad blocks.  The format of this file is the  same
              as the one generated by the badblocks(8) program.  Note that the
              block  numbers  are  based  on the blocksize of the file system.
              Hence, badblocks(8) must be given the blocksize of the file sys‐
              tem in order to obtain correct results.  As a result, it is much
              simpler and safer to use the -c option to e2fsck, since it  will
              assure  that  the correct parameters are passed to the badblocks
              program.

       -L filename
              Set the bad blocks list to be the list of  blocks  specified  by
              filename.  (This option is the same as the -l option, except the
              bad  blocks list is cleared before the blocks listed in the file
              are added to the bad blocks list.)

       -n     Open the file system read-only, and assume an answer of `no'  to
              all  questions.   Allows  e2fsck  to  be used non-interactively.
              This option may not be specified at the same time as the  -p  or
              -y options.

       -p     Automatically  repair  ("preen")  the  file system.  This option
              will cause e2fsck to automatically fix any file system  problems
              that  can be safely fixed without human intervention.  If e2fsck
              discovers a problem which may require the  system  administrator
              to  take  additional  corrective action, e2fsck will print a de‐
              scription of the problem and then exit with the  value  4  logi‐
              cally  or'ed  into  the exit code.  (See the EXIT CODE section.)
              This option is normally used by the system's boot  scripts.   It
              may not be specified at the same time as the -n or -y options.

       -r     This  option  does nothing at all; it is provided only for back‐
              wards compatibility.

       -t     Print timing statistics for e2fsck.   If  this  option  is  used
              twice,  additional  timing  statistics  are printed on a pass by
              pass basis.

       -v     Verbose mode.

       -V     Print version information and exit.

       -y     Assume an answer of `yes' to all questions; allows e2fsck to  be
              used non-interactively.  This option may not be specified at the
              same time as the -n or -p options.

       -z undo_file
              Before  overwriting  a file system block, write the old contents
              of the block to an undo file.  This undo file can be  used  with
              e2undo(8)  to restore the old contents of the file system should
              something go wrong.  If  the  empty  string  is  passed  as  the
              undo_file  argument,  the  undo  file  will be written to a file
              named e2fsck-device.e2undo in the directory  specified  via  the
              E2FSPROGS_UNDO_DIR environment variable.

              WARNING: The undo file cannot be used to recover from a power or
              system crash.

EXIT CODE
       The  exit  code  returned  by e2fsck is the sum of the following condi‐
       tions:
            0    - No errors
            1    - File system errors corrected
            2    - File system errors corrected, system should
                   be rebooted
            4    - File system errors left uncorrected
            8    - Operational error
            16   - Usage or syntax error
            32   - E2fsck canceled by user request
            128  - Shared library error

SIGNALS
       The following signals have the following effect when sent to e2fsck.

       SIGUSR1
              This signal causes e2fsck to start displaying a  completion  bar
              or emitting progress information.  (See discussion of the -C op‐
              tion.)

       SIGUSR2
              This signal causes e2fsck to stop displaying a completion bar or
              emitting progress information.

REPORTING BUGS
       Almost  any  piece of software will have bugs.  If you manage to find a
       file system which causes e2fsck to crash, or which e2fsck is unable  to
       repair, please report it to the author.

       Please  include  as  much  information  as possible in your bug report.
       Ideally, include a complete transcript of the e2fsck run, so I can  see
       exactly  what  error  messages  are displayed.  (Make sure the messages
       printed by e2fsck are in English; if your system has been configured so
       that e2fsck's messages have  been  translated  into  another  language,
       please  set  the the LC_ALL environment variable to C so that the tran‐
       script of e2fsck's output will  be  useful  to  me.)   If  you  have  a
       writable  file system where the transcript can be stored, the script(1)
       program is a handy way to save the output of e2fsck to a file.

       It is also useful to send the output of dumpe2fs(8).  If a specific in‐
       ode or inodes seems to be giving e2fsck trouble, try  running  the  de‐
       bugfs(8) command and send the output of the stat(1u) command run on the
       relevant  inode(s).  If the inode is a directory, the debugfs dump com‐
       mand will allow you to extract the contents  of  the  directory  inode,
       which  can  sent  to me after being first run through uuencode(1).  The
       most useful data you can send to help reproduce the bug is a compressed
       raw image dump of the file system, generated using e2image(8).  See the
       e2image(8) man page for more details.

       Always include the full version string which e2fsck displays when it is
       run, so I know which version you are running.

ENVIRONMENT
       E2FSCK_CONFIG
              Determines  the  location  of  the   configuration   file   (see
              e2fsck.conf(5)).

AUTHOR
       This version of e2fsck was written by Theodore Ts'o <tytso@mit.edu>.

SEE ALSO
       e2fsck.conf(5),   badblocks(8),  dumpe2fs(8),  debugfs(8),  e2image(8),
       mke2fs(8), tune2fs(8)

E2fsprogs version 1.47.0         February 2023                       E2FSCK(8)

man e2fsck 번역기 번역본

더보기

E2FSCK (8) 시스템 관리자 수동 E2FSCK (8)

이름
       E2FSCK- Linux Ext2/Ext3/Ext4 파일 시스템을 점검하십시오

개요
       e2fsck [-pacnyrdfkvtdfv] [-B 슈퍼 블록] [-b blocksize] [-l | -l
       bad_blocks_file] [-c fd] [-j 외부 저널] [-e extended_op-
       tions] [-z undo_file] 장치

설명
       E2FSCK는 파일 시스템의 ext2/ext3/ext4 패밀리를 확인하는 데 사용됩니다.  을 위한
       ext3 및 ext4 파일 시스템은 시스템이있는 경우 저널을 사용하는 파일 시스템
       일반적으로 재생 후에는 오류없이 부정한 상태를 차단합니다.
       저널에서 커밋 된 거래는 파일 시스템이
       깨끗하게 표시됩니다.   따라서 저널링을 사용하는 파일 시스템의 경우 E2FSCK입니다
       슈퍼 블록의 인디가 아니라면 일반적으로 저널을 재생하고 종료합니다.
       추가 점검이 필요합니다.

장치는 블록 장치 (예 : /dev /sdc1) 또는 파일을 포함하는 파일입니다.
       체계.

일반적으로 장착 파일에서 e2fsck를 실행하는 것은 안전하지 않습니다.
       Tems.  -n 옵션이 지정되고 -c, -l,
       또는 -L 옵션이 지정되지 않았습니다.   그러나 안전하더라도
       따라서 E2FSCK에 의해 인쇄 된 결과는 파일 시스템이있는 경우 유효하지 않습니다.
       장착.   E2FSCK가 파일 시스템을 확인 해야하는지 여부를 묻는 경우
       장착 된 유일한 정답은``아니오 ''입니다.  전문가 만
       그들이하고있는 일 이이 질문에 대답하는 것을 고려해야한다는 것을 정말로 알고 있습니다.
       다른 방법으로.

E2FSCK가 대화식 모드로 실행되는 경우 (-y, -n, 또는
       -P 지정), 프로그램은 사용자에게 각 문제를 해결하도록 요청합니다.
       파일 시스템에서 발견됩니다.  'y'의 응답은 오류를 고정시킵니다. 'N'
       오류가 풀리지 않은 상태로 남겨 둡니다. 그리고 'A'는 문제와 모든 하위를 고칠 것입니다.
       시퀀스 문제; 기본값을 누르면 Enter가 누르면됩니다.
       물음표 앞에 인쇄 된 Sponse.  압축 c
       E2FSCK를 즉시 종료합니다.

옵션
       -이 옵션은 -P 옵션과 동일한 작업을 수행합니다.   그것은 프로 -
              거꾸로 호환성에만 경찰; 그것은 제안됩니다
              사람들은 가능할 때마다 -p 옵션을 사용합니다.

-B 슈퍼 블록
              일반 슈퍼 블록을 사용하는 대신 대체 SU를 사용하십시오.
              SuperBlock에서 지정된 PerBlock.  이 옵션은 일반적으로 사용됩니다
              기본 슈퍼 블록이 손상되었을 때.  위치
              백업 슈퍼 블록은 파일 시스템의 블록 크기에 따라 다릅니다.
              그룹당 블록 수 및 sparse_su와 같은 기능
              당.

추가 백업 슈퍼 블록을 사용하여 결정할 수 있습니다
              -N 옵션을 사용하여 MKE2FS 프로그램을 사용하여 SU-를 인쇄합니다.
              MKE2FS에 인수가 제공된다고 가정하면서 위조가 존재합니다
              파일 시스템의 레이아웃과 일치합니다 (예 : 블록 -
              크기, 그룹당 블록, sparse_super 등).

대체 슈퍼 블록이 지정되고 파일 시스템이
              읽기 전용이 열리지 않으면 E2FSCK는 기본 SU-를 확인합니다.
              파일이 완료되면 PerBlock이 적절하게 업데이트됩니다
              시스템 점검.

-B 블록 크기
              일반적으로 E2FSCK는 다양한 dif-에서 슈퍼 블록을 검색합니다.
              적절한 블록을 찾기 위해 블록 크기
              크기.   이 검색은 경우에 따라 속일 수 있습니다.  이 옵션
              E2FSCK는 입자에서 슈퍼 블록을 찾도록 강요합니다.
              lar blocksize.  슈퍼 블록을 찾을 수 없으면 e2fsck는 ter-
              치명적인 오류가있는 마이네이트.

-C이 옵션은 E2FSCK가 BadBlocks (8) 프로그램을 사용하여
              잘못된 블록을 찾기 위해 장치의 읽기 전용 스캔.
              불량 블록이 발견되면 불량 블록에 추가됩니다.
              파일이나 디렉토리에 할당되는 것을 방지하기 위해 ODE.
              이 옵션이 두 번 지정되면 잘못된 블록 스캔이
              비파괴적인 읽기 쓰기 테스트를 사용하여 수행해야합니다.

-C FD이 옵션은 E2FSCK가 완료 정보를
              파일의 진행을 위해 지정된 파일 디스크립터
              TEM 검사를 모니터링 할 수 있습니다.  이 옵션은 일반적으로 사용됩니다
              E2FSCK를 실행하는 프로그램.  파일 디스크립터 Num- 인 경우
              BER은 음수이며 파일 디스크립터의 절대 값은
              사용되면 진행 정보가 억제됩니다.
              성가신.  나중에 E2FSCK 프로세스를 보내면 활성화 될 수 있습니다.
              SIGUSR1 신호.  지정된 파일 디스크립터가 0, e2fsck 인 경우
              사업에 대한 완성 막대를 인쇄합니다.  이것
              E2FSCK가 비디오 콘솔 또는 터미널에서 실행 중이 려져야합니다.

-D 인쇄 디버깅 출력 (디버깅하지 않는 한 쓸모 없음
              E2FSCK).

-D 파일 시스템에서 디렉토리를 최적화합니다.  이 옵션은 E2FSCK를 유발합니다
              모든 디렉토리를 다시 표시하여 모든 디렉토리를 최적화하려고
              파일 시스템이 디렉토리 인덱싱을 지원하는 경우 또는 정렬을 통해
              소규모 디렉토리 또는 파일을위한 디렉토리를 압축합니다
              기존 선형 디렉토리를 사용하는 시스템.

-D 옵션이 없어도 E2FSCK는 때때로 몇 가지를 최적화 할 수 있습니다.
              디렉토리 --- 예를 들어 디렉토리 인덱싱이 활성화 된 경우
              디렉토리는 색인이 없으며
              덱스, 또는 인덱스 구조가 손상되어
              재건.   -D 옵션은 파일의 모든 디렉토리를 강제로합니다.
              최적화되는 TEM.  이것은 때때로 그것들을 조금 만들 수 있습니다
              검색이 작고 약간 빠르지 만 실제로는
              이 옵션을 거의 사용하지 않아도됩니다.

-d 옵션은 중복 이름의 디렉토리 항목을 감지합니다.
              E2FSCK가 일반적으로 시행되지 않는 단일 디렉토리에서
              성능 이유로.

-e extended_options
              E2FSCK 확장 옵션을 설정하십시오.  확장 옵션은 Comma Sepa입니다.
              등급을 매기고 Equals ( '=') 표시를 사용하여 인수를 할 수 있습니다.
              다음 옵션이 지원됩니다.

ea_ver = Extended_attribute_version
                          확장 속성 블록의 버전을 설정하십시오
                          파일을 확인하는 동안 E2FSCK가 필요합니다
                          체계.   버전 번호는 1 또는 2 일 수 있습니다.
                          오류 확장 속성 버전 형식은 2입니다.

Journal_only
                          필요한 경우에만 저널을 재생하지만 당하지 마십시오.
                          추가 수표 또는 수리를 형성합니다.

FragCheck
                          Pass 1 동안 모든 Dis-에 대한 자세한 보고서를 인쇄하십시오.
                          파일 시스템의 파일에 대한 연속 블록.

버리다
                          무료 블록과 사용하지 않은 inode를 폐기하려고 시도합니다
                          전체 파일 시스템 확인 후 차단 (폐기
                          블록은 솔리드 스테이트 장치 및 드문 드문 /에 유용합니다.
                          얇은 프로비저닝 스토리지). 폐기가 완료되었습니다
                          파일 시스템이 완전히 된 후 패스 5에서
                          확인할 수없는 경우에만 확인하십시오
                          오류. 그러나 E2FSCK가있는 경우가있을 수 있습니다
                          문제를 완전히 인식하지 못하므로
                          이 옵션을 사용하면 추가 매뉴얼을 방지 할 수 있습니다
                          데이터 복구.

Nodiscard
                          무료 블록을 폐기하려고 시도하지 않고 사용하지 마십시오.
                          ODE 블록.  이 옵션은 정확히 반대입니다
                          옵션 폐기. 이것은 기본값으로 설정됩니다.

no_optimize_extents
                          Empy-에 의해 범위를 최적화하도록 제안하지 마십시오.
                          Nating 불필요한 너비 또는 깊이.  이것은 또한 될 수 있습니다
                          /etc/e2fsck.conf의 옵션 섹션에서 활성화되었습니다.

최적화 _extents
                          UN-를 제거하여 범위를 최적화하도록 제안합니다.
                          필요한 폭 또는 깊이.  이것은 기본 UN-
                          /etc/e2fsck.conf에서는 덜 지정되지 않습니다.

inode_count_fullmap
                          확인시 속도를 위해 메모리를 사용하여 거래하십시오
                          많은 수의 하드 링크가있는 파일 시스템
                          파일.  필요한 메모리의 양은 Propor-입니다.
                          파일 시스템의 inodes 수에 이르기까지.
                          대형 파일 시스템의 경우 기가 바이트 일 수 있습니다
                          메모리.   (예를 들어, 2.8의 40TB 파일 시스템
                          10 억 inodes는 추가 5.7GB를 소비 할 것입니다
                          이 최적화가 활성화 된 경우 메모리.)이 Opti-
                          옵션 섹션에서 Mization을 활성화 할 수도 있습니다
                          /etc/e2fsck.conf.

no_inode_count_fullmap
                          inode_count_fullmap 최적화를 비활성화하십시오.   이것
                          달리 지정되지 않는 한 기본값입니다
                          /etc/e2fsck.conf.

readahead_kb
                          이 많은 메모리를 사용하여 메타 데이터를 미리 가져 오십시오.
                          E2FSCK 런타임을 줄이려는 희망.   기본적으로
                          이것은 두 개의 블록 그룹의 inode 크기로 설정됩니다.
                          테이블 (일반적으로 일반 ext4 파일의 4mib-
                          TEM);  이 금액이 총계의 1/50 이상인 경우
                          물리적 기억, readahead가 비활성화되었습니다.  이것을 설정하십시오
                          readahead를 완전히 비활성화하는 0.

bmap2extent
                          블록 매핑 된 파일을 범위 매핑 파일로 변환합니다.

fixes_only
                          손상된 메타 데이터 만 수정하십시오. htree di- 최적화하지 마십시오.
                          rectories 또는 범위의 나무를 압축합니다.  이 옵션은입니다
                          -d 및 -e bmap2extent 옵션과 호환되지 않습니다.

check_encoding
                          인코딩 된 파일 이름의 강제 검증.
                          민감한 디렉토리.  이것은 기본 모드입니다
                          파일 시스템에는 엄격한 플래그가 활성화되어 있습니다.

unshare_blocks
                          파일 시스템에 공유 블록이있는 경우
                          공유 블록 읽기 전용 기능이 활성화됩니다
                          모든 공유 블록을 공유하지 않고 읽기를 해제 할 것입니다.
                          기능 비트 만. 여유 공간이 충분하지 않은 경우
                          그러면 작업이 실패합니다.  파일 시스템 인 경우
                          읽기 전용 기능 비트가 없지만 있습니다
                          어쨌든 공유 블록은이 옵션에 없을 것입니다
                          효과. 이 옵션을 사용할 때는 아니요
                          클론 블록을 복제하는 여유 공간, 프롬프트가 없습니다.
                          파일을 삭제하면 대신 작업이 실패합니다.

UNSHARE_BLOCKS는 "-f"옵션을 의미합니다
                          모든 패스가 실행되는지 확인하십시오. 또한 if
                          "-n"도 명시되어 있으며, E2FSCK는 시도를 시뮬레이션 할 것입니다
                          중간에 충분한 공간을 할당합니다. 이 경우
                          실패하면 출구 코드는 0이 아닙니다.

-F 파일 시스템이 깨끗해 보인 경우에도 힘 검사.

-f 시작하기 전에 파일 시스템 장치의 버퍼 캐시를 플러시합니다.
              E2FSCK 타임 시험을 수행하는 데 정말 유용합니다.

-J 외부 저널
              이 파일 시스템의 외부 저널이있는 PathName을 설정하십시오.
              찾을 수 있습니다.

-K -C 옵션과 결합하면 기존의 나쁜 블록이
              잘못된 블록 목록이 보존되고 다음이 발견 한 새로운 나쁜 블록
              BadBlocks (8)를 실행하면 기존 나쁜 블록에 추가됩니다.
              목록.

-L 파일 이름
              파일 이름으로 지정된 파일에 나열된 블록 번호 추가
              나쁜 블록 목록에.  이 파일의 형식은 동일합니다
              Badblocks (8) 프로그램에 의해 생성 된 것.  주목하십시오
              블록 번호는 파일 시스템의 블록 크기를 기반으로합니다.
              따라서 BadBlocks (8)는 파일의 블록 크기를 제공해야합니다.
              올바른 결과를 얻기 위해 TEM.  결과적으로 많은 것입니다
              E2FSCK에 -C 옵션을 사용하는 것이 더 간단하고 안전합니다.
              올바른 매개 변수가 Badblocks로 전달되는지 확인하십시오.
              프로그램.

-L 파일 이름
              잘못된 블록 목록을
              파일 이름.  (이 옵션은 -L 옵션과 동일합니다.
              파일에 나열된 블록 앞에 잘못된 블록 목록이 지워집니다.
              나쁜 블록 목록에 추가됩니다.)

-N 파일 시스템을 읽기 전용으로 열고 '아니오'의 답변을 가정합니다.
              모든 질문.   E2FSCK를 무섭게 사용하도록 허용합니다.
              이 옵션은 -p 또는 동시에 지정되지 않을 수 있습니다.
              -Y 옵션.

-P 파일 시스템을 자동으로 수리 ( "Preen").  이 옵션
              E2FSCK가 파일 시스템 문제를 자동으로 수정하게합니다.
              그것은 인간의 개입없이 안전하게 고칠 수 있습니다.  E2FSCK 인 경우
              시스템 관리자가 필요할 수있는 문제를 발견합니다
              추가 수정 조치를 취하기 위해 E2FSCK는 DE-를 인쇄합니다.
              문제의 스크립션과 값 4 logi-로 종료하십시오.
              출구 코드에 Call 또는 '.  (출구 코드 섹션을 참조하십시오.)
              이 옵션은 일반적으로 시스템의 부팅 스크립트에서 사용됩니다.   그것
              -n 또는 -y 옵션과 동시에 지정할 수 없습니다.

-R이 옵션은 전혀 아무것도하지 않습니다. 백을 위해서만 제공됩니다.
              와드 호환성.

-t e2FSCK의 인쇄 타이밍 통계.   이 옵션이 사용되는 경우
              두 번, 추가 타이밍 통계는 패스에 인쇄됩니다.
              통과 기준.

-V 장점 모드.

-V 인쇄 버전 정보 및 종료.

-모든 질문에 대한 '예'에 대한 답변을 가정합니다. E2FSCK가 가능합니다
              상호 관계없이 사용되었습니다.  이 옵션은 다음에 지정되지 않을 수 있습니다
              -n 또는 -p 옵션과 동시에.

-z undo_file
              파일 시스템 블록을 덮어 쓰기 전에 이전 내용을 작성하십시오.
              블록의 실행 취소 파일.  이 실행 취소 파일은 함께 사용할 수 있습니다
              e2undo (8) 파일 시스템의 기존 내용을 복원하려면
              뭔가 잘못되었습니다.  빈 문자열이
              undo_file 인수, undo 파일은 파일에 기록됩니다.
              e2fsck-device.e2undo를 통해 지정된 디렉토리에서 명명되었습니다
              E2FSPROGS_UNDO_DIR 환경 변수.

경고 : UNDO 파일은 전원에서 복구하는 데 사용될 수 없습니다.
              시스템 충돌.

종료 코드
       E2FSCK가 반환 한 출구 코드는 다음과 같은 조건의 합입니다.
       tions :
            0- 오류 없음
            1- 파일 시스템 오류가 수정되었습니다
            2- 파일 시스템 오류가 수정되고 시스템이 필요합니다
                   재부팅됩니다
            4- 파일 시스템 오류가 수정되지 않은 상태로 남았습니다
            8- 작동 오류
            16- 사용법 또는 구문 오류
            32 -E2FSCK는 사용자 요청에 의해 취소되었습니다
            128- 공유 라이브러리 오류

신호
       다음 신호는 E2FSCK로 전송 될 때 다음과 같은 효과를 갖습니다.

sigusr1
              이 신호는 E2FSCK가 완성 막대를 표시하기 시작합니다.
              또는 진행 상황 정보를 방출합니다.  (-c op-에 대한 토론 참조
              tion.)

Sigusr2
              이 신호는 E2FSCK가 완성 막대 표시 또는
              진행 상황 정보 방출.

보고 버그
       거의 모든 소프트웨어에는 버그가 있습니다.  당신이 찾을 수 있다면
       E2FSCK가 충돌하거나 E2FSCK가
       수리, 저자에게 신고하십시오.

버그 보고서에 최대한 많은 정보를 포함 시키십시오.
       이상적으로는 E2FSCK 실행의 전체 전 사체를 포함하므로 볼 수 있습니다.
       정확히 어떤 오류 메시지가 표시되는지.  (메시지를 확인하십시오
       E2FSCK가 인쇄 한 영어로 인쇄됩니다. 시스템이 구성된 경우
       E2FSCK의 메시지가 다른 언어로 변환되었습니다.
       LC_ALL 환경 변수를 T로 설정하여 TRAN-
       E2FSCK의 출력 스크립트는 나에게 유용 할 것입니다.)
       글쓰기 가능한 파일 시스템 성적표를 저장할 수있는 스크립트 (1)
       프로그램은 E2FSCK의 출력을 파일에 저장하는 편리한 방법입니다.

또한 dumpe2fs (8)의 출력을 보내는 것도 유용합니다.  특정 인 경우
       ODE 또는 Inodes는 E2FSCK 문제를 일으키고있는 것 같습니다.
       Bugfs (8) 명령 및 STAT (1U) 명령의 출력을
       관련 inode (들).  inode가 디렉토리 인 경우 Debugfs는 com-
       Mand는 디렉토리 inode의 내용을 추출 할 수 있습니다.
       Uuencode (1)를 처음으로 실행 한 후 나에게 보낼 수 있습니다.  그만큼
       버그를 재현하기 위해 보낼 수있는 가장 유용한 데이터는 압축입니다.
       e2image (8)를 사용하여 생성 된 파일 시스템의 원시 이미지 덤프.  참조
       자세한 내용은 e2image (8) Man Page.

항상 E2FSCK가 표시하는 정식 버전 문자열을 포함하십시오.
       실행, 실행중인 버전을 알고 있습니다.

환경
       E2FSCK_CONFIG
              구성 파일의 위치를 ​​결정합니다 (참조
              e2fsck.conf (5)).

작가
       이 버전의 E2FSCK는 Theodore ts'o <tytso@mit.edu>에 의해 작성되었습니다.

참조하십시오
       e2fsck.conf (5), badblocks (8), dumpe2fs (8), 디버그프 (8), e2image (8),
       mke2fs (8), tune2fs (8)

E2FSPROGS 버전 1.47.0 2023 년 2 월 E2FSCK (8)

 

형태 : fsck [옵션] [장치명]

기능 : [장치명]에 해당하는 저장소를 점검한다.

 

[옵션]

-f : 강제로 점검한다.

-b [슈퍼블록] : 백업을 위한 슈퍼블록을 지정한다.

-y : 발견된 모든 오류를 사용자 확인없이 자동으로 수정한다.(질문에 모두 yes 라고 입력됨)

 

 

형태 : e2fsck [옵션] [장치명]

기능 : [장치명]에 해당하는 저장소가 ext계열일 경우 점검한다.

fsck 명령을 내렸을 때 저장소가 ext2, ext3, ext4에 해당하는 경우 이 명령으로 자동 호환된다.

 

[옵션]

-f : 강제로 점검한다.

-b [슈퍼블록] : 백업을 위한 슈퍼블록을 지정한다.

-y : 발견된 모든 오류를 사용자 확인없이 자동으로 수정한다.(질문에 모두 yes 라고 입력됨)

 

슈퍼블록 확인하기

더보기

슈퍼 블록은 각 저장소 파일시스템이 만들어질 때 미리 지정된다. 임의로 설정하는 것이 아니기 때문에 특정 명령어를 통해서 알 수 있다.

$sudo mke2fs -n [저장소]

이 명령은 [저장소]에 ext2 파일 시스템을 만드는 명령어지만 -n 옵션으로 실제 만드는 것이 아닌 가상으로 만들어보는 것이라고 할 수 있다.

일반적으로 파일시스템을 만들 때 슈퍼블록까지 기억해두진 않기 때문에 동일한 알고리즘으로 지정되는 슈퍼블록을 확인하기 위해 가상으로 프로그램을 돌린다고 볼 수 있다.

 

해당 명령을 입력할 경우

fscks는 파일시스템의 무결성은 점검하는 명령어이다.

/dev/sda1 contains a ext4 file system
last mounted on Fri Mar 21 14:24:00 2025
Proceed anyway? (y,N)

라는 식의 물음이 나오는데 그냥 y 입력해주면 된다. -n 옵션을 사용하였으니 가상으로 진행하기 때문이다.

 

y를 입력하면 가장 마지막에 super bolck 에 대한 정보가 출력된다.

 

Superblock backups stored on blocks: 
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 
102400000, 214990848

 

이제 해당 블록을 지정해주면서 fsck -b 명령을 사용할 수 있다.

 

fscks는 파일시스템의 무결성은 점검하는 명령어이다.

가장 접근하기 쉬운 예시로 스팀게임에는 무결성 검사 라는 항목이 있는데 게임이 오류가 자주 생기거나 이유없이 종료되는 등 문제가 발생했을 경우 게임 파일이 손상되거나 변형된 경우가 있다. 이런 경우 해쉬값 비교를 통해 제작사가 만든 파일과 다른 대상을 제거하고 원본 파일을 다시 설치시키는 과정이 무결성 검사이다.

 

마찬가지로 파일시스템의 무결성 검사는 파일시스템 자체에 문제가 있는지 확인하고 해당 오류를 자체적으로 수정할 수 있게 해주는 기능이다.

 

주의사항이 있는데 마운트 된 대상을 점검하려고 할 경우 마운트 되어있어 점검을 할 수 없다고 뜨는 경우가 있다. 일반적인 경우 마운트를 해제하고 다시 점검을 하면 되는데, 문제는 os를 설치한 대상을 점검하려고 할 경우 마운트 해제할 방법이 없다는 것이다.

 

그럴 경우 아래 방법을 이용해보자

1. 파일시스템 명령 예약하기

2. 부팅usb / cd를 활용하기

3. 복구모드 사용하기

 

1. 파일시스템 명령 예약하기

루트 디렉토리에 forcefsck 파일이 있으면 부팅시 자동으로 파일 시스템을 검사하게 할 수 있다.

$sudo touch /forcefsck

위 명령어를 실행시켜서 파일 시스템을 점검시켜보자

 

2. 부팅usb / cd를 활용하기

기존에 우분투를 설치했던 usb나 cd가 있을 것이다. 해당 장치로 다시 부팅한 후 자신이 컴퓨터에 설치한 저장소를 점검할 수 있다.

 

3. 복구모드 사용하기

우분투는 GRUB 부트로더를 통해서 복구모드로 들어갈 수 있다. 복구모드가 자동으로 나타나지 않을 경우 shift 키를 반복해서 누르면 GRUB 메뉴를 표시한다. 만약 UEFI로 부팅되는 경우 esc를 눌러서 GRUB 메뉴를 호출할 수 있다.

 

부팅 방법 확인하기

더보기

자신의 컴퓨터가 어떤 형태로 부팅되는지 알아보고 싶은 경우 몇가지 방법이 있는데 그중 가장 간단한 방법을 적겠다.

$sudo efibootmgr

해당 기능은 UEFI 기능으로 부팅하는 것에 대한 관리를 하는 명령어이다.

자신이 BIOS 형태로 부팅될 경우 해당 기능이 없어 "죄송합니다만, 다시 시도하십시오." 라는 문구를 보게 될 것이고

그렇지 않다면 UEFI와 관련된 내용을 볼 수 있을 것이다.

 

이후 GRUB메뉴에서 recovery mode 라고 적혔있는 대상을 찾아서 선택해주면 복구옵션이 나오게 된다.

여기서 원하는 옵션을 골라 실행시키면 된다.