aboutsummaryrefslogblamecommitdiffstats
path: root/deadshred.1
blob: e445c056e7f7b059bfdfc44bdb004dac6b32bdb8 (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 ]
[-r]
.I device
[<
.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.
.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 operand is supported:
.TP
.I file
The file to override. Must be either a regular file or
a block device.

.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, 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,
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 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)