DD Skip and seek parameter understanding (RPM)

Source: Internet
Author: User

If I have a file abc.gz, size 83456k, I would like to use the DD command to achieve the following backup results: First, the backup is divided into three parts, The first part is the backup file abc.gz the first 10000k, the second part is divided into the middle 70000k, the last backup behind the 3456k.

The backup method is as follows three commands:
DD if=abc.gz OF=ABC.GZ.BAK1 bs=1k count=10000
DD if=abc.gz OF=ABC.GZ.BAK2 bs=1k skip=10000 count=70000
DD if=abc.gz OF=ABC.GZ.BAK3 bs=1k skip=80000

The recovery method is as follows:
DD IF=ABC.GZ.BAK1 of=abc.gz
DD IF=ABC.GZ.BAK2 of=abc.gz bs=1k seek=10000
DD If=abc.gz.bak3 of=abc.gz bs=1k seek=80000

Then you look at the recovered files will be the same as your original file, indicating that the backup was successful!

Explanation: Skip=xxx is the backup when the part after the if is the original file skip the number of blocks before starting the backup, Seek=xxx is at the time of the backup of the part of the target file skip the number of blocks before you start writing.

DD Skip and seek parameter understanding (RPM)

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.