FreeBSD src
Go to file
Kenneth D. Merry a1736be349 Improve camcontrol(8) handling of drive defect data.
This includes a new summary mode (-s) for camcontrol defects that
quickly tells the user the most important thing: how many defects
are in the requested list.  The actual location of the defects is
less important.

Modern drives frequently have more than the 8191 defects that can
be reported by the READ DEFECT DATA (10) command.  If they don't
have that many grown defects, they certainly have more than 8191
defects in the primary (i.e. factory) defect list.

The READ DEFECT DATA (12) command allows for longer parameter
lists, as well as indexing into the list of defects, and so allows
reporting many more defects.

This has been tested with HGST drives and Seagate drives, but
does not fully work with Seagate drives.  Once I have a Seagate
spec I may be able to determine whether it is possible to make it
work with Seagate drives.

scsi_da.h:	Add a definition for the new long block defect
		format.

		Add bit and mask definitions for the new extended
		physical sector and bytes from index defect
		formats.

		Add a prototype for the new scsi_read_defects() CDB
		building function.

scsi_da.c:	Add a new scsi_read_defects() CDB building function.
		camcontrol(8) was previously composing CDBs manually.
		This is long overdue.

camcontrol.c:	Revamp the camcontrol defects subcommand.  We now
		go through multiple stages in trying to get defect
		data off the drive while avoiding various drive
		firmware quirks.

		We start off by requesting the defect header with
		the 10 byte command.  If we're in summary mode (-s)
		and the drive reports fewer defects than can be
		represented in the 10 byte header, we're done.
		Otherwise, we know that we need to issue the
		12 byte command if the drive reports the maximum
		number of defects.

		If we're in summary mode, we're done if we get a
		good response back when asking for the 12 byte header.

		If the user has asked for the full list, then we
		use the address descriptor index field in the 12
		byte CDB to step through the list in 64K chunks.
		64K is small enough to work with most any ancient
		or modern SCSI controller.

		Add support for printing the new long block defect
		format, as well as the extended physical sector and
		bytes from index formats.  I don't have any drives
		that support the new formats.

		Add a hexadecimal output format that can be turned
		on with -X.

		Add a quiet mode (-q) that can be turned on with
		the summary mode (-s) to just print out a number.

		Revamp the error detection and recovery code for
		the defects command to work with HGST drives.

		Call the new scsi_read_defects() CDB building
		function instead of rolling the CDB ourselves.

		Pay attention to the residual from the defect list
		request when printing it out, so we don't run off
		the end of the list.

		Use the new scsi_nv library routines to convert
		from strings to numbers and back.

camcontrol.8:	Document the new defect formats (longblock, extbfi,
		extphys) and command line options (-q, -s, -S and
		-X) for the defects subcommand.

		Explain a little more about what drives generally
		do and don't support.

