On 20 February 2016 at 12:23, Tinker <ti...@openmailbox.org> wrote: > > On 2016-02-21 01:29, Karel Gardas wrote: >> >> scrub is IIRC not supported by any softraid yet. > > > But there's "patrol"! > > "bioctl -t start mysoftraid"
[...] > On 2016-02-21 02:44, Constantine A. Murenin wrote: >> >> On 20 February 2016 at 10:29, Karel Gardas <gard...@gmail.com> wrote: >>> >>> scrub is IIRC not supported by any softraid yet. Rebuild by all which >>> support redundancy. Marcus recommendation to read man pages can just >>> be highlighted here. Otherwise just read the code for ultimate >>> reference of what is or is not done. >> >> >> Scrub cannot possibly be supported due to the design of the softraid: >> >> http://mdoc.su/o/softraid.4 >> >>>>>> The RAID 1 discipline does not initialize the mirror upon creation. >>>>>> This is by design because all sectors that are read are written first. >>>>>> There >>>>>> is no point in wasting a lot of time syncing random data. >> >> >> IIRC, other raid disciplines are not that much different, either. >> >> E.g., a scrub implementation would have to be implemented on top of >> the filesystem, and would have to be able to temporarily force the >> reads to be done from a certain chunk only. >> >> Long-term, it'll probably be easier to re-do the logic to actually >> zero-out all the unused sectors, if scrub support is deemed important. >> Which is why things like ZFS are superior due to having the awareness >> of the underlying storage blocks. > > > Wait, I don't see the philosophical problem that you seem to be highlighting > here ("sectors are .. written first" and "on top of the filesystem" and > "forcing reads to be done from a certain chunk only"), what am I > missing/what is it that I don't understand? When you do http://mdoc.su/o/newfs.8, it does not write to every sector of the underlying partition; thus you cannot expect all sectors to be the same. > > > Also, so you mean that "patrol" even if it's in the manual is not supported > for RAID1 nor for RAID1C nor for RAID5 or any other raid discipline. Looking > forward to see what Marcus says & test myself & read code. Heh, I didn't even know about this "patrol"; learn something new every day! A BXR.SU for "patrol" has a few MFI(4) hits across the BSDs, and ultimately reveals the `bioc_patrol` symbol (well, a struct, really, http://bxr.su/o/sys/dev/biovar.h#bioc_patrol), a search of which reveals that http://bxr.su/o/sys/dev/ic/mfi.c#mfi_ioctl_patrol is the only driver reference for this symbol. So, I don't think you'll be getting any patrol from softraid(4); it was added very recently by uebayasi@ on 2015-05-29, based on mfiutil from FreeBSD (http://mdoc.su/f/mfiutil.8), and only for mfi(4). C.