Linux DD Command

Source: Internet
Author: User


if = input file (or device name).

IBS = Bytes Reads bytes bytes At a time, that is, the number of bytes read into the buffer.

Obs = bytes Writes bytes bytes At a time, that is, the number of bytes written to the buffer.

CBS = bytes Converts bytes bytes at a time.

CONV = ASCII converts the EBCDIC code to an ASCII code.

CONV = IBM converts ASCII code to alternate EBCDIC code.

CONV = Ublock Converts the fixation into a change bit

CONV = LCase The letter from uppercase to lowercase.

CONV = swab swaps each pair of input bytes.

Conv = sync puts the size of each input record to the size of the IBS (filled with IBS).

Low-level format floppy disk.

2. Example Analysis
2.1.1 Full disk data backup and recovery

Backup
back up the local/DEV/HDX full disk to the/DEV/HDY:DD IF=/DEV/HDX Of=/dev/hdy
image file that backs up/DEV/HDX full data to the specified path: DD IF=/DEV/HDX of=/path/to/image
back up the/DEV/HDX full data and compress it with the Gzip tool to save to the specified path: DD IF=/DEV/HDX | gzip
>/path/to/image.gz

2.1.2. Remote Backup with Netcat

perform this command on the source host backup/dev/hda:dd If=/dev/hda bs=16065b | netcat < Targethost-ip >

bs=16065b

Previous directory:

Netcat-l-P 1234 | gzip > Partition.img

Backup disk starts with the 512Byte size of MBR information to the specified file: DD IF=/DEV/HDX of=/path/to/image

Recovery:

2.1.4. Backing up floppy disks

Backup floppy data to the current directory's disk.img file: dd if=/dev/fd0 of=disk.img count=1 bs=1440k

bs=1024

2.2. Increase the size of the swap partition file

Create a file that is large enough (256M here): DD If=/dev/zero of=/swapfile bs=1024 count=262144

Enable this swap file: Swapon/swapfile

Swap Defaults 0 0

It can be used to destroy data in some necessary situations. After you do this,/DEV/HDA1 will not be able to mount, create and copy operations

2.4 Disk Management

DD If=/dev/zero bs=1024 count=1000000 of=/root/1gb.filedd if=/dev/zero bs=2048 count=500000 of=/root/1Gb.file

DD If=/dev/zero bs=8192 count=125000 of=/root/1gb.file

DD If=/root/1gb.file bs=64k | DD Of=/dev/null

2.4.3. Repairing the hard drive

magnetic flux point is generated on the disk when the hard drive is not used for a longer period of time (for example, one or two years). When the head reads

HDD Scrap. The following commands are likely to bring the data back to the brink. And the process is safe and efficient.

<span style= "" Line-height: "font-size:=" "font-family:=" "background-color:=" ">dd IF=/DEV/SDA OF=/DEV/SDA

This article from "⑩ Sonnien Mill one Tsurugiishi, widows cold foaming zeng." blog, be sure to keep this source http://rinehart.blog.51cto.com/822394/1431539

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.