Use a USB flash drive to load the controller driver to install Linux

Source: Internet
Author: User
Article Title: Use a USB flash drive to load the controller driver to install the Linux system. Linux is a technology channel of the IT lab in China. Including desktop applications, Linux system management, kernel research, embedded systems, open source, and other basic categories. Generally, we need to load some scsi or RAID card drivers during Server installation, so that the operating system can detect the hard disk.
 
The general installation method is to use the soft drive, in fact, we can also load through the U disk.
 
Linux controller drivers are usually files ending with *. dd Or *. img. We can write them to the USB flash drive by using the dd command in linux. For example, the driver name is megaraid_sas.img.
 
Suppose there is a Linux machine, first copy the file to/tmp, and the device name of the USB flash disk is sdb.
 
Dd if =/tmp/megaraid_sas.img of =/dev/sdb
 
The cat command can also implement the function of dd. Note that sdb is not sdb1, but a device rather than a partition. If you write the file to sdb1, you can try to load the driver and it will fail.
 
Linux can write bare devices instead of windows. That is to say, if the USB flash disk is not partitioned in windows (which cannot be written in windows at this time), it can still be written in linux.
 
At of =/dev/sdb, it was written from the starting position of the USB flash disk. The result was simulated as a floppy disk. The first 446Bytes, that is, the "boot code", defined its type. At this time, you can get this USB flash drive to the windows Server and view the 1 GB capacity in disk management. However, right-click the disk and select 1.38 as the disk capacity, actually, windows is spoofed.
 
At this time, you can format the USB flash drive, decompress megaraid_sas.img in windows, and send it to the USB flash drive. The driver can still be loaded normally during system installation.
 
Why?
 
When operating on the USB flash drive in windows, windows will first read the USB flash drive "boot code" and think it is a floppy disk, because a floppy disk has no partition, that is, there is no partition table, and the space behind it is formatted. Simply put, the "boot code" will not be changed.
 
In linux, the data in the data can still be read. However, when fdisk-l/dev/sdb is used, the Partition table of the USB flash disk is faulty, you can use fdisk/dev/sdb to enter the interactive interface and use the "w" command to rewrite the USB flash disk to a USB flash disk without partitions.
 
It is very important to add that many people need to install the linux system after buying the server, but there is no linux environment. They cannot follow the steps above to write the driver to the USB flash disk, the test shows that the first redhat disk can be used to create such a linux environment. Assume that the driver to be loaded is the driver of the LSI sas RAID card.
 
The procedure is as follows:
 
1. First copy the driver to the USB flash drive in windows,
 
2. boot with the first redhat disk. When you are prompted whether to load the hard driver, select skip. This is the prompt that the OS does not detect the hard disk. In this case, skip can be used, then we need to load the graphical interface. At this time, we can press CTRL + ALT + F2 to switch to the console,
 
(In addition, the hard drive is loaded before the graphical interface is displayed. For this problem, I also invited a bottle of water from my predecessors. We can switch to F3 after the Console appears, f4. you can see the detailed process of kernel and installation)
 
3. Create two directories in the memory: mkdir/a/B
 
4. mount/dev/sda1/
 
5. cp/a/megaraid_sas-rhel40-all.img/B
 
6. umount/
 
7. dd if =/B/megaraid_sas-rhel40-all.img of =/dev/sda
 
8. Start the server again. After a boot occurs, enter the linux dd and select to add the driver from/dev/sda as prompted. The hard disk will be found (if multiple sdx devices exist, you can press CTRL + ALT + F4 to see which device your USB flash drive is)
 
After that:
 
Because the work can access servers with different CPUs, it is found that this method cannot be implemented on AMD cpu machines, and intel machines are no problem, the intel cpu can still load the graphic interface without finding the hard disk. If the AMD cpu cannot find the hard disk, it cannot continue, and the dd command is used to write the driver to the USB disk, the driver still cannot be loaded normally, that is, the hard drive cannot be loaded to the AMD cpu machine using a USB flash drive.
 
The results returned by Linux when detecting different CPUs are very different. It cannot be a redhat or AMD problem.
 

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.