Sponsored by:	Spectra Logic
MFC after:	1 week
2015-01-08 16:58:40 +00:00
bin Install d_align.{in,out} for the :align test 2015-01-05 20:38:47 +00:00
cddl Use the correct state name for unavailable pools in zpool list 2014-12-31 04:11:29 +00:00
contrib Add makefile for the "osmtest" utility. While at it: 2015-01-08 14:45:54 +00:00
crypto Merge OpenSSL 1.0.1j. 2014-10-15 19:12:05 +00:00
etc Make /net use -intr by default. Linux does that, and it seems a good idea. 2015-01-08 16:35:09 +00:00
games Update factor for changes to types in primes, which is a dependency. 2014-09-27 10:57:34 +00:00
gnu Add pregenerated documentation for as(1) and ld(1) 2015-01-04 00:58:30 +00:00
include Deorbit the IEEE-488/GPIB support. 2014-12-25 20:15:13 +00:00
kerberos5 Remove GNU texinfo from base along with all info pages. 2015-01-02 18:45:03 +00:00
lib Fix WITH_LLDB build 2015-01-08 14:26:49 +00:00
libexec Apply r246556 to powerpc: 2015-01-06 03:49:22 +00:00
release Switch to x11/gnome3 now that x11/gnome2 no 2015-01-08 15:50:10 +00:00
rescue Add sleep(1) to /rescue. This adds 664 bytes to the binary on amd64 but 2014-12-03 01:34:24 +00:00
sbin Improve camcontrol(8) handling of drive defect data. 2015-01-08 16:58:40 +00:00
secure Reduce overlinking 2014-11-25 22:25:13 +00:00
share Add myself (arybchik) to committers-src.dot 2015-01-08 05:46:16 +00:00
sys Improve camcontrol(8) handling of drive defect data. 2015-01-08 16:58:40 +00:00
tests Vendor import of tcpdump 4.6.2. 2015-01-06 19:03:11 +00:00
tools Drop 'new' from the description of NFSCL to match the recent change in 2015-01-08 15:20:42 +00:00
usr.bin sed: Address warnings with clang and gcc48. 2015-01-08 16:33:15 +00:00
usr.sbin MFV r276761: tcpdump 4.6.2. 2015-01-07 19:55:18 +00:00
.arcconfig Update the URL to the phabricator instance. 2014-08-14 16:25:43 +00:00
.arclint arc: add linting for python files 2014-06-02 00:21:42 +00:00
COPYRIGHT Bump copyright year. 2014-12-31 10:00:43 +00:00
LOCKS Explicitly require Security Officer's approval for kernel PRNG bits. 2013-09-17 14:19:05 +00:00
MAINTAINERS Remove cokane@ from MAINTAINERS for 3dfx(4)/tdfx(4) because their email 2014-11-25 05:25:12 +00:00
Makefile Import OpenSSL 1.0.1j. 2014-10-15 17:32:57 +00:00
Makefile.inc1 Remove GNU texinfo from base along with all info pages. 2015-01-02 18:45:03 +00:00
ObsoleteFiles.inc Integrate sbin/ifconfig/tests from NetBSD into atf/kyua 2015-01-04 22:25:16 +00:00
README Vendor import of tcpdump 4.6.2. 2015-01-06 19:03:11 +00:00
UPDATING Use a set of ELF Tool Chain tools by default 2015-01-07 22:02:37 +00:00

This is the top level of the FreeBSD source directory.  This file
was last revised on:
$FreeBSD$

For copyright information, please see the file COPYRIGHT in this
directory (additional copyright information also exists for some
sources in this tree - please see the specific source directories for
more information).

The Makefile in this directory supports a number of targets for
building components (or all) of the FreeBSD source tree, the most
commonly used one being ``world'', which rebuilds and installs
everything in the FreeBSD system from the source tree except the
kernel, the kernel-modules and the contents of /etc.  The ``world''
target should only be used in cases where the source tree has not
changed from the currently running version.  See:
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html
for more information, including setting make(1) variables.

The ``buildkernel'' and ``installkernel'' targets build and install
the kernel and the modules (see below).  Please see the top of
the Makefile in this directory for more information on the
standard build targets and compile-time flags.

Building a kernel is a somewhat more involved process, documentation
for which can be found at:
   http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html
And in the config(8) man page.
Note: If you want to build and install the kernel with the
``buildkernel'' and ``installkernel'' targets, you might need to build
world before.  More information is available in the handbook.

The sample kernel configuration files reside in the sys/<arch>/conf
sub-directory (assuming that you've installed the kernel sources), the
file named GENERIC being the one used to build your initial installation
kernel.  The file NOTES contains entries and documentation for all possible
devices, not just those commonly used.  It is the successor of the ancient
LINT file, but in contrast to LINT, it is not buildable as a kernel but a
pure reference and documentation file.


Source Roadmap:
---------------
bin		System/user commands.

cddl		Various commands and libraries under the Common Development
		and Distribution License.

contrib		Packages contributed by 3rd parties.

crypto		Cryptography stuff (see crypto/README).

etc		Template files for /etc.

games		Amusements.

gnu		Various commands and libraries under the GNU Public License.
		Please see gnu/COPYING* for more information.

include		System include files.

kerberos5	Kerberos5 (Heimdal) package.

lib		System libraries.

libexec		System daemons.

release		Release building Makefile & associated tools.

rescue		Build system for statically linked /rescue utilities.

sbin		System commands.

secure		Cryptographic libraries and commands.

share		Shared resources.

sys		Kernel sources.

tools		Utilities for regression testing and miscellaneous tasks.

usr.bin		User commands.

usr.sbin	System administration commands.


For information on synchronizing your source tree with one or more of
the FreeBSD Project's development branches, please see:

  http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/synching.html