1SG_REASSIGN(8)                     SG3_UTILS                    SG_REASSIGN(8)
2
3
4

NAME

6       sg_reassign - send SCSI REASSIGN BLOCKS command
7

SYNOPSIS

9       sg_reassign   [--address=A,A...]   [--dummy]   [--eight=0|1]  [--grown]
10       [--help] [--longlist=0|1] [--hex] [--primary]  [--verbose]  [--version]
11       DEVICE
12

DESCRIPTION

14       Send a SCSI REASSIGN BLOCKS command to DEVICE. Alternatively this util‐
15       ity can find the number of element in a  "grown"  or  "primary"  defect
16       list with a SCSI READ DEFECT DATA (10) command. These SCSI commands are
17       defined in SBC-2 for direct access  devices  (e.g.  a  disk).  Reassign
18       blocks  is  designed to change the physical location of a logical block
19       that is known or suspected to be  defective  to  another  area  on  the
20       media.  Disks  are  typically formatted with blocks held in reserve for
21       this situation.
22
23       If neither the --grown nor --primary option is  supplied  then  one  or
24       more  addresses  need  to  be  given.  If  the  address  (or all of the
25       addresses) fit into 4 bytes and  '--eight=1'  is  not  given  then  the
26       parameter  block  passed  to  DEVICE is made up of 4 byte logical block
27       addresses. If any of the addresses need more than 4 bytes to  represent
28       (i.e. >= 2**32) or '--eight=1' is given then the parameter block passed
29       to DEVICE is made up of 8 byte logical block addresses.
30

OPTIONS

32       Arguments to long options are mandatory for short options as well.
33
34       -a, --address=A,A...
35              where A,A... is a string of comma separated numbers. Each number
36              is interpreted as decimal unless prefixed by '0x' or '0X' (or it
37              has a trailing 'h' or 'H'). If multiple logical block  addresses
38              are given they must be separated by a comma or a (single) space.
39              A string that contains any space separators needs to be  quoted.
40              At least one address must be given.
41
42       -a, --address=-
43              reads  one or more logical block addresses from stdin. These may
44              be comma, space, tab or linefeed (newline) separated. If a  line
45              contains  "#"  then  the  remaining  characters on that line are
46              ignored. Otherwise each non  separator  sequence  of  characters
47              should  resolve  to  a decimal number unless prefixed by '0x' or
48              '0X' (or has a trailing 'h').  At  least  one  address  must  be
49              given.
50
51       -d, --dummy
52              prepare for but do not execute the SCSI REASSIGN BLOCKS command.
53              Since the REASSIGN BLOCKS command is  essentially  irreversible,
54              paranoid  users may wish to check the invocation of this utility
55              before reassigning defective blocks on a disk. Useful with '-vv'
56              for  those who wish to view the parameter block that will accom‐
57              pany the command.
58
59       -e, --eight=0 | 1
60              when value is 1 then it sets the 'LONGLBA' flag in  the  command
61              indicating  that the addresses in the associated parameter block
62              are 8 byte quantities.  When value  is  0  then  it  clears  the
63              'LONGLBA'  flag  in the command indicating that the addresses in
64              the associated parameter block are 4 byte quantities.   If  this
65              option  is  not  given then 4 byte quantities are assumed unless
66              one of the address is too large.
67
68       -g, --grown
69              use the SCSI READ DEFECT DATA (10) command to determine the num‐
70              ber  of elements in the "grown defect list". When this option is
71              given there is no reassignment of blocks (i.e. this  utility  is
72              passive).  When  this option is given then the --address= option
73              is not permitted. See the discussion below concerning the  rela‐
74              tionship  between  reassigned  blocks and the grown defect list.
75              This list is sometimes referred to as the GLIST.
76
77       -h, --help
78              output the usage message then exit.
79
80       -l, --longlist=0 | 1
81              sets the REASSIGN BLOCKS cdb field of the same name to the given
82              value.   Only 1000 addresses are permitted so there should be no
83              need to specify a value of 1. The short list  variant  restricts
84              the  parameter block length to 2 ** 16 bytes (i.e. about 16000 4
85              byte addresses or 8000 8 byte addresses).  Added  for  complete‐
86              ness.
87
88       -p, --primary
89              use the SCSI READ DEFECT DATA (10) command to determine the num‐
90              ber of elements in the "primary defect  list"  which  is  estab‐
91              lished  during  the  manufacturing  process. When this option is
92              given there is no reassignment of blocks (i.e. this  utility  is
93              passive).  When  this option is given then the --address= option
94              is not permitted. This list is  sometimes  referred  to  as  the
95              PLIST.
96
97       -H, --hex
98              print response in hex (for -g, --grown or -p, --primary)
99
100       -v, --verbose
101              increase the level of verbosity, (i.e. debug output).
102
103       -V, --version
104              print the version string and then exit.
105

