Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Feb 2021 22:37:37 +0100
From:      Walter von Entferndt <walter.von.entferndt@posteo.net>
To:        artem@artem.ru
Cc:        freebsd-fs@freebsd.org
Subject:   Re: Simulating bad sectors on file based storage device. How?
Message-ID:  <2038526.4WAli8B44Z@t450s.local.lan>
In-Reply-To: <mailman.67.1613563202.46674.freebsd-fs@freebsd.org>
References:  <mailman.67.1613563202.46674.freebsd-fs@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
At Mittwoch, 17. Februar 2021, 13:00:02 CET, Artem Kuchin 
<artem@artem.ru> 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)





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2038526.4WAli8B44Z>