misc/106107: left-over fsck_snapshot after unfinished background fsck if filesystem clean

Andrej Binder andrej.binder at stuba.sk
Thu Nov 30 19:20:12 PST 2006


>Number:         106107
>Category:       misc
>Synopsis:       left-over fsck_snapshot after unfinished background fsck if filesystem clean
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Dec 01 03:20:10 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Andrej Binder
>Release:        6.1-RELEASE
>Organization:
Slovak Technical University
>Environment:
FreeBSD a.ab.sk 6.1-RELEASE FreeBSD 6.1-RELEASE #0: Sat Nov 25 03:00:57 CET 2006     ab at a.ab.sk:/usr/src/sys/amd64/compile/CUSTOM  amd64
>Description:
Whenever fsck is run in background mode, a file called fsck_snapshot gets created in the .snap directory on the checked volume. Fsck then runs its check on this file instead of the live filesystem. Filesystem snapshots (which fsck_snapshot essentially is) are designed to persist over mounts and reboots thus if fsck does not terminate properly for some reason (hard reboot etc), the file gets left over.  This is partially solved on the next background fsck run (commonly just after the system reboots if the fs is marked dirty) since fsck overwrites the left over fsck_snapshot whit a new one and removes it when its done.

The prblem occours when you mark the filesystem clean before the next fsck background run (for example through fsck in singleuser mode). This way the fsck_snapshot file persists and possibly consumes most of the filesystem (depending on the state of the filesystem when the snapshot was made).
>How-To-Repeat:
1) run fsck in background mode
2) halt -qn before fsck finishes (or otherwise terminate it unproperly ... sigkill does not seem to work since fsck is in biord state)
3) boot into singleuser mode
4) fsck to mark the filesystem clean
5) reboot into normal mode and watch the file grow with every change on the live filesystem
>Fix:
Implement a code (maybe into loader after the the fs is mounted) to check for left over fsck snapshots and remove them if appropriate.
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list