From owner-freebsd-fs@freebsd.org Wed Feb 17 21:37:52 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 3359A533FFF for ; Wed, 17 Feb 2021 21:37:52 +0000 (UTC) (envelope-from Walter.von.Entferndt@posteo.net) Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.66]) (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 4DgrmH0kFrz3jSH for ; Wed, 17 Feb 2021 21:37:50 +0000 (UTC) (envelope-from Walter.von.Entferndt@posteo.net) Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 7BEB12400FB for ; Wed, 17 Feb 2021 22:37:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1613597868; bh=WNfhFSZUcTpk7nA1WXfRMGHcyLsq9B6m4h8DoT5J+T0=; h=From:To:Cc:Subject:Date:From; b=mJabhBPSHx7DwL8Nk6CLZAK3w/RBwVrDSfOA4qgIfblHc5kzTPTy3MNKm1PkXDVTC htzmz+NCoXvtEKU/G/tHSD4Z17ifUT/dBW5XPh13ft+BBkReJPFEGc/b7DN17PII6O wAaYQ5uFNhYuXbR/ECiQ/0ue/EJW8uR977INQRFQhAp9ARrPRLw3T3vaP0dDbZBMlH HNMQbDx/yLhvBgLpvWgJN6+KXsHaPWARW6rAD4+uRq8frxdUTAmCLRRAVhDJAaLqW7 MwIS3JQ1u8PC/k2NqGz7kp4WVAojD7N1D8pFIKORjRFnRC1XRVhldecitB+QB3bOeO 0jrNuS25ULM/w== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4DgrmC3D40z9rxT; Wed, 17 Feb 2021 22:37:47 +0100 (CET) From: Walter von Entferndt To: artem@artem.ru Cc: freebsd-fs@freebsd.org Subject: Re: Simulating bad sectors on file based storage device. How? Date: Wed, 17 Feb 2021 22:37:37 +0100 Message-ID: <2038526.4WAli8B44Z@t450s.local.lan> X-Face: #$[hC+4[4W*mS3hB&izisyT_#E]^Aq+7Isv`2Tu5q*1~jR@&['74B>Ibyrk]GTJ!j$ NjX=#L2#k2X7OnaaRM_Pd5`>`8OJ3; +I2 References: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Rspamd-Queue-Id: 4DgrmH0kFrz3jSH X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=posteo.net header.s=2017 header.b=mJabhBPS; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (mx1.freebsd.org: domain of Walter.von.Entferndt@posteo.net designates 185.67.36.66 as permitted sender) smtp.mailfrom=Walter.von.Entferndt@posteo.net X-Spamd-Result: default: False [-3.20 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; RWL_MAILSPIKE_GOOD(0.00)[185.67.36.66:from]; R_SPF_ALLOW(-0.20)[+ip4:185.67.36.0/23]; TO_DN_NONE(0.00)[]; RCVD_DKIM_ARC_DNSWL_MED(-0.50)[]; RCVD_COUNT_THREE(0.00)[3]; RCVD_IN_DNSWL_MED(-0.20)[185.67.36.66:from]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[posteo.net,none]; DKIM_TRACE(0.00)[posteo.net:+]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; CTE_CASE(0.50)[]; ASN(0.00)[asn:8495, ipnet:185.67.36.0/23, country:DE]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[posteo.net:s=2017]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-fs@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-fs] 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: Wed, 17 Feb 2021 21:37:52 -0000 At Mittwoch, 17. Februar 2021, 13:00:02 CET, Artem Kuchin wrote: > 15.02.2021 20:44, Alan Somers ?????: > > If you have SCSI disks, you can inject errors with `sysctl > > kern.cam.da.0.error_inject`.? If not, you can use gnop(8) to > > simulate a flaky disk. > > gnop only allows to set probability, but i need an exact block in an > exact place. > Then RTSL & adjust a few lines in the source of gnop(8) (/usr/src/sys/ geom/nop/g_nop.c, the error is inserted @line 158-167). Search for "failprob". It's very straightforward to adopt that and mimic a fail- on-specific-block# by copy & paste & adjust that functionality. Obviously you'll have to recompile all userland software that accesses the gnop(4), but these should be very few to none. -- =|o) "Stell' Dir vor es geht und keiner kriegt's hin." (Wolfgang Neuss)