From owner-freebsd-stable@FreeBSD.ORG Wed Aug 31 14:35:39 2011 Return-Path: Delivered-To: freebsd-stable@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 160251065673 for ; Wed, 31 Aug 2011 14:35:39 +0000 (UTC) (envelope-from egrosbein@rdtc.ru) Received: from eg.sd.rdtc.ru (unknown [IPv6:2a03:3100:c:13::5]) by mx1.freebsd.org (Postfix) with ESMTP id 7859F8FC17 for ; Wed, 31 Aug 2011 14:35:37 +0000 (UTC) Received: from eg.sd.rdtc.ru (localhost [127.0.0.1]) by eg.sd.rdtc.ru (8.14.5/8.14.5) with ESMTP id p7VEZYak045751 for ; Wed, 31 Aug 2011 21:35:34 +0700 (NOVST) (envelope-from egrosbein@rdtc.ru) Message-ID: <4E5E46B1.4070408@rdtc.ru> Date: Wed, 31 Aug 2011 21:35:29 +0700 From: Eugene Grosbein User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; ru-RU; rv:1.9.2.13) Gecko/20110112 Thunderbird/3.1.7 MIME-Version: 1.0 To: FreeBSD Stable Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Subject: Unfixable UFS2 corruption X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Aug 2011 14:35:39 -0000 Hi! Long story short: my /usr/local UFS2 filesystem somehow got corrupted and "fsck -y" in single user mode does not fix it. Explanation: # ls -al /usr/local/obj/usr/local/src/secure/lib/libssh ls: : No such file or directory total 8 drwxr-xr-x 2 root wheel 4608 Aug 30 01:28 . drwxr-xr-x 3 root wheel 512 Aug 30 01:28 .. # rm -rf /usr/local/obj/usr/local/src/secure/lib/libssh rm: /usr/local/obj/usr/local/src/secure/lib/libssh: Directory not empty As I've said, I cold booted this FreeBSD 8.2-STABLE system to single user mode where all file systems are not mounted (except root) and ran fsck -y /usr/local It found no errors and said it is CLEAN. The problem still persists. I've written small program and it said me this directory contains third file (besides <.> and <..> entries) having zero file length. I got contents of the directory to plain file with "cat /usr/local/obj/usr/local/src/secure/lib/libssh > /tmp/libssh and put it online: http://www.grosbein.net/crash/corruption/libssh Please help. The program and its output follow: #include #include #include #include int main(int argc, char* argv[]) { DIR *dirp; struct dirent *dp; unsigned i; if (argc<2) return 1; if ( (dirp = opendir(argv[1])) == NULL ) err (1, "opendir"); i = 0; while ((dp = readdir(dirp)) != NULL) { i++; printf("Entry %u:\n" "d_fileno=%u\n" "d_reclen=%u\n" "d_type=%u\n" "d_namlen=%u\n" "d_name=<%s>\n\n", i, (unsigned) dp->d_fileno, (unsigned) dp->d_reclen, (unsigned) dp->d_type, (unsigned) dp->d_namlen, (char *) dp->d_name); } return closedir(dirp); } # # ./readdir /usr/local/obj/usr/local/src/secure/lib/libssh Entry 1: d_fileno=1531227 d_reclen=12 d_type=4 d_namlen=1 d_name=<.> Entry 2: d_fileno=1389650 d_reclen=500 d_type=4 d_namlen=2 d_name=<..> Entry 3: d_fileno=24 d_reclen=512 d_type=8 d_namlen=0 d_name=<>