PFe  
Front Page
Notice | Keyword | Tag | Location | Guestbook | Admin | Write Article   
 
5 states of filesystem (used by fsck for checking filesystem integrity)

File systems can be damaged or become inconsistent because of abrupt termination of the operating system in these ways:
- Power failure
- Accidental unplugging of the system
- Turning the system off without proper shutdown procedure
- A software error in the kernel

When a system is booted, a file system consistency check is automatically done. Most of the time, this file system check repairs problems it encounters. File systems are checked with the fsck (file system check) program.

* Understanding How the File System State Is Recorded
fsck command uses a state flag, which is stored in the superblock, to record the condition of the file system. This flag is used by the fsck command to determine whether or not a file system needs to be checked for consistency. The flag is used by the /etc/bcheckrc script during booting and by the fsck command when run from a command line using the -m option. If you ignore the result from the -m option to fsck, all file systems can be checked regardless of the setting of the state flag.

The possible state values are:
* FSCLEAN - If the file system was unmounted properly, the state flag is set to FSCLEAN. Any file system with an FSCLEAN state flag is not checked when the system is booted.
* FSSTABLE - The file system is (or was) mounted but has not changed since the last checkpoint: sync or fsflush--which normally occurs every 30 seconds. For example, the kernel periodically checks to see if a file system is idle and, if so, flushes the information in the superblock back to the disk and marks it FSSTABLE. If the system crashes, the file system structure is stable, but users may lose a small amount of data. File systems that are marked FSSTABLE can skip the checking before mounting.
* FSACTIVE - When a file system is mounted and then modified, the state flag is set to FSACTIVE. The file system may contain inconsistencies. A file system will be marked as FSACTIVE before any modified metadata is written to the disk. When a file system is unmounted gracefully, the state flag is set to FSCLEAN. A file system with the FSACTIVE flag must be checked by fsck because it may be inconsistent. The mount(2) system call will not mount a file system for read/write if the file system state is not FSCLEAN or FSSTABLE.
* FSBAD - When the root file system is mounted when its state is not FSCLEAN or FSSTABLE, the state flag is set to FSBAD. The kernel will not change this file system state to FSCLEAN or FSSTABLE. If a root file system is flagged FSBAD as part of the boot process, it will be mounted read-only. You can run fsck on the raw root device. Then remount the root file system as read/write.

State Flag Transitions After fsck
Before fsck After fsck

Initial State No Errors New State All Errors Corrected Uncorrected Errors
unknown stable stable unknown
active stable stable active
stable stable stable active
clean clean stable active
bad stable stable bad

from http://docs.sun.com/app/docs/doc/801-6631/6i10bkb0u?l=ko&a=view



이올린에 북마크하기
Track this back : http://inchulee.net/trackback/51

name    password    homepage
 hidden


BLOG main image
 Notice
 TattertoolsBirthday
 Category
전체 (40)
Essay (15)
Album (2)
BookReview (2)
miscellaneous (5)
Newspaper (2)
Movie (6)
Solaris (4)
SunMicrosystems (1)
English QT (0)
 TAGS
EFI label VTOC 게임 썬마이크로시스템즈 영화 야근 임베디드 인적성검사 심형래 24 스타크래프트 지하철 잡상인 한 발의 B-boy Sun Microsystems 공공 예절 Solaris10 크리미널 마인드 season7 PBB 이어폰 밀양 Solaris 버그 트랜스포머 최종 면접 취뽀 변명 D-war 블랙박스 Project BlackBox 미드 File System 퇴근
 Calendar
«   2009년 01월   »
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
 Recent Entries
5 states of filesystem (u..
EFI Disk Label
Project BlackBox (3)
24 Season 7 Coming soon.... (2)
Solaris OS File Systems
 Recent Comments
FYI, The pictures above a..
PFe - 2007년
Not as much as to be with..
PFe - 2007년
이미지들이 멋지다..^^
진희 - 2007년
또 나왔네 이거.. 그렇게나..
진희 - 2007년
드디어 멋진 썬맨이 되셨어..
봉달이 - 2007년
 Recent Trackbacks
Milwaukee Swinger
Milwaukee Swinger
Boston Adult Escort
Boston Adult Escort
Dating After Divorce
Dating After Divorce
Minnesota Swingers
Minnesota Swingers
Dating Agencies In Ireland
Dating Agencies In Ireland
 Archive
2008년 05월
2007년 11월
2007년 08월
2007년 07월
2007년 06월
 Link Site
bongdal
SSR
Story about my world
Sun Microsystems
Winchul
 Visitor Statistics
Total : 13536
Today : 9
Yesterday : 12
태터툴즈 배너
Eolin
rss