NOTES

107       Note  that  if  the  ARRE  field (for reads) and/or the AWRE field (for
108       writes) are set in the "Read  Write  Error  Recovery"  mode  page  then
109       recoverable  read  and/or  write errors cause automatic reassignment of
110       the defective block. The PER bit in the same mode page controls whether
111       a  RECOVERED  ERROR  sense  key  is  reported  on not (PER=1 implies do
112       report). Irrespective of the ARRE, AWRE  or  PER  field  settings,  the
113       error  counter  log  pages reflect any errors (recovered or otherwise).
114       Whenever a block is reassigned, a new entry is  added  in  the  "grown"
115       defect  list.  Apart from doing selftests (see sg_senddiag or smartmon‐
116       tools) regularly, monitoring the grown defect list of a disk is a  rea‐
117       sonable  metric of its health. If the grown list starts growing quickly
118       that is an ominous sign. The best grown defect lists  are  empty  ones.
119       The  number of elements in the grown defect list can be viewed with the
120       --grown option. The contents of the grown defect  list  can  be  viewed
121       with the 'sginfo -G' utility.
122
123       If  an  unrecoverable error is detected at a logical block address then
124       REASSIGN BLOCKS is needed to reassign  the  block.  Also  if  the  ARRE
125       and/or  AWRE  fields are clear and a recoverable error is detected then
126       the logical block in question may be reassigned with this utility (oth‐
127       erwise  the error counter log pages will continually be incremented for
128       each recovered access).
129
130       The number of blocks held in  reserve  for  the  purposes  of  REASSIGN
131       BLOCKS  is  vendor  specific and may well be limited to the zone within
132       the media where the original (defective) block lay. When this number is
133       exhausted  subsequent invocations of this utility may result in a sense
134       key of hardware error and an additional sense of 'No defect spare loca‐
135       tion  available'. The next step would be to reformat the disk (or get a
136       replacement).
137
138       The SBC-2  draft  standard  (revision  16)  notes  that  when  multiple
139       addresses  are  given  to the SCSI REASSIGN BLOCKS command and there is
140       some failure at one of the later addresses then all addresses prior  to
141       that  have  already be reassigned. Care should be taken in such a case.
142       Re-executing the command with the same addresses will cause the earlier
143       addresses  to  be reassigned again. At some stage the disk will run out
144       of reserved locations.  So unless  a  large  number  of  addresses  are
145       involved it may be safer to reassign them one address at a time.
146

EXIT STATUS

148       The  exit  status  of sg_reassign is 0 when it is successful. Otherwise
149       see the sg3_utils(8) man page.
150

AUTHORS

152       Written by Douglas Gilbert.
153

REPORTING BUGS

155       Report bugs to <dgilbert at interlog dot com>.
156
158       Copyright © 2005-2012 Douglas Gilbert
159       This software is distributed under a FreeBSD license. There is NO  war‐
160       ranty;  not  even  for MERCHANTABILITY or FITNESS FOR A PARTICULAR PUR‐
161       POSE.
162

SEE ALSO

164       sg_format,sginfo,sg_senddiag(all in sg3_utils), sdparm(sdparm),  smart‐
165       montools(internet, sourceforge)
166
167
168
169sg3_utils-1.35                   November 2012                  SG_REASSIGN(8)
Impressum