Linux dd command details and use dd to test disk read/write capability

Source: Internet
Author: User

Linux dd command details and use dd to test disk read/write capability name: dd permission: All Users dd this command in manual is defined as convert and copy a file usage: dd [option] If you want to view manual Online, TRY dd -- help or info dd. If you want to see how this version works: dd -- version input or output dd if = [STDIN] of = [STDOUT] force the Size of input or output Bytesbs: dd-ibs = [BYTE]-obs = [SIZE] force only one Bytescbs at a time = BYTES to skip a section before outputting seek = BLOCKS to skip a section before entering skip = BLOCKS of course you can take this allows you to conveniently copy CDS (note, your CD can be renewed in the standard iso9660 format !) Dd if =/dev/cdrom of = cdrom. iso where the content after if and after of is adjusted according to your requirements. Then, run the command: cdrecord-v cdrom. iso is not about cdrecord, so the command above is the simplest but may not necessarily meet your hardware environment... function: Copies the specified input file to the specified output file, and supports format conversion during the copy process. You can use this command to implement the diskcopy command in DOS. Use the dd command to write the data on the floppy disk as a storage file on the hard disk, and then write the storage file to the second disk to complete the diskcopy function. Note that you should delete the storage file on the hard disk with the rm command. Standard input files and standard output files are used by default. Syntax: dd [Option] if = input file (or device name ). Of = output file (or device name ). Ibs = bytes: the number of bytes read from the buffer zone. Skip = blocks skip the ibs * blocks block at the beginning of the read buffer. Obs = bytes: the number of bytes written to the buffer zone. Bs = bytes: set the number of bytes in the read/write buffer at the same time (equal to setting ibs and obs ). Cbs = byte: bytes are converted once. Count = blocks only copies the input blocks block. Conv = ASCII converts the EBCDIC code to the ASCIl code. Conv = ebcdic converts an ASCIl code to an EBCDIC code. Conv = IBM converts an ASCIl code to an alternate EBCDIC code. Conv = block converts a variable bit to a fixed character. Conv = ublock converts a fixed bit to a variable bit. Conv = ucase converts lowercase letters to uppercase letters. Conv = lcase converts uppercase letters to lowercase letters. Conv = notrunc: the output file is not truncated. Conv = swab exchange each pair of input bytes. Conv = do not stop processing when noerror occurs. Conv = sync adjusts the size of each input record to the ibs size (filled with NUL ). Example 1: copy the content of a floppy disk to another floppy disk and use/tmp as the temporary storage area. Insert the source disk into the drive and enter the following command: $ dd if =/dev/fd0 of =/tmp/tmpfile, copy the source disk from the drive, insert the target disk and run the following command: $ dd if =/tmp/tmpfile of =/dev/fd0. After copying the floppy disk, delete the temporary file: $ rm/tmp/tmpfile Example 2: Set net. write this file into a floppy disk and set the number of read/write buffers. (Note: The content in the floppy disk will be completely overwritten) $ dd if = net. I of =/dev/fd0 bs = 16384 Example 3: copy the sfile TO THE dfile. $ Dd if = sfile of = dfile ================================ ============================================ dd can be used to test disk read/write capabilities first two special devices: /dev/null: Recycle Bin, bottom hole/dev/zero: generate character Ø test disk write capability time dd if =/dev/zero of =/test. dbf bs = 8 k count = 300000 because/dev // zero is a pseudo-device, it only produces a null compaction stream, it does not produce IO, so, IO is concentrated in the of file, and the of file is only used for writing. Therefore, this command is equivalent to testing the write capability of the disk. Testing disk read capability time dd if =/dev/sdb1 of =/dev/null bs = 8 K because/dev/sdb1 is a physical partition, reading it will produce IO, /dev/null is a pseudo device, which is equivalent to a black hole. of, IO is not generated on the device. Therefore, the IO of this command only occurs on/dev/sdb1, it is also equivalent to testing the disk's read capability. Ø test the simultaneous read/write capability time dd if =/dev/sdb1 of =/test1.dbf bs = 8 K. One is a physical partition and the other is an actual file, i/O (Read/dev/sdb1 and write/test1.dbf) is generated for reading and writing them. Suppose they are all in a disk, this command is equivalent to testing the disk's simultaneous read/write capability.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.