In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how to use the dd command to back up a Linux system. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Dd, the abbreviation of device driver, can be called "the porter in the Linux world". It is used to read the contents of equipment and files, and copy them to the specified location intact.
Example 1: back up the entire hard disk
Use the dd command to back up the entire hard drive. In this example, the device name of the source hard disk is / dev/ sda, and the device name of the destination hard disk is / dev/ sdb. Execute the dd command to back up the entire hard drive / dev/sha to another hard drive / dev/sdb on the same system. As follows:
[root@linuxprobe ~] # dd if=/dev/sda of=/dev/sdb- "if" followed by the input file, and "of" followed by the output file. -any errors in the execution of the above command will fail. However, if you add the parameter "CONV= NOERROR", it will continue to copy even if there is an error in the execution. -input and output files must be checked repeatedly before execution. If the order of the two files is reversed, you may lose all your data.
When backing up the entire hard drive, we can also add the sync parameter to synchronize Icano. As follows:
[root@linuxprobe ~] # dd if=/dev/sda of=/dev/sdb conv=noerror,sync example 2: create an image of a hard disk
Use the dd command to create an image file for the hard drive and save it to another storage device. This backup method has many advantages: one is easy to use, the other is that this backup method is faster than other methods of backup, but also allows you to recover data more quickly. Create an image command for hard disk / dev/sda:
[root@linuxprobe ~] # dd if=/dev/sda of=~/sdadisk.img example 3: restore hard disk image files and restore data
Use the dd command to restore the image file of the hard drive to another hard drive. As follows:
[root@linuxprobe ~] # dd if=sdadisk.img of=/dev/sdb
The Sdadisk.img file is the image of / dev/sda, so the above command will restore the image of / dev/had to / dev/sdb
Example 4: create a floppy disk image
Use the dd command to create an image backup of the floppy disk. The input file fills in the location of the floppy drive device, and the output file writes the name of the floppy disk image file, as shown below.
[root@linuxprobe ~] # dd if=/dev/fd0 of=myfloppy.img example 5: backup partition
Use the dd command to back up the hard drive partition. Enter the file to fill in the device name of the partition, and the output file to fill in the target path or image file you specified. An example of the dd command is as follows:
[root@linuxprobe ~] # dd if=/dev/sda1 of=~/partition1.img example 6: CD backup
The dd command allows us to create an iso file of the source file, so we can insert CD and enter the dd command to create a CD iso file content.
[root@linuxprobe ~] # dd if=/dev/cdrom of=tgsservice.iso bs=2048
The dd command reads a block from the input and writes it to the output file. You can specify the block size of the input and output files. The parameter "bs" specifies the block size of the input and output files. The above dd command uses a block size of 2048 bytes. Note: if the disc is mounted automatically, it is best to drop umount before using the dd command to create an iso image to avoid unnecessary access to the CD ROM.
Thank you for reading! This is the end of this article on "how to use dd commands to back up Linux system". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.