Dd command and simple application


 Since the reading and writing binary dd command allows, it is particularly suitable for input / output on a raw physical device. For example, you can create a floppy disk image file with the following command:

dd if=/dev/fd0 of=disk.img bs=1440k

Interestingly, this image file can be HD-Copy, Winimage and other tools read. Again the first 512 bytes of a hard disk as a file memory:


dd if=/dev/hda of=disk.mbr bs=512 count=1

Function:
copy the specified input file to the specified output file, and can copy the format conversion process. You can use the command role diskcopy command under DOS implementation. First with dd command to write data on the disk of a hard disk storage file, and then write the second register file on the floppy disk, complete diskcopy function. It should be noted that the register file on the hard disk will be removed with the rm command. The system uses standard input file and standard output file by default.

Syntax: dd [option]

if = input file (or device name), default to standard input.

of = output file (or device name), default to standard output.

ibs = bytes bytes bytes once read, i.e. the number of bytes read into the buffer.

skip skip = blocks read into the beginning of the buffer ibs * blocks block.

obs = bytes bytes bytes of the write-once, i.e., the number of bytes written to the buffer.

bs = bytes and set the read / write byte buffer (equal to the set ibs and obs).

cbs = byte bytes bytes conversion.

count = blocks copy only blocks block input.

conv = ASCII code is converted ASCIl EBCDIC code.

conv = ebcdic converting ASCIl in EBCDIC code.

conv = ibm to ASCIl code is converted to alternate EBCDIC code.

conv = block converts the variation to a fixed bit characters.

conv = ublock converted into a fixed bit position changes.

conv = ucase the lowercase to uppercase letters.

conv = lcase converted to uppercase to lowercase letters.

conv = notrunc not truncate the output file.

conv = swab switching each pair of input bytes.

conv = noerror error processing is not stopped.

conv = sync the size of each input record are transferred to the size of ibs (filled with NUL)

seek = blocks skipped blocks from the beginning of the output file before starting copying blocks. (Usually only when the output file is only valid disk or tape)

 How to make DD guide WIN LINUX
    dd BS = 512. 1 IF COUNT = = / dev / hda5 of = bootsect.lnx
  dd BS = 512. 1 IF COUNT = = / dev / hda3 of = bootsect.bsd

  And then to mount DOS partition, with the bootsect.lnx bootsect.bsd C copied to the root directory, basically done.

  And finally into Windows 2000, boot.ini file in the root directory of C editor, add the following two lines:

  C:BOOTSECT.LNX="Linux"
  C:BOOTSECT.BSD="FreeBSD"

  Then you can restart.

Reproduced in: https: //www.cnblogs.com/licheng/archive/2008/03/21/1116454.html

Guess you like

Origin blog.csdn.net/weixin_33912445/article/details/92631168