aboutsummaryrefslogblamecommitdiffstats
path: root/deadshred.1
blob: 8d36103a2719551e5f087ae50678944e900e8573 (plain) (tree)
1
2
3
4
5
6
7
8





                                                                 

               






             
     
         
                

                   












                                                         

                                    



                                                 


























                                                 



                                              


                            

                
        






















                                                         

            
                                     
   
         

                                                      









                                                    

         


                                                              
 

                                                        


                                                            

                                                           
                                           







                                                                                                    

















                                                  










                                                              
.TH DEADSHRED 1 deadshred
.SH NAME
deadshred \- override the contents of a device that may be broken

.SH SYNOPSIS
.B deadshred
[-b
.IR blocksize ]
[-o
.IR offset ]
[-l
.I length
|
-e
.IR postend ]
[-rY]
.I device
.RI [ map-file ]
[<
.IR random-source ]

.SH DESCRIPTION
The
.B deadshred
utility fills a file or block devices with
nonsense data. The utility is designed specifically for
erasing the content of failing hard disc drives, for this
purpose, the
.I deadshred
utility will skip any section it fails
to override and retries it later.

.SH OPTIONS
The following options are supported:
.TP
.BR -b \ \fIblocksize\fP
Selects the initial block-size for writing on the
first pass over the device.
.TP
.BR -e \ \fIpostend\fP
Position in the
.I device
to stop writing at. The byte indexed by the value
.I postend
will not be overwritten.
.TP
.BR -l \ \fIlength\fP
The number of bytes in the
.I device
to overwrite. If the
.B -o
option is unused (or the
.I offset
0 is used), this is equivalent to the
.B -e
option, however the
.B -o
option is used, writing will stop at
.I length
bytes past
.IR offset .
.TP
.BR -o \ \fIoffset\fP
The index of the first byte in the
.I device
to overwrite.
.TP
.B -r
Start writing from the end instead of from the
beginning on the first pass over the device.
.TP
.B -Y
Do not ask for confirmation.
.PP
The value of the
.B -belo
flags can be expressed a sum of terms (delimited by
SP
.RB (' " " '),
comma
.RB (' , '),
or plus
.RB (' + '))
expressed either as a integer representing a byte count,
or a real number with an optionally prefixed byte size
unit, which shall be either
.B B
(for bytes, which requires the number to be an integer)
or a prefix followed by
.B iB
(for base 1024)
or
.B B
(for base 1000), or just the prefix (also for base 1024).
The lowest supported prefix is
.B k
.RB ( K
is recognised as a synonym, but the value is otherwise
case sensitive).

.SH OPERANDS
The following operands are supported:
.TP
.I device
The file to override. Must be either a regular file or
a block device.
.TP
.I map-file
If the file
.I map-file exists
and is non-empty, it specifies what sections in the
.I device
to overwrite; this file will be periodically, and
upon exit, updated to remove parts that has been
successfully overwritten. This file will be unlinked
when it becomes empty.

.SH STDIN
Unless the standard input is a terminal device, it shall be an
unless source of either random data or a particular byte to
fill the device with.

.SH STDOUT
If the process is terminated using either of the signals
SIGTERM or SIGINT, and a
.I map-file
was not specified, the process will write to standard output
a map of sections that has not been overwritten yet. The
output will be the concatenation of one string per section,
followed by a <newline>, each on the format
.PP
.nf
\fB\(dq%s%x-%x/%x\(dq,\fP <\fB\(dq0x\(dq\fP for the first section, \fB\(dq,\(dq\fP otherwise>\fB,\fP
              <\fIindex of the first byte in the section\fP>\fB,\fP
              <\fIindex of the byte after the last in the section\fP>\fB,\fP
              <\fIthe block size that should be used when trying to overwrite\fP>
.fi

.SH INPUT FILES
If a
.I map-file
is specified, its content shall either be empty or
conform to the format specified for the standard
output. See the
.B STDOUT
section for more information.

.SH OUTPUT FILES
If a
.I map-file
is specified, the data written to it will conform
to the format specified for the standard
output. See the
.B STDOUT
section for more information.

.SH NOTES
While the
.B deadshred
utility is designed for block devices, it
also works for regular files, however does not provide options
that are useful for erasing regular files and is not designed
to work with filesystems that use copy on write.

.SH SEE ALSO
.BR dd (1),
.BR shred (1)