Date: Mon, 15 Aug 2016 21:51:07 +0300 From: Dmitry Sivachenko <trtrmitya@gmail.com> To: Konstantin Belousov <kostikbel@gmail.com> Cc: FreeBSD Stable ML <stable@freebsd.org> Subject: Re: fsck_ufs dumps core Message-ID: <962BFEA7-8E30-4D35-ACCD-C8F695679295@gmail.com> In-Reply-To: <20160812055153.GM83214@kib.kiev.ua> 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>
next in thread | previous in thread | raw e-mail | index | archive | help
> On 12 Aug 2016, at 08:51, Konstantin Belousov <kostikbel@gmail.com> = 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 <kostikbel@gmail.com> = 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<value optimized out>,=20 >>>> argv=3D<value optimized out>) 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.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?962BFEA7-8E30-4D35-ACCD-C8F695679295>