freebsd-skq/sbin
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
..
adjkerntz use .Mt to mark up email addresses consistently (part1) 2014-06-20 09:40:43 +00:00
atm Convert sbin/ to LIBADD 2014-11-25 11:23:12 +00:00
badsect Convert sbin/ to LIBADD 2014-11-25 11:23:12 +00:00
bsdlabel mdoc: remove EOL whitespace. 2014-12-29 13:50:59 +00:00
camcontrol Improve camcontrol(8) handling of drive defect data. 2015-01-08 16:58:40 +00:00
casperd Convert sbin/ to LIBADD 2014-11-25 11:23:12 +00:00
ccdconfig Convert sbin/ to LIBADD 2014-11-25 11:23:12 +00:00
clri
comcontrol A number of places in the source tree still reference cuad.* after 2012-12-08 22:16:36 +00:00
conscontrol Add references to vt(4) to further man-pages. 2014-09-01 16:25:08 +00:00
ddb Convert sbin/ to LIBADD 2014-11-25 11:23:12 +00:00
devd Convert sbin/ to LIBADD 2014-11-25 11:23:12 +00:00
devfs Clarify how "hide" and "unhide" commands work on directories. 2013-07-12 06:03:25 +00:00
dhclient mdoc: improvements to SEE ALSO. 2014-12-27 08:22:58 +00:00
dmesg Convert sbin/ to LIBADD 2014-11-25 11:23:12 +00:00
dump Fix a bug which could break extended attributes in a dump output. 2014-09-10 22:37:20 +00:00
dumpfs Convert sbin/ to LIBADD 2014-11-25 11:23:12 +00:00
dumpon Revert r156046. We support setting dumpdev via loader tunable again. 2014-10-08 12:19:48 +00:00
etherswitchcfg Check the number of returned entries before doing any access to ifm_ulist. 2014-07-05 20:16:02 +00:00
fdisk Convert sbin/ to LIBADD 2014-11-25 11:23:12 +00:00
fdisk_pc98 Convert sbin/ to LIBADD 2014-11-25 11:23:12 +00:00
ffsinfo Adjust printf format specifiers for dev_t and ino_t in user space. 2014-12-17 07:10:48 +00:00
fsck Recommit r274750. 2014-11-21 01:43:55 +00:00
fsck_ffs Remove old ioctl use and support, once and for all. 2015-01-06 05:28:37 +00:00
fsck_msdosfs Make UEFI booting of 4Kn disks work: 2014-10-30 15:52:01 +00:00
fsdb Convert sbin/ to LIBADD 2014-11-25 11:23:12 +00:00
fsirand Remove old ioctl use and support, once and for all. 2015-01-06 05:28:37 +00:00
gbde Convert sbin/ to LIBADD 2014-11-25 11:23:12 +00:00
geom mdoc: remove EOL whitespace. 2014-12-29 13:50:59 +00:00
ggate Convert sbin/ to LIBADD 2014-11-25 11:23:12 +00:00
growfs Convert sbin/ to LIBADD 2014-11-25 11:23:12 +00:00
gvinum Convert sbin/ to LIBADD 2014-11-25 11:23:12 +00:00
hastctl Convert sbin/ to LIBADD 2014-11-25 11:23:12 +00:00
hastd mdoc: paragraph improvements. 2015-01-04 12:49:24 +00:00
ifconfig Integrate sbin/ifconfig/tests from NetBSD into atf/kyua 2015-01-04 22:25:16 +00:00
init Convert sbin/ to LIBADD 2014-11-25 11:23:12 +00:00
ipf Convert sbin/ to LIBADD 2014-11-25 11:23:12 +00:00
ipfw mdoc: remove EOL whitespace. 2014-12-29 13:50:59 +00:00
iscontrol mdoc: remove EOL whitespace. 2014-12-29 13:50:59 +00:00
kldconfig use .Mt to mark up email addresses consistently (part1) 2014-06-20 09:40:43 +00:00
kldload use .Mt to mark up email addresses consistently (part1) 2014-06-20 09:40:43 +00:00
kldstat use .Mt to mark up email addresses consistently (part1) 2014-06-20 09:40:43 +00:00
kldunload use .Mt to mark up email addresses consistently (part1) 2014-06-20 09:40:43 +00:00
ldconfig Add a comment about why aout support is still here: We need it for 2013-03-19 16:57:04 +00:00
md5 Convert sbin/ to LIBADD 2014-11-25 11:23:12 +00:00
mdconfig Convert sbin/mdconfig/tests from prove format tests to ATF format tests 2014-11-27 06:04:00 +00:00
mdmfs Remove trailing whitespace per mdoc lint warning 2012-03-29 05:02:12 +00:00
mknod Fix some more warnings found by clang. 2010-11-22 20:10:48 +00:00
mksnap_ffs Change file permissions for some setuid executables so they are "o+r". 2014-08-21 19:04:15 +00:00
mount mdoc: improvements to SEE ALSO. 2014-12-27 08:22:58 +00:00
mount_cd9660 Convert sbin/ to LIBADD 2014-11-25 11:23:12 +00:00
mount_fusefs mdoc: improvements to SEE ALSO. 2014-12-27 08:22:58 +00:00
mount_msdosfs Convert sbin/ to LIBADD 2014-11-25 11:23:12 +00:00
mount_nfs mdoc: remove EOL whitespace. 2014-12-29 13:50:59 +00:00
mount_nullfs GC unused variables. Prefer NULL over 0 for pointers. 2013-03-05 22:41:35 +00:00
mount_udf Convert sbin/ to LIBADD 2014-11-25 11:23:12 +00:00
mount_unionfs use .Mt to mark up email addresses consistently (part1) 2014-06-20 09:40:43 +00:00
nandfs Convert sbin/ to LIBADD 2014-11-25 11:23:12 +00:00
natd Convert sbin/ to LIBADD 2014-11-25 11:23:12 +00:00
newfs Remove old ioctl use and support, once and for all. 2015-01-06 05:28:37 +00:00
newfs_msdos Remove old ioctl use and support, once and for all. 2015-01-06 05:28:37 +00:00
newfs_nandfs Convert sbin/ to LIBADD 2014-11-25 11:23:12 +00:00
nfsiod
nos-tun use .Mt to mark up email addresses consistently (part1) 2014-06-20 09:40:43 +00:00
nvmecontrol use .Mt to mark up email addresses consistently (part1) 2014-06-20 09:40:43 +00:00
pfctl Convert sbin/ to LIBADD 2014-11-25 11:23:12 +00:00
pflogd Convert sbin/ to LIBADD 2014-11-25 11:23:12 +00:00
ping Convert sbin/ to LIBADD 2014-11-25 11:23:12 +00:00
ping6 Add ability to not specify a zone identifier twice, when both source and 2014-12-16 14:59:20 +00:00
quotacheck Convert sbin/ to LIBADD 2014-11-25 11:23:12 +00:00
rcorder Convert sbin/ to LIBADD 2014-11-25 11:23:12 +00:00
reboot Reference uefi(8) from i386 boot(8) 2014-11-14 20:12:33 +00:00
recoverdisk use .Mt to mark up email addresses consistently (part1) 2014-06-20 09:40:43 +00:00
resolvconf Add resolvconf(8) which manages resolv.conf. 2011-03-18 12:18:52 +00:00
restore When restoring a UFS dump onto a ZFS filesystem, an assertion in 2014-07-30 14:52:04 +00:00
route Finish r274175: do control plane MTU tracking. 2014-11-17 01:05:29 +00:00
routed Belatedly commit the patch for SA-14:21 to head. It was not committed to 2015-01-03 01:52:06 +00:00
rtsol NO_MAN= has been deprecated in favor of MAN= for some time, go ahead 2014-04-13 05:21:56 +00:00
savecore Convert sbin/ to LIBADD 2014-11-25 11:23:12 +00:00
sconfig use .Mt to mark up email addresses consistently (part1) 2014-06-20 09:40:43 +00:00
setkey Convert sbin/ to LIBADD 2014-11-25 11:23:12 +00:00
shutdown sbin/shutdown: Support time units as in 'shutdown -r +5sec' 2014-12-16 08:29:02 +00:00
spppcontrol
sunlabel Convert sbin/ to LIBADD 2014-11-25 11:23:12 +00:00
swapon Convert sbin/ to LIBADD 2014-11-25 11:23:12 +00:00
sysctl Fix inverted logic introduced in r272154. 2014-12-01 20:51:01 +00:00
tests Migrate tools/regression/sbin/ to the new tests layout. 2014-03-16 02:07:08 +00:00
tunefs Convert sbin/ to LIBADD 2014-11-25 11:23:12 +00:00
umount Cross-reference autounmountd(8) from umount(8). 2014-11-22 16:46:00 +00:00
Makefile Use src.opts.mk in preference to bsd.own.mk except where we need stuff 2014-05-06 04:22:01 +00:00
Makefile.amd64 Integrate nvmecontrol(8) into the amd64 and i386 builds. 2012-09-17 21:41:38 +00:00
Makefile.arm MF tbemd: Move to using Makefile.arch to select what to build. 2010-09-13 02:25:21 +00:00
Makefile.i386 Integrate nvmecontrol(8) into the amd64 and i386 builds. 2012-09-17 21:41:38 +00:00
Makefile.inc Use src.opts.mk in preference to bsd.own.mk except where we need stuff 2014-05-06 04:22:01 +00:00
Makefile.mips MF tbemd: Move to using Makefile.arch to select what to build. 2010-09-13 02:25:21 +00:00
Makefile.pc98 MF tbemd: Move to using Makefile.arch to select what to build. 2010-09-13 02:25:21 +00:00
Makefile.sparc64 MF tbemd: Move to using Makefile.arch to select what to build. 2010-09-13 02:25:21 +00:00