dd command to install Linux Installation Guide detailed steps

The face of high-volume server installation, people often keen to select "Unattended Installation" approach, but this approach requires too much of the server configuration is not suitable for beginners.

 

Unattended installation (Kickstart), also known as automatic installation, which works to create a file named ks.cfg records Linux system during the installation process requires manual intervention to fill a variety of parameters, appear to be when the installation process when filling out the parameters, the installer will have to go look for ks.cfg file the appropriate parameters, if not found, or the need for manual intervention. Therefore, under the premise of the need to fill all possible parameters ks.cfg document covers the installation process, the installer need only tell the location of the installation program ks.cfg file, you can achieve a fully automated installation.

This section describes the commands implemented dd hard copy, the method indirectly mounted Linux system, hard disk cloning by GHOST this manner analogous to the Windows.

First, let's take a look at the dd command system.

For starters, this section may order it later in learning to master the common Linux.

What is Linux dd command

dd command is used to copy the command file, a file that can copy the specified data block size, and the designated conversion while copying. Simply understood, dd command can be used between two hard copy (a complete copy of the original system and the same hard disk).

Dd command format is as follows:

[Root @ localhost ~] # dd if = input file = number of bytes of bs = count = the number of output files

Options:

  • if = input file: Specifies the source file or source device;
  • of = Output file: target file or target device;
  • bs = bytes: specifies the last input / output byte number, i.e., these bytes as a data block;
  • count = Number: Specifies the input / output number of data blocks;

【Example 1】

  [Root @ localhost ~] # dd if = / dev / zero of = / root / testfile bs = 1k count = 100000 # Create a 100MB size document testfile, / dev / zero is an input device, can use it to initialize file the device infinitely output 0 can be interpreted as 0 to testfile kept writing until filled 100MB;

[Example 2]

  [Root @ localhost ~] # dd if = / dev / sda of = / dev / sdb # copying the data to a hard disk of a hard disk in a second

[Example 3]

  [Root @ localhost ~] # dd if = / dev / hda of = / root / image # copying the data to the hard disk of an image file

Use dd command to copy the hard disk must meet the following two prerequisites:

  1. Need to bulk copy the same server hardware configuration. Typically, servers are purchasing bulk purchasing, configuration server are the same.
  2. Copy the hard drive when the need to manually replace the disk to be copied. SCSI hard disk on the server generally, hot-swappable SCSI hard disk, and does not require disassembly of the chassis, to replace the disc is very easy to copy.

In fact, the author of the year when the high-volume server maintenance is dd copy, rather than unattended installation.

Installation Linux command dd detailed steps

By learning more than we know, using the dd command to install Linux, in fact, a complete copy of the hard disk between its implementation process as follows:

  1. The master disk into a hard disk of the server socket, the disc is copied into the server second hard socket, be careful not inserted upside down.
  2. Perform the copy command  dd if=/dev/sda of=/dev/sdb. In dd command, if the specified copy source, of the specified copy destination. / dev / sda representative of the first SCSI disk, / dev / sdb SCSI disk represents a second block. This command will first hard disk data in the second block completely copied to the hard disk.

After the above two steps, you can achieve replication between servers. So, how does the efficiency of this method? Since the number of configuration and installation of software copy speed and server, so each server replication time of about 15~25 minutes, the efficiency can also be accepted.

Select unattended installation manner, but also affected by the configuration server and network bandwidth, and hard copy can be multiple servers simultaneously.

Published 33 original articles · won praise 0 · Views 421

Guess you like

Origin blog.csdn.net/linuxanz/article/details/103460797