Amdd: Difference between revisions
Paul.bijnens (talk | contribs) m (→OPTIONS) |
Paul.bijnens (talk | contribs) (Examples added) |
||
Line 38: | Line 38: | ||
; count=''count'' : Number of records to copy. Default is all records until end of file. | ; count=''count'' : Number of records to copy. Default is all records until end of file. | ||
; skip=''count'' : Number of records to skip before copying input to output. Default is zero. | ; skip=''count'' : Number of records to skip before copying input to output. Default is zero. | ||
==EXAMPLES== | |||
The first block (size 32k) of each image on a tape written by amanda contains | |||
the info about that image. | |||
A table of contents of an amanda backup tape: | |||
TAPEDEV=/dev/nst0 | |||
ammt -t $TAPEDEV rewind | |||
while ammt -t $TAPEDEV fsf 1 | |||
do | |||
amdd if=$TAPEDEV bs=32k count=1 | head -1 | |||
done | |||
The same block contains also the command line you need to restore: | |||
ammt -t $TAPEDEV rewind; ammt -t $TAPEDEV fsf 12 | |||
amdd if=$TAPEDEV bs=32k count=1 | tr -d '\0\f' | |||
The dumpimage is after that 32k header. Extract it and pipe it to e.g. gnutar: | |||
ammt -t $TAPEDEV rewind; ammt -t $TAPEDEV fsf 12 | |||
amdd if=$TAPEDEV bs=32k skip=1 | gtar -ztvf - | |||
Using a diskfile (vtape) instead: | |||
TAPEDEV=file:/amanda-vtapes/daily/slots | |||
amdd if=$TAPEDEV bs=32k count=1 | |||
==AUTHOR== | ==AUTHOR== |
Revision as of 14:20, 4 December 2005
Name
amdd — Amanda version of dd
Synopsis
amdd [-d] [if=input] [of=output] [bs=blocksize] [skip=count] [count=count]
DESCRIPTION
Amdd provides just enough of the standard UNIX dd command for the needs of Amanda. This is handy when doing a full restore and the standard dd program has not yet been found.
Amdd also provides access to the Amanda output drivers that support various tape simulations. This may be used for debugging or to convert from one format to another.
See the amanda(8) man page for more details about Amanda. See the OUTPUT DRIVERS section of amanda(8) for more information on the Amanda output drivers.
OPTIONS
- -d
- Turn on debugging output.
- -llength
- Set the output length. If the output driver limits the output size, this controls when end of tape will be simulated.
- Length may have a multiplier suffix:
- k = 1024 (Kilobytes)
- b = 512 (Blocks)
- M = 1024*1024 (Megabytes)
- The default is no multiplier (bytes).
- if=input
- Input to dd. Default is stdin.
- of=output
- Where to send the output of dd. Default is stdout.
- bs=blocksize
- Size of each record. Input records smaller than this will not be padded. Output records will be the same size as the corresponding input record. Default is 512 bytes.
- Blocksize may have a multiplier suffix:
- k = 1024 (Kilobytes)
- b = 512 (Blocks)
- M = 1024*1024 (Megabytes)
- The default is no multiplier (bytes).
- count=count
- Number of records to copy. Default is all records until end of file.
- skip=count
- Number of records to skip before copying input to output. Default is zero.
EXAMPLES
The first block (size 32k) of each image on a tape written by amanda contains the info about that image. A table of contents of an amanda backup tape:
TAPEDEV=/dev/nst0 ammt -t $TAPEDEV rewind while ammt -t $TAPEDEV fsf 1 do amdd if=$TAPEDEV bs=32k count=1 | head -1 done
The same block contains also the command line you need to restore:
ammt -t $TAPEDEV rewind; ammt -t $TAPEDEV fsf 12 amdd if=$TAPEDEV bs=32k count=1 | tr -d '\0\f'
The dumpimage is after that 32k header. Extract it and pipe it to e.g. gnutar:
ammt -t $TAPEDEV rewind; ammt -t $TAPEDEV fsf 12 amdd if=$TAPEDEV bs=32k skip=1 | gtar -ztvf -
Using a diskfile (vtape) instead:
TAPEDEV=file:/amanda-vtapes/daily/slots amdd if=$TAPEDEV bs=32k count=1
AUTHOR
Marc Mengel <[email protected]>, John R. Jackson <[email protected]> : Original text
Stefan G. Weichinger, <[email protected]>, maintainer of the AMANDA-documentation: XML-conversion
SEE ALSO
amanda(8)