
나는 일반적으로 하루에 약 2-3회 하드 전원을 순환하는 시스템에 읽기 전용으로 마운트된 대용량의 자주 읽는 ext3 파일 시스템을 가지고 있습니다.
일반적으로 전원을 차단하면 장치의 전원이 꺼지기 때문에 fsck는 해당 파일 시스템에서 부팅 시 실행되지만 이 응용 프로그램의 경우 빠른 부팅 시간이 중요합니다(초 단위로).
fstab에서 파일 시스템에 대한 부팅 시간 확인을 비활성화할 수 있지만 제 질문은 이렇게 해도 안전할까요?입니다. 파일 시스템이 읽기 전용으로 마운트되었지만 제대로 마운트 해제되지 않은 경우어느부팅 시간 확인을 비활성화하면 장기간에 걸쳐 파일 시스템 손상이 누적될 위험이 있습니까?
답변1
맨페이지 에서 mount
,
-r, --read-only
Mount the filesystem read-only. A synonym is -o ro.
Note that, depending on the filesystem type, state and kernel
behavior, the system may still write to the device. For example,
Ext3 or ext4 will replay its journal if the filesystem is dirty.
To prevent this kind of write access, you may want to mount ext3
or ext4 filesystem with "ro,noload" mount options or set the
block device to read-only mode, see command blockdev(8).
충분하지 않은 것으로 판명 되면 ro,noload
fstab 항목만으로 읽기 전용 장치를 설정할 수 있는 방법이 없습니다. 파일 시스템을 마운트하기 전에 다른 방법으로 blockdev --setro
읽기 전용 루프 장치( )를 호출하거나 생성해야 할 수도 있습니다 .losetup --read-only
실제로 읽기 전용으로 만들면 마운트되었는지조차 알 수 없습니다. 따라서 마운트 수 업데이트가 없고 강제 fsck가 없으며 특히 장치에 아무것도 쓰지 않는 한 손상이 발생하지 않습니다.
답변2
맨페이지 에서 tune2fs
:
-c max-mount-counts
Adjust the number of mounts after which the filesystem will be checked by e2fsck(8). If max-mount-counts is 0 or -1, the number
of times the filesystem is mounted will be disregarded by e2fsck(8) and the kernel.
Staggering the mount-counts at which filesystems are forcibly checked will avoid all filesystems being checked at one time when
using journaled filesystems.
You should strongly consider the consequences of disabling mount-count-dependent checking entirely. Bad disk drives, cables,
memory, and kernel bugs could all corrupt a filesystem without marking the filesystem dirty or in error. If you are using jour-
naling on your filesystem, your filesystem will never be marked dirty, so it will not normally be checked. A filesystem error
detected by the kernel will still force an fsck on the next reboot, but it may already be too late to prevent data loss at that
point.
See also the -i option for time-dependent checking.
그리고:
-i interval-between-checks[d|m|w]
Adjust the maximal time between two filesystem checks. No postfix or d result in days, m in months, and w in weeks. A value of
zero will disable the time-dependent checking.
It is strongly recommended that either -c (mount-count-dependent) or -i (time-dependent) checking be enabled to force periodic
full e2fsck(8) checking of the filesystem. Failure to do so may lead to filesystem corruption due to bad disks, cables, memory,
or kernel bugs to go unnoticed until they cause data loss or corruption.
따라서 둘 다 0으로 설정하면 자동 fsck
을 비활성화할 수 있습니다(실제로그래도 그러고 싶어요).
답변3
역사적, 상황적 이유로 다른 답변을 남겨두었지만 다시 읽어보니 실제 질문이 보입니다. 예, 여전히결국. fsck
모든 디스크는 유한한 수명을 가지며 fsck
불량 섹터를 "불량 블록" inode/목록에 할당하여 새 파일이 이를 사용하지 않도록 합니다.
읽기 전용(그리고 noload
frotschutz가 말하는 작업을 수행)은 서비스 중단으로 인한 일관성 문제를 방지하는 데 도움이 되지만 여전히 하드웨어가 완전히 죽어가는 것을 고려해야 합니다.