From owner-freebsd-fs@freebsd.org Fri Mar 27 07:50:24 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 266A726D3BD for ; Fri, 27 Mar 2020 07:50:24 +0000 (UTC) (envelope-from artem@artem.ru) Received: from smtp43.i.mail.ru (smtp43.i.mail.ru [94.100.177.103]) (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 48pYtC5Lrdz4N1T for ; Fri, 27 Mar 2020 07:50:11 +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-Type:MIME-Version:Date:Message-ID:Subject:From:To; bh=84R3atlSjo+G3BENcR/znLpiWYPthwcORD8Vo+0i8XE=; b=ZTT43yrYGMADUNC3dezxQ/H97K6Vxcz7iqN7ASdPfJHQZ5jr5YdE95PaPULkSEasw20+C+pi91QIuBQwG8VWsbZzSU7tiEc+MxsmLqvH+VL8TL5lgSA4jKeg/BHuehPzp35lvIINjNJjf6RE4+Z3ZcFOnASUxc2/3Wpj1X51g4E=; Received: by smtp43.i.mail.ru with esmtpa (envelope-from ) id 1jHjkd-00075I-9u for freebsd-fs@freebsd.org; Fri, 27 Mar 2020 10:49:59 +0300 To: freebsd-fs@freebsd.org From: Artem Kuchin Subject: Recovering bad sectors and smartctl no lba in error report Message-ID: <345b7285-958b-ef52-70a9-084872cf7409@artem.ru> Date: Fri, 27 Mar 2020 10:49:58 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 Content-Language: ru X-7564579A: 78E4E2B564C1792B X-77F55803: 0A44E481635329DB0E1AA8A03B392317D32E5E48865217365060145B739F5F5C7141CD936E95A8CDF688BCB05C26794D4ADC2FDA36790783433C5A1734A2C6D42332354A992B770E361B1DCE9D89B03C X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7E9A0F80F179600C6EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006375083DEA2ECAF87758638F802B75D45FF5571747095F342E8C7A0BC55FA0FE5FC98409C0A6B956C01DD663DE13342C81021B03C32D0D2A705389733CBF5DBD5E913377AFFFEAFD269A417C69337E82CC2CC7F00164DA146DAFE8445B8C89999725571747095F342E8C26CFBAC0749D213D2E47CDBA5A9658359CC434672EE6371117882F4460429728AD0CFFFB425014E40A5AABA2AD371193AA81AA40904B5D9A18204E546F3947CE6D7C9137AE18D269735652A29929C6C4AD6D5ED66289B52E1A3F18E62937ED6302FCEF25BFAB345725E5C173C3A84C3B9E0336EE4E43422BA3038C0950A5D36B5C8C57E37DE458B0B4866841D68ED3522CA9DD8327EE4930A3850AC1BE2E735BA6625F88748EAEFC4224003CC836476C0CAF46E325F83A50BF2EBBBDD9D6B0F05F538519369F3743B503F486389A921A5CC5B56E945C8DA X-D57D3AED: Y8kq8+OzVozcFQziTi/Zi1xwo7H2ZNxGP5qz8aO2mjTJzjHGC4ogvVuzB3zfVUBtENeZ6b5av1fnCBE34JUDkWdM6QxE+Ga5d8voMtmXfSqqsJQZGzcrYTqYQ0PEDyTA X-Mailru-Sender: 0E9E14D9EC491FBA79C5613A73A5E7B22C4809E2DB4F53DAAB3BF0D9E1956B7259B338C6ADB0E14E8A4382C47DA47812C77752E0C033A69E376A1339FE8876DF1FC4F5A70058821069EB1F849E6DBC830DA7A0AF5A3A8387 X-Mras: Ok X-Rspamd-Queue-Id: 48pYtC5Lrdz4N1T X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=mail.ru header.s=mail2 header.b=ZTT43yrY; dmarc=none; spf=none (mx1.freebsd.org: domain of artem@artem.ru has no SPF policy when checking 94.100.177.103) smtp.mailfrom=artem@artem.ru X-Spamd-Result: default: False [-0.37 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.50)[-0.501,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.53)[-0.530,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[artem.ru]; URI_COUNT_ODD(1.00)[3]; 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:+,1:+,2:~]; 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)[103.177.100.94.list.dnswl.org : 127.0.5.1] Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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 07:50:24 -0000 Hello! One of my RAID 1 disks went a little 'woohoo' and i got at least one read error on swap partition. I've disabled swap alltogether (and it actually made everything better) and have run smartctl test. here is the output: https://artem.ru/ada2.txt I will describe my logic step by step and closer to the end i will haveĀ  questions. You can skip to the end to the QUESTIONS sections :) What's strange is that 5 Reallocated_Sector_Ct 0x0033 100 100 005 Pre-fail Always - 0 197 Current_Pending_Sector 0x0022 100 100 000 Old_age Always - 8 198 Offline_Uncorrectable 0x0008 100 100 000 Old_age Offline - 0 So, seectors are in read error state, but off line uncrorrectable is 0. Okay, now the test results SMART Self-test log structure revision number 1 Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error # 1 Short offline Completed without error 00% 46183 - # 2 Extended offline Completed: read failure 20% 46181 - # 3 Short offline Completed without error 00% 46170 - As you see - NO LBAsecrtor is sepcified. From the log: 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 Commands leading to the command that caused the error were: CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name -- -- -- -- -- -- -- -- ---------------- -------------------- 60 80 48 e8 84 4e 40 00 10:43:18.103 READ FPDMA QUEUED 61 08 40 48 04 21 40 00 10:43:18.103 WRITE FPDMA QUEUED 60 40 38 e8 94 32 40 00 10:43:18.103 READ FPDMA QUEUED 61 08 30 20 b9 ef 40 00 10:43:18.103 WRITE FPDMA QUEUED 61 30 28 68 22 03 40 00 10:43:18.103 WRITE FPDMA QUEUED And 188669448 is the only LBA mentioned in the log. So, my logic is the following: This HDD has "Sector Sizes: 512 bytes logical, 4096 bytes physical" So, LBA/(4096/512) = physical sector number So, what i need to write the whole physical sector (8 lba) to trigger sector relocation. Like doing simple: |dd if=/dev/zero of=/dev/ada2 bs=4096 count=1 seek=CALCULATED_VALUE then do fsync to really make it write to hdd However, i need to know what file is damaged. So, now to the questions/ | QUESTIONS: 1) Why smart report does not show LBA in the test result table? 2) Is my logic correct? 3) How do i find what file is using LBA/SECTOR ? 4) I se that there are 9 pending sectors. Is it physical sectors or LBA? If LBA then okay, it matches one physical sector, but if it is physical sector tben how to get a list of them? Artem