From owner-freebsd-stable@freebsd.org Mon Aug 15 18:51:11 2016 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC16EBBBFB1 for ; Mon, 15 Aug 2016 18:51:11 +0000 (UTC) (envelope-from trtrmitya@gmail.com) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 9914B1C16 for ; Mon, 15 Aug 2016 18:51:11 +0000 (UTC) (envelope-from trtrmitya@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 94B45BBBFB0; Mon, 15 Aug 2016 18:51:11 +0000 (UTC) Delivered-To: stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 945C0BBBFAF for ; Mon, 15 Aug 2016 18:51:11 +0000 (UTC) (envelope-from trtrmitya@gmail.com) Received: from mail-wm0-x22f.google.com (mail-wm0-x22f.google.com [IPv6:2a00:1450:400c:c09::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2690D1C12 for ; Mon, 15 Aug 2016 18:51:11 +0000 (UTC) (envelope-from trtrmitya@gmail.com) Received: by mail-wm0-x22f.google.com with SMTP id q128so104277908wma.1 for ; Mon, 15 Aug 2016 11:51:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=BGvIXfvhm3afFo/vlqcjVijOOvcN5sBxGOuf/CFm4fo=; b=a+4fDPU+Yb6li+Xhyn+HVSNNUDL2KHYkdMTEnhnxd6SIu/gLw7V2I9+is8GlNhmubp qDmAlP5KVRiqs7DoEA0qiARPVkI6fHx7N/oZYhuk010TB2lqzsofU4JR8odexf0f2Lv4 F8vFp+FsvBOLNRj4nI2bfn1VDKqWWd8sRJMugkjwp3zE5ns3C4EUdGRyKBKsf9eZaA5r 2V8wt9i2pJEhysbEqLwIg/dQC/t2Cor3GXFsRiDrNTuFWEK2c0yDyRSwaFpiT8y56Rx4 xmXKOjK9HUACIiJ9Gi0An4zwKtY5UFyEGmxoZsqsYx7rb+joh2bKGo4SV8gM4ei+GZeN tC7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=BGvIXfvhm3afFo/vlqcjVijOOvcN5sBxGOuf/CFm4fo=; b=YjsZ9ywx+P3YOH/Klc0Nt1/fcuxy1dmEiL7w5Oc6MGwb5yxqFD05a13a8ptKDawLwS knhUtLWwlq8qQwldssXP1iFEngN69SqzT04NN+zmNuG9AmemPEe3/opX+LjX7EL16iMZ IQNA6QJOiUJL+wUxhwjy2JcrYn1r8Lnokcz6//FD+4tqXFEtuKJ4cNDz0zsZEhFzUx6I tHP7lXsI1W69HW0dS7wbzAXCleBSqophHmYEhiqR9ZjHrzcRTkAPwXlTs1+5nmJuczF2 Zy//H654CROuwOqrl3+G/O68rV/54OJ9D+iccdiZwVxjn6zgqIhit+1R7EKrLZ0iVlMB rqLQ== X-Gm-Message-State: AEkoouuPp9oZsuI1n2ExhPFExD9twTNxvCGFYBj4YuYaNU8Vzki0VA12jOhBZgd7iRG3vw== X-Received: by 10.25.25.12 with SMTP id 12mr5969082lfz.149.1471287069367; Mon, 15 Aug 2016 11:51:09 -0700 (PDT) Received: from [10.0.1.2] (broadband-5-228-251-188.nationalcablenetworks.ru. [5.228.251.188]) by smtp.gmail.com with ESMTPSA id u70sm209909lja.15.2016.08.15.11.51.08 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 15 Aug 2016 11:51:08 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: fsck_ufs dumps core From: Dmitry Sivachenko In-Reply-To: <20160812055153.GM83214@kib.kiev.ua> Date: Mon, 15 Aug 2016 21:51:07 +0300 Cc: FreeBSD Stable ML Content-Transfer-Encoding: quoted-printable Message-Id: <962BFEA7-8E30-4D35-ACCD-C8F695679295@gmail.com> References: <292C631A-F184-46B1-85B4-3EC68FB2E416@gmail.com> <20160810145533.GS83214@kib.kiev.ua> <8F022310-A20F-40AB-8B8A-8F145E7AA77F@gmail.com> <20160812055153.GM83214@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.3124) X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Aug 2016 18:51:11 -0000 > On 12 Aug 2016, at 08:51, Konstantin Belousov = wrote: >=20 > On Wed, Aug 10, 2016 at 06:11:39PM +0300, Dmitry Sivachenko wrote: >>=20 >>> On 10 Aug 2016, at 17:55, Konstantin Belousov = wrote: >>>=20 >>> On Wed, Aug 10, 2016 at 05:29:31PM +0300, Dmitry Sivachenko wrote: >>>> Hello, >>>>=20 >>>> I am running FreeBSD 10.3-STABLE #0 r299261M >>>>=20 >>>> After unclean reboot I am unable to fsck my UFS filesystem: >>>>=20 >>>> # fsck /dev/mfid0p1 >>>> ** /dev/mfid0p1 >>>> ** Last Mounted on /opt >>>> ** Phase 1 - Check Blocks and Sizes >>>> fsck: /dev/mfid0p1: Segmentation fault >>>>=20 >>>> pid 482 (fsck_ufs), uid 0: exited on signal 11 (core dumped) >>>>=20 >>>> # gdb -c fsck_ufs.482 /sbin/fsck_ufs=20 >>>> GNU gdb 6.1.1 [FreeBSD] >>>> Copyright 2004 Free Software Foundation, Inc. >>>> GDB is free software, covered by the GNU General Public License, = and you are >>>> welcome to change it and/or distribute copies of it under certain = conditions. >>>> Type "show copying" to see the conditions. >>>> There is absolutely no warranty for GDB. Type "show warranty" for = details. >>>> This GDB was configured as "amd64-marcel-freebsd"... >>>> Core was generated by `fsck_ufs'. >>>> Program terminated with signal 11, Segmentation fault. >>>> Reading symbols from /lib/libufs.so.6...done. >>>> Loaded symbols for /lib/libufs.so.6 >>>> Reading symbols from /lib/libc.so.7...done. >>>> Loaded symbols for /lib/libc.so.7 >>>> Reading symbols from /libexec/ld-elf.so.1...done. >>>> Loaded symbols for /libexec/ld-elf.so.1 >>>> #0 0x0000000000409a8b in pass1 () at = /place/WRK/src/sbin/fsck_ffs/pass1.c:83 >>>> 83 setbmap(i); >>>> (gdb) bt >>>> #0 0x0000000000409a8b in pass1 () at = /place/WRK/src/sbin/fsck_ffs/pass1.c:83 >>>> #1 0x0000000000409050 in main (argc=3D,=20 >>>> argv=3D) at = /place/WRK/src/sbin/fsck_ffs/main.c:447 >>>> Current language: auto; currently minimal >>>> (gdb)=20 >>>>=20 >>>=20 >>> Try to use alternative superblock (-b switch). You can get the list = of >>> the possible values for -b by 'newfs -N' invocation, but you have to = know >>> the parameters which were used for formatting. >>=20 >>=20 >> Yes, I tried several different backup superblocks, with the same = result. (I created this FS few years ago so I can't be 100% sure about = the parameters, but I usually only use larger -i NN for big filesystems, = and I can guess the exact value examining df -ik). >>=20 >>=20 >> BTW I just noticed that when I use larger values for backup = superblock, it reports an error which looks like overflow: >>=20 >> # fsck_ufs -b 7437746112 /dev/mfid0p1 >> Alternate super block location: -1152188480 >> ** /dev/mfid0p1 >>=20 >> CANNOT SEEK BLK: -1152188480 >> CONTINUE? [yn]=20 >=20 > Well, it seems that your beginning of the volume got obliterated. > Fsck_ffs cannot convert random sequence of bytes into the valid FFS > volume. >=20 > The only other way to try is to restore content of the cylinder groups > which are farther away from the start. Create a scratch volume of the > same size, newfs it with the same parameters. Then dd from the broken > volume to the new one, with some offset. Offset should be large = enough > to not include initial superblock, and if the zero cg is damaged, skip > it as well. You should use seek=3Dn skip=3Dn (i.e. the same initial = offsets > both for input and output). Okay, then it was simpler for me to backup vital data from this volume = and do newfs on it (rather that dd 145TB of data). But fsck_ufs -b still does not work (after fresh newfs): # fsck_ufs -b 343748128704 /dev/mfid0p1=20 Alternate super block location: 150745024 ** /dev/mfid0p1 150745024 is not a file system superblock 343748128704 was taken from freshly made newfs.=