From owner-freebsd-fs@freebsd.org Fri Feb 12 15:42:02 2021 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 08435528347 for ; Fri, 12 Feb 2021 15:42:02 +0000 (UTC) (envelope-from artem@artem.ru) Received: from smtp48.i.mail.ru (smtp48.i.mail.ru [94.100.177.108]) (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 4Dcd610JGtz3GZP for ; Fri, 12 Feb 2021 15:42:00 +0000 (UTC) (envelope-from artem@artem.ru) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail3; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:Cc:References:To:Subject:From:Subject:Content-Type:Content-Transfer-Encoding:To:Cc; bh=27ROgpLR072vLMiEawXr8LA67yw+H57z4rjNVOk0A6I=; b=b7BgdHYWvRv5HjVhDm095BBPBADMqZhs1XBG3KqBO4GVM/QQ65xh6XG6KbZ0CJW7clEGZFrAt+X33VZVaxiXhKyi1GogEiTTuSM0Zjonhictj/9eNnnI9/0DFUsNne1hGjGWKFnWDm+eTLt7ubb7p4zIE6TYtCcuwXGbbmMLHns=; Received: by smtp48.i.mail.ru with esmtpa (envelope-from ) id 1lAaZy-0004dc-5R; Fri, 12 Feb 2021 18:41:58 +0300 Subject: Re: Reading a corrupted file on ZFS To: freebsd-fs@freebsd.org References: <0ca45adf-8f60-a4c3-6264-6122444a3ffd@denninger.net> From: Artem Kuchin Message-ID: <899c6b4f-2368-7ec2-4dfe-fa09fab35447@artem.ru> Date: Fri, 12 Feb 2021 18:41:57 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <0ca45adf-8f60-a4c3-6264-6122444a3ffd@denninger.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: ru X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD981647AC6901E234BAEBD76BEDCA450D6CA8258D9A07F13E2182A05F53808504042C202BFF6A7F5EFC1CF29D78B70FAF2F25477CD72A92A0C4A8FF51FE07C07BC X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE766DBE83FD69AB645EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063737452AF4BFD067BF8638F802B75D45FF5571747095F342E8C7A0BC55FA0FE5FC4EAF506ED846764AA86AB2527FB00B9BC5224D05308E6884389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C07E7E81EEA8A9722B8941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B64854413538E1713FCC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB8D32BA5DBAC0009BE9E8FC8737B5C2249A6C381CD31D6A0BC76E601842F6C81A12EF20D2F80756B5F7E9C4E3C761E06A776E601842F6C81A127C277FBC8AE2E8B8412D6D77F9351F23AA81AA40904B5D9DBF02ECDB25306B2B25CBF701D1BE8734AD6D5ED66289B5278DA827A17800CE798228CBAD4AC77F667F23339F89546C5A8DF7F3B2552694A6FED454B719173D6725E5C173C3A84C3FB9365559B687AC835872C767BF85DA2F004C906525384306FED454B719173D6462275124DF8B9C9D28595B116005B47574AF45C6390F7469DAA53EE0834AAEE X-C1DE0DAB: 0D63561A33F958A56807822B442F4AEF0420B99E11B11A47F4C3AABF95CE57C3D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75B869F6C56E712840410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D345DB600F8E858000F29145C9A2295E84EC4D27387380E4887FADB9A713C8EB8095AA6D80F735662D41D7E09C32AA3244C51BB9FCCC764DEAF0E2D91BB41C36408A95CA90A1D8AC565729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojtEL/kbq1PXHz+cM0iURIBA== X-Mailru-Sender: 0E9E14D9EC491FBAA791EF7E2263ACA34681680AFE6E11C5D7604E6DC8629E10E38B3286BF0A6676ED68A1BC046237463DDE9B364B0DF2893588BD1191EC2D784A420497922026CACF2710667E7BD92C3CDA0F3B3F5B9367 X-Mras: Ok X-Rspamd-Queue-Id: 4Dcd610JGtz3GZP X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=mail.ru header.s=mail3 header.b=b7BgdHYW; dmarc=none; spf=none (mx1.freebsd.org: domain of artem@artem.ru has no SPF policy when checking 94.100.177.108) smtp.mailfrom=artem@artem.ru X-Spamd-Result: default: False [-3.19 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[mail.ru:s=mail3]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[artem.ru]; SPAMHAUS_ZRD(0.00)[94.100.177.108:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[mail.ru:+]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_SHORT(-0.79)[-0.793]; R_SPF_NA(0.00)[no SPF record]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RBL_DBL_DONT_QUERY_IPS(0.00)[94.100.177.108:from]; ASN(0.00)[asn:47764, ipnet:94.100.176.0/20, country:RU]; MID_RHS_MATCH_FROM(0.00)[]; MAILMAN_DEST(0.00)[freebsd-fs]; RCVD_IN_DNSWL_LOW(-0.10)[94.100.177.108:from] X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Feb 2021 15:42:02 -0000 12.02.2021 18:06, Karl Denninger пишет: > On 2/12/2021 09:53, Artem Kuchin wrote: >> >> Now i am stuck in worst situation that with UFS - i cannot read >> what's left of this file. >> >> I deleted the file and the scrubbed - error went away. But i lost the >> file. >> >> So, the question is how to read the file with an error ? I googled >> for 2 hours and still did not find a solution. >> >> >> >> > With what you did both copies are damaged and non-repairable. > > Neither block on the two mirror copies has a correct checksum > therefore neither copy is good; both were damaged "at the same time".  > The system knows the file is corrupt and thus the contents are not > usable, but it has no way to fix it because both copies are damaged > with no means of correction. > > The correct answer to what to do is IMHO what ZFS does.  The only > solution in such a case is to restore from a backup. > > You *definitely* do not want the system to silently let you proceed in > such an instance because now you will *propagate* the damaged file > without knowing it was damaged, which will then wind up in your backup > copies.  Over time even with a robust backup scheme this will > eventually lead to you losing all "good" copies of the file since the > backup media will be rotated and ultimately the data will be > permanently lost with no means of recovery. > > Blocking the read forces you to get the good copy off backup media and > thus prevents that from happening. > I know what ZFS does and i damaged the same file in the same place on purpose. Question is: how to read what's left of it. Just for kicks, i don't have a backup, and i need to read what's left. It could be 1GB file with only one byte damaged and it is of crazy importance to me. So, how to bypass all the checks and make it read the file no matter what? Artem