Skip to main content
Sign in
Snippets Groups Projects
Commit 29e6e5f4 authored by (no author)'s avatar (no author)
Browse files

This commit was manufactured by cvs2svn to create branch

'unlabeled-1.160.2'.

git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/branches/unlabeled-1.160.2@1869 4ea69e1a-61f1-4043-bf83-b5c94c648137
parent e97cabc1
Branches
No related tags found
No related merge requests found
Showing with 0 additions and 7993 deletions
$Id: WARNINGS,v 1.30 2004/07/17 23:19:00 geoffk1 Exp $
The most recent version of this file can be found here:
http://cvs.sourceforge.net/viewcvs.py/smartmontools/sm5/WARNINGS?view=markup
The following are reports of serious problems (eg system lockup) which
were due to smartmontools. There are DARWIN, LINUX, FREEBSD, SOLARIS
and WINDOWS sections below.
LINUX
-----
You may also wish to search the linux-kernel mailing list for problem
reports concerning smartmontools. Here is the URL:
http://groups.google.com/groups?as_q=smartmontools&safe=images&ie=UTF-8&oe=UTF-8&as_ugroup=linux.kernel&lr=&num=100&hl=en
SYSTEM: Any system with USB ports and USB storage devices
PROBLEM: Using smartd/smartctl on USB "SCSI" storage devices can cause kernel hang
REPORTER: see link below
LINK: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=107615
NOTE: USB storage devices are handled as SCSI devices by the kernel. But many of these
devices do not comply with SCSI specs, and can cause the kernel to hang.
Avoid using smartd/smartctl on these devices (they don't do SMART anyway).
In particular, the use of smartd DEVICESCAN in /etc/smartd.conf can cause
these devices (typically represented by /dev/sda or /dev/sdb) to hang, and
the kernel to lock up.
FIXED: This problem should be fixed in smartmontools-5.25 and greater.
SYSTEM: Intel 875WP1-E motherboard with SATA drives on motherboard's SATA ports
PROBLEM: smartd makes NTP time drift
REPORTER: nohez@cmie.com
LINK: http://groups.google.de/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&safe=off&selm=Pine.LNX.4.33.0310111545530.1047-100000%40venus.cmie.ernet.in.lucky.linux.kernel
NOTE: When using SATA disks, linux kernel k_smp-2.4.21-108 (SMP because
of hyper-threading) and xntp-4.1.1-177, the server time went
out of sync with system time. Problem goes away when SATA
disks removed.
SYSTEM: Dell servers using AACRAID (SCSI)
PROBLEM: Locked up, needed to be rebooted
REPORTER: drew@eastvan.bc.ca
LINK: http://sourceforge.net/mailarchive/forum.php?thread_id=1311313&forum_id=12495
SYSTEM: Box with Promise 20265 IDE-controller (pdc202xx-driver) and > 2.4.18 kernel with ide-taskfile support
PROBLEM: Smartctl locks system solid when used on /dev/hd[ef].
REPORTER: Georg Acher <acher@in.tum.de>
LINK: http://sourceforge.net/mailarchive/forum.php?thread_id=1457979&forum_id=12495
NOTE: Lockup doesn't happen with 2.4.18 kernel, and doesn't affect /dev/hd[a-d]
This appears to be a problem with the pdc202xx-driver and has been reported
to the pdcx maintainers. If you enable the Promise-BIOS (ATA100-BIOS) then
everything will work fine. But if you disable it, then the machine will hang.
SYSTEM: Box with Promise 20262 IDE-controller
PROBLEM: Smartctl locks system solid
REPORTER: Ben Low <ben@bdlow.net>
LINK: http://sourceforge.net/mailarchive/message.php?msg_id=5074201
NOTE: Similar to previous report: Promise Ultra66 2-port card (20262) which, with
linux 2.4.20, suffers from the lockups reported above. But it was
impossible to enable the Promiste BIOS. A kernel patch is referenced
to fix the problem.
SYSTEM: Promise 20265 IDE-controller
PROBLEM: Smartctl locks system solid when used on CDROM/DVD device
REPORTER: see link below
LINK: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=208964
NOTE: Problem seems to affect kernel 2.4.21 only.
SYSTEM: Promise IDE-controllers and perhaps others also
PROBLEM: System freezes under heavy load, perhaps when running SMART commands
REPORTER: Mario 'BitKoenig' Holbe Mario.Holbe@RZ.TU-Ilmenau.DE
LINK: http://groups.google.de/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=1wUXW-2FA-9%40gated-at.bofh.it
NOTE: Before freezing, SYSLOG shows the following message(s)
kernel: hdf: dma timer expiry: dma status == 0xXX
where XX is two hexidecimal digits. This may be a kernel bug
or an underlying hardware problem. It's not clear if
smartmontools plays a role in provoking this problem. FINAL
NOTE: Problem was COMPLETELY resolved by replacing the power
supply. See URL above, entry on May 29, 2004 by Holbe. Other
things to try are exchanging cables, and cleaning PCI slots.
FREEBSD
-------
[No problem reports yet.]
SOLARIS
-------
[No problem reports yet.]
CYGWIN and WINDOWS
------------------
SYSTEM: Any Windows 2000 or XP system.
PROBLEM: Use of an undocumented system call for IDE/ATA read log
(smartctl -l, --log, -a, --all) may affect system stability.
REPORTER: Christian Franke <smartmontools-support@lists.sourceforge.net>
NOTE: The IOCTL call SMART_RCV_DRIVE_DATA does not support
ATA_SMART_READ_LOG_SECTOR on NT4/2000/XP. The Win32
implementation of smartctl/smartd uses the undocumented
and possibly buggy IOCTL_IDE_PASS_THROUGH for this purpose.
This IOCTL is not implemented under NT4.
Invalid log output has been reported for at least one
W2K system.
DARWIN
------
SYSTEM: Any system up to at least 7H63
PROBLEM: Can't switch off SMART, can't switch off auto-save, can't run
short tests.
REPORTER: Geoff Keating <geoffk@geoffk.org>
NOTE: There's a bug in the system library: when you ask it to
do any of these things, it does the inverse (switches on,
runs extended tests). Radar 3727283.
/*
* atacmdnames.c
*
* This module is based on the T13/1532D Volume 1 Revision 3 (ATA/ATAPI-7)
* specification, which is available from http://www.t13.org/#FTP_site
*
* Home page of code is: http://smartmontools.sourceforge.net
* Address of support mailing list: smartmontools-support@lists.sourceforge.net
*
* Copyright (C) 2003-4 Philip Williams
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* You should have received a copy of the GNU General Public License
* (for example COPYING); if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
#include "atacmdnames.h"
#include <stdlib.h>
#include <stdio.h>
#define COMMAND_TABLE_SIZE 256
const char *atacmdnames_c_cvsid="$Id: atacmdnames.c,v 1.11 2004/01/02 16:05:24 ballen4705 Exp $" ATACMDNAMES_H_CVSID;
const char cmd_reserved[] = "[RESERVED]";
const char cmd_vendor_specific[] = "[VENDOR SPECIFIC]";
const char cmd_reserved_sa[] = "[RESERVED FOR SERIAL ATA]";
const char cmd_reserved_cf[] = "[RESERVED FOR COMPACTFLASH ASSOCIATION]";
const char cmd_reserved_mcpt[] = "[RESERVED FOR MEDIA CARD PASS THROUGH]";
const char cmd_recalibrate_ret4[]= "RECALIBRATE [RET-4]";
const char cmd_seek_ret4[] = "SEEK [RET-4]";
const char *command_table[COMMAND_TABLE_SIZE] = {
/*-------------------------------------------------- 00h-0Fh -----*/
"NOP",
cmd_reserved,
cmd_reserved,
"CFA REQUEST EXTENDED ERROR CODE",
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
"DEVICE RESET",
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
/*-------------------------------------------------- 10h-1Fh -----*/
"RECALIBRATE [OBS-4]",
cmd_recalibrate_ret4,
cmd_recalibrate_ret4,
cmd_recalibrate_ret4,
cmd_recalibrate_ret4,
cmd_recalibrate_ret4,
cmd_recalibrate_ret4,
cmd_recalibrate_ret4,
cmd_recalibrate_ret4,
cmd_recalibrate_ret4,
cmd_recalibrate_ret4,
cmd_recalibrate_ret4,
cmd_recalibrate_ret4,
cmd_recalibrate_ret4,
cmd_recalibrate_ret4,
cmd_recalibrate_ret4,
/*-------------------------------------------------- 20h-2Fh -----*/
"READ SECTOR(S)",
"READ SECTOR(S) [OBS-5]",
"READ LONG (w/ retry) [OBS-4]",
"READ LONG (w/o retry) [OBS-4]",
"READ SECTOR(S) EXT",
"READ DMA EXT",
"READ DMA QUEUED EXT",
"READ NATIVE MAX ADDRESS EXT",
cmd_reserved,
"READ MULTIPLE EXT",
"READ STREAM DMA",
"READ STREAM PIO",
cmd_reserved,
cmd_reserved,
cmd_reserved,
"READ LOG EXT",
/*-------------------------------------------------- 30h-3Fh -----*/
"WRITE SECTOR(S)",
"WRITE SECTOR(S) [OBS-5]",
"WRITE LONG(w/ retry) [OBS-4]",
"WRITE LONG(w/o retry) [OBS-4]",
"WRITE SECTORS(S) EXT",
"WRITE DMA EXT",
"WRITE DMA QUEUED EXT",
"SET MAX ADDRESS EXT",
"CFA WRITE SECTORS WITHOUT ERASE",
"WRITE MULTIPLE EXT",
"WRITE STREAM DMA",
"WRITE STREAM PIO",
"WRITE VERIFY [OBS-4]",
"WRITE DMA FUA EXT",
"WRITE DMA QUEUED FUA EXT",
"WRITE LOG EXT",
/*-------------------------------------------------- 40h-4Fh -----*/
"READ VERIFY SECTOR(S)",
"READ VERIFY SECTOR(S) [OBS-5]",
"READ VERIFY SECTOR(S) EXT",
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
/*-------------------------------------------------- 50h-5Fh -----*/
"FORMAT TRACK [OBS-4]",
"CONFIGURE STREAM",
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
/*-------------------------------------------------- 60h-6Fh -----*/
cmd_reserved_sa,
cmd_reserved_sa,
cmd_reserved_sa,
cmd_reserved_sa,
cmd_reserved_sa,
cmd_reserved_sa,
cmd_reserved_sa,
cmd_reserved_sa,
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
/*-------------------------------------------------- 70h-7Fh -----*/
"SEEK [OBS-7]",
cmd_seek_ret4,
cmd_seek_ret4,
cmd_seek_ret4,
cmd_seek_ret4,
cmd_seek_ret4,
cmd_seek_ret4,
cmd_seek_ret4,
cmd_seek_ret4,
cmd_seek_ret4,
cmd_seek_ret4,
cmd_seek_ret4,
cmd_seek_ret4,
cmd_seek_ret4,
cmd_seek_ret4,
cmd_seek_ret4,
/*-------------------------------------------------- 80h-8Fh -----*/
cmd_vendor_specific,
cmd_vendor_specific,
cmd_vendor_specific,
cmd_vendor_specific,
cmd_vendor_specific,
cmd_vendor_specific,
cmd_vendor_specific,
"CFA TRANSLATE SECTOR [VS IF NO CFA]",
cmd_vendor_specific,
cmd_vendor_specific,
cmd_vendor_specific,
cmd_vendor_specific,
cmd_vendor_specific,
cmd_vendor_specific,
cmd_vendor_specific,
cmd_vendor_specific,
/*-------------------------------------------------- 90h-9Fh -----*/
"EXECUTE DEVICE DIAGNOSTIC",
"INITIALIZE DEVICE PARAMETERS [OBS-6]",
"DOWNLOAD MICROCODE",
cmd_reserved,
"STANDBY IMMEDIATE [RET-4]",
"IDLE IMMEDIATE [RET-4]",
"STANDBY [RET-4]",
"IDLE [RET-4]",
"CHECK POWER MODE [RET-4]",
"SLEEP [RET-4]",
cmd_vendor_specific,
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
/*-------------------------------------------------- A0h-AFh -----*/
"PACKET",
"IDENTIFY PACKET DEVICE",
"SERVICE",
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
/*-------------------------------------------------- B0h-BFh -----*/
"SMART",
"DEVICE CONFIGURATION",
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved_cf,
cmd_reserved_cf,
cmd_reserved_cf,
cmd_reserved_cf,
cmd_reserved_cf,
cmd_reserved_cf,
cmd_reserved_cf,
cmd_reserved_cf,
/*-------------------------------------------------- C0h-CFh -----*/
"CFA ERASE SECTORS [VS IF NO CFA]",
cmd_vendor_specific,
cmd_vendor_specific,
cmd_vendor_specific,
"READ MULTIPLE",
"WRITE MULTIPLE",
"SET MULTIPLE MODE",
"READ DMA QUEUED",
"READ DMA",
"READ DMA [OBS-5]",
"WRITE DMA",
"WRITE DMA [OBS-5]",
"WRITE DMA QUEUED",
"CFA WRITE MULTIPLE WITHOUT ERASE",
"WRITE MULTIPLE FUA EXT",
cmd_reserved,
/*-------------------------------------------------- D0h-DFh -----*/
cmd_reserved,
"CHECK MEDIA CARD TYPE",
cmd_reserved_mcpt,
cmd_reserved_mcpt,
cmd_reserved_mcpt,
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
cmd_reserved,
"GET MEDIA STATUS",
"ACKNOWLEDGE MEDIA CHANGE [RET-4]",
"BOOT POST-BOOT [RET-4]",
"BOOT PRE-BOOT [RET-4]",
"MEDIA LOCK",
"MEDIA UNLOCK",
/*-------------------------------------------------- E0h-EFh -----*/
"STANDBY IMMEDIATE",
"IDLE IMMEDIATE",
"STANDBY",
"IDLE",
"READ BUFFER",
"CHECK POWER MODE",
"SLEEP",
"FLUSH CACHE",
"WRITE BUFFER",
"WRITE SAME [RET-4]", /* Warning! This command is retired but the value of
f_reg is used in look_up_ata_command(). If this
command code is reclaimed in a future standard then
be sure to update look_up_ata_command(). */
"FLUSH CACHE EXIT",
cmd_reserved,
"IDENTIFY DEVICE",
"MEDIA EJECT",
"IDENTIFY DEVICE DMA [OBS-4]",
"SET FEATURES",
/*-------------------------------------------------- F0h-FFh -----*/
cmd_vendor_specific,
"SECURITY SET PASSWORD",
"SECURITY UNLOCK",
"SECURITY ERASE PREPARE",
"SECURITY ERASE UNIT",
"SECURITY FREEZE LOCK",
"SECURITY DISABLE PASSWORD",
cmd_vendor_specific,
"READ NATIVE MAX ADDRESS",
"SET MAX",
cmd_vendor_specific,
cmd_vendor_specific,
cmd_vendor_specific,
cmd_vendor_specific,
cmd_vendor_specific,
cmd_vendor_specific
};
/* Returns the name of the command (and possibly sub-command) with the given
command code and feature register values. For most command codes this
simply returns the corresponding entry in the command_table array, but for
others the value of the feature register specifies a subcommand or
distinguishes commands. */
const char *look_up_ata_command(unsigned char c_code, unsigned char f_reg) {
// check that command table not messed up. The compiler will issue
// warnings if there are too many array elements, but won't issue
// warnings if there are not enough of them.
if (sizeof(command_table) != sizeof(char *)*COMMAND_TABLE_SIZE){
fprintf(stderr,
"Problem in atacmdnames.c. Command Table command_table[] does\n"
"not have %d entries! It has %d entries. Please fix it.\n",
COMMAND_TABLE_SIZE, (int)(sizeof(command_table)/sizeof(char *)));
abort();
}
switch (c_code) {
case 0x00: /* NOP */
switch (f_reg) {
case 0x00:
return "NOP [Abort queued commands]";
case 0x01:
return "NOP [Don't abort queued commands]";
default:
return "NOP [Reserved subcommand]";
}
case 0x92: /* DOWNLOAD MICROCODE */
switch (f_reg) {
case 0x01:
return "DOWNLOAD MICROCODE [Temporary]";
case 0x07:
return "DOWNLOAD MICROCODE [Save]";
default:
return "DOWNLOAD MICROCODE [Reserved subcommand]";
}
case 0xB0: /* SMART */
switch (f_reg) {
case 0xD0:
return "SMART READ DATA";
case 0xD1:
return "SMART READ ATTRIBUTE THRESHOLDS [OBS-4]";
case 0xD2:
return "SMART ENABLE/DISABLE ATTRIBUTE AUTOSAVE";
case 0xD3:
return "SMART SAVE ATTRIBUTE VALUES [OBS-6]";
case 0xD4:
return "SMART EXECUTE OFF-LINE IMMEDIATE";
case 0xD5:
return "SMART READ LOG";
case 0xD6:
return "SMART WRITE LOG";
case 0xD7:
return "SMART WRITE ATTRIBUTE THRESHOLDS [NS, OBS-4]";
case 0xD8:
return "SMART ENABLE OPERATIONS";
case 0xD9:
return "SMART DISABLE OPERATIONS";
case 0xDA:
return "SMART RETURN STATUS";
case 0xDB:
return "SMART EN/DISABLE AUTO OFFLINE [NS (SFF-8035i)]";
default:
if (f_reg >= 0xE0)
return "[Vendor specific SMART command]";
else
return "[Reserved SMART command]";
}
case 0xB1: /* DEVICE CONFIGURATION */
switch (f_reg) {
case 0xC0:
return "DEVICE CONFIGURATION RESTORE";
case 0xC1:
return "DEVICE CONFIGURATION FREEZE LOCK";
case 0xC2:
return "DEVICE CONFIGURATION IDENTIFY";
case 0xC3:
return "DEVICE CONFIGURATION SET";
default:
return "DEVICE CONFIGURATION [Reserved command]";
}
case 0xE9: /* WRITE SAME */
switch (f_reg) {
case 0x22:
return "WRITE SAME [Start specified] [RET-4]";
case 0xDD:
return "WRITE SAME [Start unspecified] [RET-4]";
default:
return "WRITE SAME [Invalid subcommand] [RET-4]";
}
case 0xEF: /* SET FEATURES */
switch (f_reg) {
case 0x01:
return "SET FEATURES [Enable 8-bit PIO]";
case 0x02:
return "SET FEATURES [Enable write cache]";
case 0x03:
return "SET FEATURES [Set transfer mode]";
case 0x04:
return "SET FEATURES [Enable auto DR] [OBS-4]";
case 0x05:
return "SET FEATURES [Enable APM]";
case 0x06:
return "SET FEATURES [Enable Pwr-Up In Standby]";
case 0x07:
return "SET FEATURES [Set device spin-up]";
case 0x09:
return "SET FEATURES [Reserved (address offset)]";
case 0x0A:
return "SET FEATURES [Enable CFA power mode 1]";
case 0x10:
return "SET FEATURES [Reserved for Serial ATA]";
case 0x20:
return "SET FEATURES [Set Time-ltd R/W WCT]";
case 0x21:
return "SET FEATURES [Set Time-ltd R/W EH]";
case 0x31:
return "SET FEATURES [Disable Media Status Notf]";
case 0x33:
return "SET FEATURES [Disable retry] [OBS-4]";
case 0x42:
return "SET FEATURES [Enable AAM]";
case 0x43:
return "SET FEATURES [Set Max Host I/F S Times]";
case 0x44:
return "SET FEATURES [Length of VS data] [OBS-4]";
case 0x54:
return "SET FEATURES [Set cache segs] [OBS-4]";
case 0x55:
return "SET FEATURES [Disable read look-ahead]";
case 0x5D:
return "SET FEATURES [Enable release interrupt]";
case 0x5E:
return "SET FEATURES [Enable SERVICE interrupt]";
case 0x66:
return "SET FEATURES [Disable revert defaults]";
case 0x77:
return "SET FEATURES [Disable ECC] [OBS-4]";
case 0x81:
return "SET FEATURES [Disable 8-bit PIO]";
case 0x82:
return "SET FEATURES [Disable write cache]";
case 0x84:
return "SET FEATURES [Disable auto DR] [OBS-4]";
case 0x85:
return "SET FEATURES [Disable APM]";
case 0x86:
return "SET FEATURES [Disable Pwr-Up In Standby]";
case 0x88:
return "SET FEATURES [Disable ECC] [OBS-4]";
case 0x89:
return "SET FEATURES [Reserved (address offset)]";
case 0x8A:
return "SET FEATURES [Disable CFA power mode 1]";
case 0x90:
return "SET FEATURES [Reserved for Serial ATA]";
case 0x95:
return "SET FEATURES [Enable Media Status Notf]";
case 0x99:
return "SET FEATURES [Enable retries] [OBS-4]";
case 0x9A:
return "SET FEATURES [Set max avg curr] [OBS-4]";
case 0xAA:
return "SET FEATURES [Enable read look-ahead]";
case 0xAB:
return "SET FEATURES [Set max prefetch] [OBS-4]";
case 0xBB:
return "SET FEATURES [4 bytes VS data] [OBS-4]";
case 0xC2:
return "SET FEATURES [Disable AAM]";
case 0xCC:
return "SET FEATURES [Enable revert to defaults]";
case 0xDD:
return "SET FEATURES [Disable release interrupt]";
case 0xDE:
return "SET FEATURES [Disable SERVICE interrupt]";
case 0xE0:
return "SET FEATURES [Obsolete subcommand]";
default:
if (f_reg >= 0xF0)
return "SET FEATURES [Reserved for CFA]";
else
return "SET FEATURES [Reserved subcommand]";
}
case 0xF9: /* SET MAX */
switch (f_reg) {
case 0x00:
return "SET MAX ADDRESS [OBS-6]";
case 0x01:
return "SET MAX SET PASSWORD";
case 0x02:
return "SET MAX LOCK";
case 0x03:
return "SET MAX UNLOCK";
case 0x04:
return "SET MAX FREEZE LOCK";
default:
return "[Reserved SET MAX command]";
}
default:
return command_table[c_code];
}
}
This diff is collapsed.
/*
* atacmdnames.h
*
* This module is based on the T13/1532D Volume 1 Revision 3 (ATA/ATAPI-7)
* specification, which is available from http://www.t13.org/#FTP_site
*
* Home page of code is: http://smartmontools.sourceforge.net
* Address of support mailing list: smartmontools-support@lists.sourceforge.net
*
* Copyright (C) 2003-4 Philip Williams
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* You should have received a copy of the GNU General Public License
* (for example COPYING); if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
#ifndef ATACMDNAMES_H_
#define ATACMDNAMES_H_
#define ATACMDNAMES_H_CVSID "$Id: atacmdnames.h,v 1.3 2004/01/02 16:05:24 ballen4705 Exp $\n"
/* Returns the name of the command (and possibly sub-command) with the given
command code and feature register values. */
const char *look_up_ata_command(unsigned char c_code, unsigned char f_reg);
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*
* ataprint.h
*
* Home page of code is: http://smartmontools.sourceforge.net
*
* Copyright (C) 2002-4 Bruce Allen <smartmontools-support@lists.sourceforge.net>
* Copyright (C) 1999-2000 Michael Cornwell <cornwell@acm.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* You should have received a copy of the GNU General Public License
* (for example COPYING); if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* This code was originally developed as a Senior Thesis by Michael Cornwell
* at the Concurrent Systems Laboratory (now part of the Storage Systems
* Research Center), Jack Baskin School of Engineering, University of
* California, Santa Cruz. http://ssrc.soe.ucsc.edu/
*
*/
#ifndef ATAPRINT_H_
#define ATAPRINT_H_
#define ATAPRINT_H_CVSID "$Id: ataprint.h,v 1.26 2004/01/27 15:29:16 ballen4705 Exp $\n"
#include <stdio.h>
#include <stdlib.h>
/* Prints ATA Drive Information and S.M.A.R.T. Capability */
void ataPrintDriveInfo(struct ata_identify_device *);
void ataPrintGeneralSmartValues(struct ata_smart_values *, struct ata_identify_device *);
void ataPrintSmartThresholds(struct ata_smart_thresholds_pvt *);
// returns number of errors in Errorlog
int ataPrintSmartErrorlog(struct ata_smart_errorlog *);
int ataPrintLogDirectory(struct ata_smart_log_directory *);
void PrintSmartAttributes(struct ata_smart_values *);
void PrintSmartAttribWithThres(struct ata_smart_values *,
struct ata_smart_thresholds_pvt *,
int onlyfailed);
// returns number of entries that had logged errors
int ataPrintSmartSelfTestlog(struct ata_smart_selftestlog *, int allentries);
void ataPseudoCheckSmart(struct ata_smart_values *, struct ata_smart_thresholds_pvt *);
// Convenience function for formatting strings from ata_identify_device.
void formatdriveidstring(char *out, const char *in, int n);
int ataPrintMain(int fd);
#endif
#!/bin/sh
# $Id: autogen.sh,v 1.8 2004/05/27 15:23:16 card_captor Exp $
#
# Generate ./configure from config.in and Makefile.in from Makefile.am.
# This also adds files like missing,depcomp,install-sh to the source
# direcory. To update these files at a later date use:
# autoreconf -f -i -v
# Cygwin?
test -x /usr/bin/uname && /usr/bin/uname | grep -i CYGWIN >/dev/null &&
{
# Enable strict case checking
# (to avoid e.g "DIST_COMMON = ... ChangeLog ..." in Makefile.in)
export CYGWIN="${CYGWIN}${CYGWIN:+ }check_case:strict"
# Check for Unix text file type
echo > dostest.tmp
test "`wc -c < dostest.tmp`" -eq 1 ||
echo "Warning: DOS text file type set, 'make dist' and related targets will not work."
rm -f dostest.tmp
}
typep()
{
cmd=$1 ; TMP=$IFS ; IFS=: ; set $PATH
for dir
do
if [ -x "$dir/$cmd" ]; then
echo "$dir/$cmd"
IFS=$TMP
return 0
fi
done
IFS=$TMP
return 1
}
test -x "$AUTOMAKE" || AUTOMAKE=`typep automake-1.8` || AUTOMAKE=`typep automake-1.7` || AUTOMAKE=`typep automake17` ||
{
echo
echo "You must have at least GNU Automake 1.7 (up to 1.8.x) installed"
echo "in order to bootstrap smartmontools from CVS. Download the"
echo "appropriate package for your distribution, or the source tarball"
echo "from ftp://ftp.gnu.org/gnu/automake/ ."
echo
echo "Also note that support for new Automake series (anything newer"
echo "than 1.8.x) is only added after extensive tests. If you live in"
echo "the bleeding edge, you should know what you're doing, mainly how"
echo "to test it before the developers. Be patient."
exit 1;
}
test -x "$ACLOCAL" || ACLOCAL="aclocal`echo "$AUTOMAKE" | sed 's/.*automake//'`" && ACLOCAL=`typep "$ACLOCAL"` ||
{
echo
echo "autogen.sh found automake-1.7, or automake-1.8 in"
echo "your PATH, but not the respective aclocal-1.7, or"
echo "aclocal-1.8. Your installation of GNU Automake is broken or"
echo "incomplete."
exit 2;
}
set -e # stops on error status
${ACLOCAL}
autoheader
${AUTOMAKE} --add-missing --copy --foreign
autoconf
#
# $Id: configure.in,v 1.91 2004/08/13 14:09:21 arvoreen Exp $
#
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.50)
AC_INIT(smartmontools, 5.33, smartmontools-support@lists.sourceforge.net)
AC_CONFIG_SRCDIR(smartctl.c)
smartmontools_configure_date=`date -u +"%Y/%m/%d %T %Z"`
smartmontools_cvs_tag=`echo '$Id: configure.in,v 1.91 2004/08/13 14:09:21 arvoreen Exp $'`
smartmontools_release_date=2004/07/05
smartmontools_release_time="08:10:26 UTC"
AC_DEFINE_UNQUOTED(SMARTMONTOOLS_CONFIGURE_ARGS, "$ac_configure_args", [smartmontools Configure Arguments])
AC_DEFINE_UNQUOTED(SMARTMONTOOLS_CONFIGURE_DATE, "$smartmontools_configure_date", [smartmontools Configure Date])
AC_DEFINE_UNQUOTED(SMARTMONTOOLS_RELEASE_DATE, "$smartmontools_release_date", [smartmontools Release Date])
AC_DEFINE_UNQUOTED(SMARTMONTOOLS_RELEASE_TIME, "$smartmontools_release_time", [smartmontools Release Time])
AC_DEFINE_UNQUOTED(CONFIG_H_CVSID, "$smartmontools_cvs_tag", [smartmontools CVS Tag])
AC_DEFINE_UNQUOTED(PACKAGE_HOMEPAGE, "http://smartmontools.sourceforge.net/", [smartmontools Home Page])
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE
AM_MAINTAINER_MODE
AC_LANG_C
dnl Checks for programs.
AC_PROG_CC
AM_PROG_AS
AC_PROG_INSTALL
AC_CANONICAL_HOST
dnl Set flags which may affect AC_CHECK_*.
case "${host}" in
*-*-mingw*)
CPPFLAGS="$CPPFLAGS -mno-cygwin"
LDFLAGS="$LDFLAGS -mno-cygwin"
CPPFLAGS="$CPPFLAGS -idirafter ${srcdir}/posix -idirafter ${srcdir}/os_win32"
esac
dnl Checks for libraries.needed for gethostbyname (Solaris needs
dnl libnsl, might in the future also need libsocket)
# AC_SEARCH_LIBS (FUNCTION, SEARCH-LIBS, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], [OTHER-LIBRARIES])
AC_SEARCH_LIBS(gethostbyname, nsl, , AC_SEARCH_LIBS(gethostbyname, nsl, , , -lsocket), , )
dnl Checks for header files.
AC_CHECK_HEADER([getopt.h])
AC_CHECK_HEADERS([dev/ata/atavar.h])
AC_CHECK_HEADERS([sys/int_types.h])
AC_CHECK_HEADERS([sys/inttypes.h])
AC_CHECK_HEADERS([netdb.h])
dnl Check for FreeBSD twe include files...currently missing on 5.2, but should be there
AC_CHECK_HEADERS([sys/tweio.h])
AC_CHECK_HEADERS([sys/twereg.h])
dnl Checks for typedefs, structures, and compiler characteristics.
dnl Checks for library functions.
AC_CHECK_FUNCS([getopt])
AC_CHECK_FUNCS([getopt_long])
AC_CHECK_FUNCS([getdomainname])
AC_CHECK_FUNCS([gethostname])
AC_CHECK_FUNCS([gethostbyname])
AC_CHECK_FUNCS([sigset])
AC_CHECK_FUNCS([strtoull])
AC_CHECK_FUNCS([uname])
AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)
AC_SUBST(ASFLAGS)
AC_SUBST([exampledir], ['${docdir}/examplescripts'])
AC_ARG_WITH(initscriptdir,[AC_HELP_STRING([--with-initscriptdir=dir],[Location of init scripts (default is ${sysconfdir}/rc.d/init.d)])],[initddir="$withval"],[initddir='${sysconfdir}/rc.d/init.d'])
AC_SUBST(initddir)
AC_ARG_WITH(docdir,[AC_HELP_STRING([--with-docdir=dir],[Location of documentation (default is ${prefix}/share/doc/smartmontools-5.X)])],[docdir="$withval"],[docdir='${prefix}/share/doc/${PACKAGE}-${VERSION}'])
AC_SUBST(docdir)
AC_ARG_ENABLE(sample,[AC_HELP_STRING([--enable-sample],[Enables appending .sample to the installed smartd rc script and configuration file])],[smartd_suffix='.sample'],[smartd_suffix=''])
AC_SUBST(smartd_suffix)
AM_CONDITIONAL(SMARTD_SUFFIX, test $smartd_suffix)
if test "$prefix" = "NONE"; then
dnl no prefix and no mandir, so use ${prefix}/share/man as default
if test "$mandir" = '${prefix}/man'; then
AC_SUBST([mandir], ['${prefix}/share/man'])
fi
fi
AC_SUBST(releaseversion,['${PACKAGE}-${VERSION}'])
AC_SUBST(smartmontools_release_date)
AC_SUBST(smartmontools_release_time)
dnl if OS not recognized, then use the os_generic modules
case "${host}" in
*-*-linux-gnu*)
AC_SUBST([os_deps], ['os_linux.o'])
AC_SUBST([os_libs], ['']) ;;
*-*-linux*)
AC_SUBST([os_deps], ['os_linux.o'])
AC_SUBST([os_libs], ['']) ;;
*-*-freebsd*)
AC_SUBST([os_deps], ['os_freebsd.o'])
AC_SUBST([os_libs], ['-lcam']);;
sparc-*-solaris*)
AC_DEFINE_UNQUOTED(DEFAULT_MAILER, "mailx", [use mailx as default mailer])
AC_DEFINE_UNQUOTED(NEED_SOLARIS_ATA_CODE, "os_solaris_ata.s", [need assembly code os_solaris_ata.s])
AC_SUBST([os_deps], ['os_solaris.o os_solaris_ata.o'])
AC_SUBST([os_libs], ['']) ;;
*-pc-solaris*)
AC_DEFINE_UNQUOTED(DEFAULT_MAILER, "mailx", [use mailx as default mailer])
AC_SUBST([os_deps], ['os_solaris.o'])
AC_SUBST([os_libs], ['']) ;;
*-*-netbsd*)
AC_SUBST([os_deps], ['os_netbsd.o'])
AC_SUBST([os_libs], ['-lutil']) ;;
*-*-cygwin*)
AC_SUBST([os_deps], ['os_win32.o'])
AC_SUBST([os_libs], ['']) ;;
*-*-mingw*)
AC_SUBST([os_deps], ['os_win32.o regex.o daemon_win32.o hostname_win32.o syslog_win32.o'])
AC_SUBST([os_libs], ['']) ;;
*-*-darwin*)
AC_SUBST([os_deps], ['os_darwin.o'])
AC_SUBST([os_libs], ['-framework CoreFoundation -framework IOKit']) ;;
*)
AC_SUBST([os_deps], ['os_generic.o'])
AC_SUBST([os_libs], ['']) ;;
esac
dnl Define platform-specific symbol.
AM_CONDITIONAL(OS_DARWIN, [echo $host_os | grep '^darwin' > /dev/null])
AM_CONDITIONAL(OS_SOLARIS, [echo $host_os | grep '^solaris' > /dev/null])
AM_CONDITIONAL(OS_WIN32_MINGW, [echo $host_os | grep '^mingw' > /dev/null])
dnl Add -Wall and -W if using gcc and its not already specified.
if test "x$GCC" = "xyes"; then
if test -z "`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`" ; then
CFLAGS="$CFLAGS -Wall"
fi
# In the next line, do NOT delete the 2 spaces inside double quotes.
if test -z "`echo "$CFLAGS " | grep "\-W " 2> /dev/null`" ; then
CFLAGS="$CFLAGS -W"
fi
case "${host}" in
*-*-mingw*)
# MinGW uses MSVCRT.DLL which uses printf format "%I64d" and not "%lld" for int64_t
CFLAGS="$CFLAGS -Wno-format";;
esac
else
dnl We are NOT using gcc, so enable host-specific compiler flags
case "${host}" in
*-*-solaris*)
dnl set CFLAGS for Solaris C compiler
if test -z "`echo "$CFLAGS" | grep "\-xmemalign" 2> /dev/null`" ; then
dnl we have to tell the compilers about packed ATA structures
CFLAGS="-xmemalign=1i $CFLAGS"
fi
if test -z "`echo "$CFLAGS" | grep "\-xCC" 2> /dev/null`" ; then
dnl we have to tell the compiler to ignore C++ style comments
CFLAGS="-xCC $CFLAGS"
fi
if test -z "`echo "$CFLAGS" | grep "\-xO" 2> /dev/null`" ; then
dnl turn on optimization if user has not explicitly set its value
CFLAGS="-xO2 $CFLAGS"
fi
esac
fi
AC_DEFINE_UNQUOTED(SMARTMONTOOLS_BUILD_HOST, "${host}", [smartmontools Build Host])
AC_SUBST(CFLAGS)
AC_OUTPUT(Makefile examplescripts/Makefile smartd.initd)
AC_PROG_MAKE_SET
#!/bin/bash -ev
#
# do a smartmontools release
# (C) 2003-4 Bruce Allen <ballen4705@users.sourceforge.net>,
# Guido Guenther <agx@sigxcpu.org>
# $Id: do_release,v 1.31 2004/07/05 07:41:52 ballen4705 Exp $
# Notes on generating releases:
# (1) update NEWS
# (2) update CHANGELOG -- put in release number
# (3) update release number in configure.in and smartmontools.spec
# (4) update internal changelog in smartmontools.spec
USECVS=1
KEYID=0x9BB19A22
if [ -f /etc/redhat-release ]; then
RPM_BASE=/usr/src/redhat/
else
RPM_BASE=/usr/src/rpm/
fi
SOURCES=$RPM_BASE/SOURCES/
setup_cvs()
{
CVS_SERVER=fakevalue
unset CVS_SERVER || echo "can't unset CVS_SERVER=$CVS_SERVER"
CVS_RSH=ssh
CVSROOT=:ext:ballen4705@cvs.sourceforge.net:/cvsroot/smartmontools
}
get_release()
{
VERSION=`grep 'AC_INIT' configure.in | awk '{ print $2 }' | sed s/,//g`
RELEASE="RELEASE_${VERSION//\./_}"
echo "Version: $VERSION"
echo "Release: $RELEASE"
}
inc_release()
{
MINOR=`echo $VERSION | cut -d. -f2`
MAJOR=`echo $VERSION | cut -d. -f1`
PERL_OLD=$MAJOR\\.$MINOR
((MINOR++))
NEW_VERSION=$MAJOR.$MINOR
PERL_NEW=$MAJOR\\.$MINOR
NEW_RELEASE="RELEASE_${NEW_VERSION//\./_}"
echo "New Version: $NEW_VERSION"
echo "New Release: $NEW_RELEASE"
}
# run automake/autoconf
if [ -f Makefile ] ; then
make distcheck || exit 1
make clean
make distclean
rm -f Makefile configure
fi
if [ $USECVS -ne 0 ] ; then
smartmontools_release_date=`date -u +"%Y/%m/%d"`
smartmontools_release_time=`date -u +"%T %Z"`
cat configure.in | sed "s|smartmontools_release_date=.*|smartmontools_release_date=${smartmontools_release_date}|" > configure.tmp
cat configure.tmp | sed "s|smartmontools_release_time=.*|smartmontools_release_time=\"${smartmontools_release_time}\"|" > configure.in
rm -f configure.tmp
fi
./autogen.sh
get_release
# tag CVS version
if [ $USECVS -ne 0 ] ; then
setup_cvs
cvs commit -m "Release $VERSION $RELEASE"
cvs tag -d $RELEASE
cvs tag $RELEASE
fi
# build .tar.gz
rm -rf build
mkdir build
cd build
../configure
make distcheck || exit 1
cd ..
cp build/smartmontools-$VERSION.tar.gz $SOURCES
# build rpm
rpmbuild -ba --sign smartmontools.spec
# remove source tarball
rm -f $SOURCES/smartmontools-$VERSION.tar.gz
# increase release number:
inc_release
if [ $USECVS -ne 0 ] ; then
perl -p -i.bak -e "s/$PERL_OLD/$PERL_NEW/" configure.in
perl -p -i.bak -e "s/Version:\t$PERL_OLD/Version:\t$PERL_NEW/" smartmontools.spec
fi
mv -f $RPM_BASE/RPMS/i386/smartmontools-$VERSION-*.i386.rpm .
mv -f $RPM_BASE/SRPMS/smartmontools-$VERSION-*.src.rpm .
cp -f build/smartmontools-$VERSION.tar.gz .
if [ "$KEYID" ]; then
gpg --default-key $KEYID --armor --detach-sign ./smartmontools-$VERSION.tar.gz
fi
# cleanup
rm -rf autom4te.cache build/ config.h.in Makefile.in examplescripts/Makefile.in \
depcomp mkinstalldirs install-sh configure aclocal.m4 missing *.bak
Makefile
Makefile.in
#!/bin/bash
#
# This is a script from the smartmontools examplescripts/ directory.
# It can be used as an argument to the -M exec Directive in
# /etc/smartd.conf, in a line like
# -m root@localhost -M exec /path/to/this/file
#
# Please see man 8 smartd or man 5 smartd.conf for further
# information.
#
# $Id: Example1,v 1.5 2004/01/07 16:49:56 ballen4705 Exp $
# Save standard input into a temp file
cat > /root/tempfile
# Echo command line arguments into temp file
echo "Command line argument 1:" >> /root/tempfile
echo $1 >> /root/tempfile
echo "Command line argument 2:" >> /root/tempfile
echo $2 >> /root/tempfile
echo "Command line argument 3:" >> /root/tempfile
echo $3 >> /root/tempfile
# Echo environment variables into a temp file
echo "Variables are": >> /root/tempfile
echo "$SMARTD_DEVICE" >> /root/tempfile
echo "$SMARTD_DEVICESTRING" >> /root/tempfile
echo "$SMARTD_DEVICETYPE" >> /root/tempfile
echo "$SMARTD_MESSAGE" >> /root/tempfile
echo "$SMARTD_ADDRESS" >> /root/tempfile
echo "$SMARTD_SUBJECT" >> /root/tempfile
echo "$SMARTD_TFIRST" >> /root/tempfile
echo "$SMARTD_TFIRSTEPOCH" >> /root/tempfile
# Run smartctl -a and save output in temp file
/usr/sbin/smartctl -a -d $SMARTD_DEVICETYPE $SMARTD_DEVICE >> /root/tempfile
# Email the contents of the temp file. Solaris and other OSes
# may need to use /bin/mailx not /bin/mail.
/bin/mail -s "SMART errors detected on host: `hostname`" $SMARTD_ADDRESS < /root/tempfile
# And exit
exit 0
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment