From owner-freebsd-fs@freebsd.org Wed Feb 17 19:22:16 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 C9C9B52D8F7 for ; Wed, 17 Feb 2021 19:22:16 +0000 (UTC) (envelope-from ira@wakeful.net) Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dgnlr5BKKz3F47 for ; Wed, 17 Feb 2021 19:22:16 +0000 (UTC) (envelope-from ira@wakeful.net) Received: by mail-wr1-x42a.google.com with SMTP id g6so18547410wrs.11 for ; Wed, 17 Feb 2021 11:22:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wakeful-net.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4YuPDE/9CnHQWtqFa3kw6YgdJg6URzAQagkXU16Jf38=; b=CfaVfYOgCs3oQKU7s1FgBkvjasUFuW0uugx5EgIzeOOkV1EW0LBr50oHuSgTTBRo0L Grr3FPWuB6DWqVWdqKKSSCU/siovSUDuMU1IlkHS/xGflh9cohAB83lDtuMl19Gj8v85 kn8UqeW8lN59zIhvHmX3lsMYKC2h0CkPvwl83kEHU0l/4PiUo+tAEo9beu8gcNNuxL5m 7LgOE3jRW43sX25aN9H5k1Xp4r1MEAVquG6cH9v6A8eUCWulR1fXxfGAbtve7E5NAG9N PksuQYgVJ/l7AKgTm6JkbLG3Poe9Z0x5Kn6GWUZSlNTf2EuxJlR+jeyXKlmEbg1AucQ0 uS/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4YuPDE/9CnHQWtqFa3kw6YgdJg6URzAQagkXU16Jf38=; b=qrOqUzE+7rS2W7pOpQJrk87Fw4zvR0tXlI0dge4DV0wzXBy9yHroD4CURk+5TD0kVD gxOFxrZtqVeY87MT8c6VLkfzvMIRPRbPuvIfARzvSDtvbbslNs4tllBIfomUjTuajZUQ 8IGuM3BbKC0ONqSf5N4EeECBnwt5EoY+09bHYeQOXRnu1r2SmQMJV0J1pNqXAceoH3Pi NK9U700ofASHRWdgv9hgFiM7a7We7e3+Ma9HqVJ0Xhic4e/q43r0AOLdEFUU0GOqv5qc eFGfDpfwRfwmFFkv+KyDjFcCxLXj65hjaJeFnvSFnOkMXxruIJdjCjTvkKBqnasmyDBc 1qMg== X-Gm-Message-State: AOAM533CPxuSWftwGWHPUKDN6i8r2zhpHrPWEcCsYCoEiPi30GgMqkRe Oo5MFQdzLvvDziCV0pCVRRe4TkXrtYbNET67p1E3K+bT+fiWIo5P X-Google-Smtp-Source: ABdhPJyiTcVRFGqlW2TE6wLRrHUjn7TRY2KFDCJjL8Pn5dFO3INHRSDp74KYM8f+im4a11g8noAGEovUP3U7l58Htys= X-Received: by 2002:adf:bac8:: with SMTP id w8mr725451wrg.68.1613589734683; Wed, 17 Feb 2021 11:22:14 -0800 (PST) MIME-Version: 1.0 References: <7DBD44C9-AB81-43AB-94C9-212577A765B3@panasas.com> In-Reply-To: <7DBD44C9-AB81-43AB-94C9-212577A765B3@panasas.com> From: Ira Cooper Date: Wed, 17 Feb 2021 14:22:04 -0500 Message-ID: Subject: Re: Simulating bad sectors on file based storage device. How? To: Ravi Pokala Cc: "freebsd-fs@freebsd.org" X-Rspamd-Queue-Id: 4Dgnlr5BKKz3F47 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 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 19:22:16 -0000 A suggestion: Use ISCSI to emulate the SCSI layer, and use the target to emulate the errors you want to emulate. I believe the ports collection has at least one userland target in it. -Ira On Wed, Feb 17, 2021 at 2:02 PM Ravi Pokala wrote: > -----Original Message----- > Date: Tue, 16 Feb 2021 16:05:03 +0300 > From: Artem Kuchin > To: Alan Somers > Cc: freebsd-fs > Subject: Re: Simulating bad sectors on file based storage device. How? > Message-ID: <46b52475-385f-5931-f425-fd546dd5b377@artem.ru> > Content-Type: text/plain; charset=utf-8; format=flowed > > gnope only allows to set probability, but i need an exact block in an > exact place. > > ATA, NVMe, and SCSI all have commands to mark specific ranges of logical > sectors as unreadable. > > - ATA: WRITE_UNCORRECTABLE_EXT (has both report-failure-instantly and > perform-real-error-recovery-before-reporting-failure modes) > > - NVMe: Write Uncorrectable > > - SCSI: WRITE_LONG (has both report-failure-instantly and > perform-real-error-recovery-before-reporting-failure modes) > > The base system does not contain programs to issue those commands > specifically, but the commands can be assembled by hand and sent to the > drive via `camcontrol cmd' (ATA, SCSI) or `nvmecontrol io-passthru' (NVMe). > Obviously, assembling those commands would require spending some time with > the ATA specs from t13.org, the NVMe specs from nvme.org, or the SCSI > "Block Commands" spec from t10.org. > > It should go without saying that those commands are dangerous, because by > definition they destroy data. Use with caution after deep study of the docs > in question. > > -Ravi (rpokala@) > > > 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. > > > > On Mon, Feb 15, 2021 at 10:36 AM Artem Kuchin > > wrote: > > > > Hello! > > > > Is there a way to build a file base storage device (for example, > file > > based zfs mirror) and then simulate a bad sector for one of the > > mirror > > sides? > > > > Artem > > > > _______________________________________________ > freebsd-fs@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-fs > To unsubscribe, send any mail to "freebsd-fs-unsubscribe@freebsd.org" >