From owner-freebsd-bugs@FreeBSD.ORG Wed Aug 18 02:20:22 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0286316A4CE for ; Wed, 18 Aug 2004 02:20:22 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id D9AB343D31 for ; Wed, 18 Aug 2004 02:20:21 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.11/8.12.11) with ESMTP id i7I2KLve025143 for ; Wed, 18 Aug 2004 02:20:21 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i7I2KLWD025136; Wed, 18 Aug 2004 02:20:21 GMT (envelope-from gnats) Resent-Date: Wed, 18 Aug 2004 02:20:21 GMT Resent-Message-Id: <200408180220.i7I2KLWD025136@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Charles Sprickman Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0F98516A4CE for ; Wed, 18 Aug 2004 02:16:35 +0000 (GMT) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id F20AC43D4C for ; Wed, 18 Aug 2004 02:16:34 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.12.11/8.12.11) with ESMTP id i7I2GYHe066918 for ; Wed, 18 Aug 2004 02:16:34 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.12.11/8.12.11/Submit) id i7I2GYPP066917; Wed, 18 Aug 2004 02:16:34 GMT (envelope-from nobody) Message-Id: <200408180216.i7I2GYPP066917@www.freebsd.org> Date: Wed, 18 Aug 2004 02:16:34 GMT From: Charles Sprickman To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Subject: bin/70600: fsck throws files away when it can't grow lost+found X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Aug 2004 02:20:22 -0000 >Number: 70600 >Category: bin >Synopsis: fsck throws files away when it can't grow lost+found >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Aug 18 02:20:21 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Charles Sprickman >Release: FreeBSD 4.9 >Organization: Spork, LLC >Environment: FreeBSD skunkworks.spork.us 4.9-RELEASE-p4 FreeBSD 4.9-RELEASE-p4 #6: Mon Mar 29 00:49:50 EST 2004 >Description: When fsck is run on a well-trashed partition that has a large number of files/directories (for example a mail server using Maildirs, a news server, large office file server), there seems to be some internal limit on the number of directories and/or files that fsck can create within lost+found. This results in many possibly recoverable files being deleted. >How-To-Repeat: Trash a filesystem badly. :) Then run fsck on it. At some point, fsck will start spitting out the error "SORRY. NO SPACE IN lost+found DIRECTORY". Since one is probably running with "-y" due to the large number of prompts a bad fs will have, from that point on everything fsck tries to "reconnect" into lost+found gets trashed. You have lost possibly good data at that point. >Fix: I don't really have any C skills, but on a box where I'm attempting recovery off of a dd image of a trashed fs, I've modified "dir.c" like so to make fsck just exit when it can no longer add files to lost+found: if (makeentry(lfdir, orphan, (name ? name : tempname)) == 0) { pfatal("SORRY. NO SPACE IN lost+found DIRECTORY"); printf("exiting...\n\n"); exit (99); return (0); } I then mount the fs r/w, copy off everything in lost+found, rm -rf lost+found, unmount, and then run fsck again. I keep doing this until it's finished. I imagine someone more familiar with fsck could have it do something else at that point; like create a "lost+found1" directory and keep incrementing. That's my best guess as to how to approach this. Thanks, Charles >Release-Note: >Audit-Trail: >Unformatted: