From owner-freebsd-fs@freebsd.org Fri Mar 27 19:10:41 2020 Return-Path: Delivered-To: freebsd-fs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C045027EA40 for ; Fri, 27 Mar 2020 19:10:41 +0000 (UTC) (envelope-from artem@artem.ru) Received: from smtp3.mail.ru (smtp3.mail.ru [94.100.179.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48prz849WBz3Hv8 for ; Fri, 27 Mar 2020 19:10:27 +0000 (UTC) (envelope-from artem@artem.ru) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail2; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:To:Subject; bh=zf24HaFuMa7uZENFKQbkBO1VFlgL+6xJqHBT+vWqxy4=; b=r3Xb45lv3aSXFTYdS/P74g/FDt0iUBr2jSiMR3IlDpIR2WIl4SQiHKSj3XHUGiIQDSO3vqcK9KHv6rWfKJjHHeLur57S8Z61/fTVM7mIh9FgQiWw3xo2f4tvOh+yhN8rNZL20yd98lG1VZtgqpRhj8+b1vOtHG2fVPaoDwOgXvY=; Received: by smtp3.mail.ru with esmtpa (envelope-from ) id 1jHuMz-00085T-8P for freebsd-fs@freebsd.org; Fri, 27 Mar 2020 22:10:17 +0300 Subject: Re: Recovering bad sectors and smartctl no lba in error report To: freebsd-fs@freebsd.org References: <345b7285-958b-ef52-70a9-084872cf7409@artem.ru> From: Artem Kuchin Message-ID: Date: Fri, 27 Mar 2020 22:10:16 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <345b7285-958b-ef52-70a9-084872cf7409@artem.ru> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: ru X-7564579A: 78E4E2B564C1792B X-77F55803: 0A44E481635329DB0E1AA8A03B392317D32E5E48865217365060145B739F5F5C9A67197840F077DFF688BCB05C26794D8B461D1279ED7268A121DDF2817468F83CA6573D5BB2BA18F76D58A5003F35FA X-7FA49CB5: 0D63561A33F958A55E40F9EAB4C724571EE741D59E2BF33C21EF46E8EF77640E8941B15DA834481FA18204E546F3947CEDCF5861DED71B2F389733CBF5DBD5E9C8A9BA7A39EFB7666BA297DBC24807EA117882F44604297287769387670735209ECD01F8117BC8BEA471835C12D1D977C4224003CC8364767815B9869FA544D8D32BA5DBAC0009BE9E8FC8737B5C2249CB3CB8E9EF962DC476E601842F6C81A12EF20D2F80756B5F012D6517FE479FCD76E601842F6C81A127C277FBC8AE2E8B64627FC97409AA513AA81AA40904B5D99449624AB7ADAF37C2464171CE390C27725E5C173C3A84C3CE9959E2676FD87735872C767BF85DA2F004C906525384306FED454B719173D6462275124DF8B9C9DE2850DD75B2526BE5BFE6E7EFDEDCD789D4C264860C145E X-D57D3AED: Y8kq8+OzVozcFQziTi/Zi1xwo7H2ZNxGP5qz8aO2mjTJzjHGC4ogvVuzB3zfVUBtENeZ6b5av1fnCBE34JUDkWdM6QxE+Ga5d8voMtmXfSpeyDBBgITKOJzUdJfQ/bjz X-Mailru-Sender: 0E9E14D9EC491FBA79C5613A73A5E7B2AE026F17C7AB60D290B9F7E2256F035B732F4DBF80ECACC98A4382C47DA47812C77752E0C033A69E376A1339FE8876DF1FC4F5A70058821069EB1F849E6DBC830DA7A0AF5A3A8387 X-Mras: Ok X-Rspamd-Queue-Id: 48prz849WBz3Hv8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=mail.ru header.s=mail2 header.b=r3Xb45lv; dmarc=none; spf=none (mx1.freebsd.org: domain of artem@artem.ru has no SPF policy when checking 94.100.179.58) smtp.mailfrom=artem@artem.ru X-Spamd-Result: default: False [-2.28 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.97)[-0.968,0]; R_DKIM_ALLOW(-0.20)[mail.ru:s=mail2]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.98)[-0.977,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[artem.ru]; RCPT_COUNT_ONE(0.00)[1]; DKIM_TRACE(0.00)[mail.ru:+]; R_SPF_NA(0.00)[]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; IP_SCORE(0.06)[ipnet: 94.100.176.0/20(0.06), asn: 47764(0.24), country: RU(0.01)]; ASN(0.00)[asn:47764, ipnet:94.100.176.0/20, country:RU]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[58.179.100.94.list.dnswl.org : 127.0.5.1] X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Mar 2020 19:10:41 -0000 One more strange thing  i found out > rror 5 occurred at disk power-on lifetime: 46151 hours (1922 days + 23 > hours) >   When the command that caused the error occurred, the device was > active or idle. > >   After command completion occurred, registers were: >   ER ST SC SN CL CH DH >   -- -- -- -- -- -- -- >   40 51 a0 08 de 3e 0b  Error: UNC at LBA = 0x0b3ede08 = 188669448 The only error i saw in the log is about swap partition not redable. However, # gpart show =>        34  5860533101  ada2  GPT  (2.7T)           34           6        - free -  (3.0K)           40         128     1  freebsd-boot  (64K)          168     8388608     2  freebsd-swap  (4.0G)      8388776  5852144352     3  freebsd-ufs  (2.7T)   5860533128           7        - free -  (3.5K) Now see to which partition this LBA belongs. The block in the gpart show are 512 b ytes and LBA is 512 too. So, we can just compare numbers. And as you see 188669448 is not in  the swap partition. It is  in FREEBSD-UFS! So, some file is damaged there and i need to know which one. I need a way to map LBA (block) to a file. Linux has debugfs utility, but i haven't found anything like that for freebsd. Artem