In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
Today, I will talk to you about how to use the DD command to install linux. Many people may not know much about it. In order to make you understand better, the editor has summarized the following for you. I hope you can get something according to this article.
In the face of the installation of a large number of servers, people are often keen to choose the way of "unattended installation", which requires too much configuration of the server and is not suitable for beginners.
Unattended installation (Kickstart), also known as fully automatic installation, its working principle is to create a file called ks.cfg to record the various parameters that need manual intervention in the installation process of the Linux system. When the parameters appear to be filled in during the installation process, the installer will go to the ks.cfg file to find the appropriate parameters. If it is not found, manual intervention is still needed. Therefore, on the premise that the ks.cfg file covers all the parameters that may need to be filled in during the installation process, the installer only needs to tell the installer the location of the ks.cfg file to achieve a fully automatic installation.
This section describes how to use the dd command to copy the hard disk and indirectly install the Linux system, which is similar to cloning the hard disk with GHOST software under Windows.
First, let's take a systematic look at the dd command.
For beginners, this section can be learned after mastering common Linux commands.
What is the Linux dd command?
The dd command is a command used to copy a file. It can copy a file with a data block of a specified size and perform a specified conversion at the same time. To put it simply, the dd command can be used to copy between two hard drives (a complete copy of the same hard disk as the original system disk).
The format of the dd command is as follows:
[root@localhost ~] # dd if= input file of= output file bs= bytes number of count=
Options:
If= input files: specifying source files or source Devic
Of= output file: specify a target file or target device
Number of bs= bytes: specify how many bytes are input / output at a time, that is, treat these bytes as one data block; number of count=: specify how many data blocks are input / output
[example 1]
[root@localhost ~] # dd if=/dev/zero of=/root/testfile bs=1k count=100000
# create a 100MB-sized file testfile,/dev/zero is an input device that can be used to initialize the file. The device outputs 0 endlessly, which can be understood as writing 0 to testfile until it is full of 100MB
[example 2]
[root@localhost ~] # dd if=/dev/sda of=/dev/sdb
# copy the data from the first hard drive to the second hard disk
[example 3]
[root@localhost ~] # dd if=/dev/hda of=/root/image
# copy the data from the first hard drive to the image file
To copy a hard disk using the dd command, you need to meet the following two prerequisites:
The hardware configuration of the server that requires bulk replication is consistent. Usually, the procurement server is purchased in bulk, and the configuration of the server is the same.
When copying a hard disk, you need to replace the copied disk manually. There are generally SCSI hard drives on the server, and SCSI hard drives support hot plug, and there is no need to remove the chassis, so it is very convenient to replace the copied disk.
Detailed steps for dd command to install Linux
From the above study, we know that installing Linux using the dd command is actually a complete copy between hard disks, and the implementation process is as follows:
Insert the master disk into the first hard disk socket of the server, and insert the copied disk into the second hard disk Jack of the server. Be careful not to insert it backwards.
Execute the copy command dd if=/dev/sda of=/dev/sdb. In the dd command, if specifies the replication source and of specifies the replication destination. / dev/sda represents the first SCSI disk, and / dev/sdb represents the second SCSI disk. This command completely copies the data from the first hard drive to the second hard disk.
After the above two steps, the replication between servers can be realized. So how efficient is this method? Because the speed of replication is related to the configuration of the server and the amount of software installed, the replication time for each server is about 15 to 25 minutes, and the efficiency is acceptable.
The choice of unattended installation is also affected by server-side configuration and network bandwidth, and hard disk replication can also be operated by multiple servers at the same time.
After reading the above, do you have any further understanding of how to use the DD command to install linux? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
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.