2017년 1월 28일 토요일

dd (UNIX)

dd (UNIX)

dd accesses data such as the file system on the OS's such as UNIX or Linux directly and is a copy and a program converting. I imitate the interface of the program implemented on JCL of IBM Corporation, and the name is a contracted form of the data definition (dataset definition).

The main function of dd is copying of data of the appointed number of bytes or the number of the blocks, and this function is used to completely remove a domain appointed using backup and /dev/zero and /dev/random of the hard disk (the whole or a partition unit or boot sector).

In addition, in computer フォレンジックス performed for the crime investigation and the in-house investigation of the company, this program may be used for work to copy the whole hard disk in a hard disk for the analysis. This is because I cannot copy the data of the unused sector including the deletion trace by the File Manager such as cp command that is usually used in the operating system or Windows Explorer.

When dd is data destroyer (data corruption program), between some users, I am called with irony. This is because I copy the whole hard disk by appointing a command-line switch appointing input and output adversely and there is not it and brings a result removing.

Table of contents

The option that a command-line can appoint

The option which appoints input and output

  • if=[file]: In substitution for standard input, I read it from file file
  • of=[file]: In substitution for standard output, I begin to write it to file file

The option which appoints size to copy

  • count=[blocks]: Hold it for the block blocks unit of the ibs byte and copy an input file

The option which appoints a start position of the reading and writing

  • skip=[blocks]: Hold it for the block blocks unit of the ibs byte and skip the top of the input file
  • seek=[blocks]: I do not begin to write the block blocks unit share of the obs byte in the top of the output

The option which appoints data size of one reading and writing

  • bs=[bytes]: By bytes parttimer does reading and an opening sentence at a time
  • ibs=[bytes]: I read by bytes byte at a time. The default is 512
  • obs=[bytes]: I begin to write by bytes byte at a time. The default is 512

The option which appoints data conversion of the on the fried food

  • conv=[CONVERSION]
    noerror: Even if a reading error occurs, it continues
    sync: When input block size does not reach the number of bytes that is not appointed in ibs, I perform パディング

Use example

I copy the partition on the hard disk on a different disk

 dd if=/dev/sda2 of=/dev/sdb2 bs=4096 conv=notrunc,noerror 

I completely remove the whole hard disk

 dd if=/dev/urandom of=/dev/hda 

I convert a CD into iso imagination image file

 dd if=/dev/cdrom of=/home/sam/myCD.iso bs=2048 conv=sync,notrunc 

I back up MBR of the hard disk

 dd if=/dev/sda of=/home/sam/MBR.image bs=446 count=1 

Allied item

Outside link

  • dd(1) man page (JM Project)
  • dd(1M) man page (SunOS reference manual)
  • dd(1) man page (HP-UX reference)

This article is taken from the Japanese Wikipedia dd (UNIX)

This article is distributed by cc-by-sa or GFDL license in accordance with the provisions of Wikipedia.

Wikipedia and Tranpedia does not guarantee the accuracy of this document. See our disclaimer for more information.

In addition, Tranpedia is simply not responsible for any show is only by translating the writings of foreign licenses that are compatible with CC-BY-SA license information.

0 개의 댓글:

댓글 쓰기