Build a Linux CF card

Source: Internet
Author: User
The course of building a CF card Linux system-Linux Enterprise Application-Linux server application information. The following is a detailed description. Yan Jun, I will continue my research today to install the cropped Linux into the CF card, and then run the Linux system from the CF card. I have studied it for a while, I have also rebuilt all Linux systems. However, a problem occurred when trying to install the cropped system to the CF card and then start it. First, test the system file as it is into another hard disk and then restart the disk. However, the system failed, the reason is that I lost some file permissions when I took the test bay, so I checked the relevant information and went in this direction, the cp-Rfva command can be used to test the file attributes. parameter a indicates that the attributes are included together during the test. The test is successful.

2. Then I tried to run the system on the CF card. After I installed the system file into the CF card, I manually installed GRUB on the CF card and restarted the computer, if you change the BIOS to boot from the CF card, the result fails.

3. I analyzed various possible causes and made many attempts. Finally, I failed to start Linux from the CF card. Due to the time relationship, I had to switch to another task, and this task was temporarily put on hold. However, after my previous attempts, I basically suspected the cause of the failure to start the CF card system. It is possible that the CF card does not support the DMA mode for data transmission. When the system is started, it is always stuck in the DMA area. However, there was not much time to study it, so it was put down. Let's try again later.

4. Today, I finally have time to study the problem of starting Linux with the CF card. After the last research, I tried to solve the problem in this direction when I suspected that a problem might occur, first, disable the DMA options in the BIOS and try one by one, but the operation fails, finally, when there is no way, I thought I could try another computer (because my PC hardware is newer, I want to try another old PC). Finally, I try again, I entered GRUB successfully. Wow, I am very happy at this time. It seems that this is the first step to success.

5. Since GRUB is enabled, it indicates that the CF card should work properly. If the next system is enabled correctly, it should be able to start successfully. With this idea, I started to start Linux. First, I went to GRUB and wrote the command to start Linux in the GRUB command line.

Root (hd0, 4)
Kernel/boot/kernel-2.6.11.12-3 root =/dev/hda5
Boot

Then press Enter. Wow, the system kernel enters normally. However, during the kernel startup process, the hard disk DMA is too slow and an error is reported. At that time, I suspected that there was a problem, but I didn't know how to solve it. After a long wait, Linux finally entered the mount root fs, but this step went wrong, it is suggested that the root file system cannot be mounted. I often encounter this problem, but it is difficult to determine where the problem is. So I thought back to the screen printing information when the system was started and suddenly flashed (why does the kernel check the hdc device? My CF card should be hda? The parameter I passed to the kernel in GRUB is also written as root =/dev/hda5 ?) When I think about this, I seem to find the reason (maybe the system recognizes my CF card as hdc). Under normal circumstances, this result should be caused by only one reason, that is, the location of the IDE interface connected to my CF card is incorrect. So I restarted the PC and entered the BIOS, the BIOS shows that my CF card is in the third IDE location, and the reason why the root fs cannot be mounted is determined. Then I pulled the CF card and inserted it to the first location of the IDE, then we set the GRUB kernel parameters. After a long wait, wow, it's so exciting that the system has mounted the root fs normally, but don't be so happy. The problem is coming up again, that is, the system started the INIT process normally, but did not take a few steps, and the system prompts that the root file system could not normally enter. At this time, I felt strange, is the setting correct? I walked several times back and forth, while thinking, and suddenly it was a flash. One possible reason is that my system was taken from another hard drive, the partition corresponding to the hard disk is different. Now the problem is very clear, that is, the configuration of the fsttab file, so I will immediately remove the CF card, put it on another computer and change the fsttab file in the CF card to the correct one, and then put it back for testing. Wow, this time I was so excited that the system really got up and there was a login item. Although the system prompts several errors during the startup process, they are all configuration problems. It is not a big problem. Correct configuration should be normal. So I logged on to the system and went in. It was very normal and I was so happy. I am a bit perfectionist. I think this system is still not perfect. When I start the system, there is a kernel DMA setting error, and it takes a long time.

6. The problem is to solve the problem of loading DMA when the kernel starts. The first thing I think of is whether this option exists in the Kernel configuration options during kernel compilation? So I tried to make menuconfig again and found no options to disable or set the dma I needed, so I disabled all the options in the Kernel configuration options, re-compiled a kernel into the CF card, and then started the system, but the results were always unsatisfactory, the problem still exists. I walked around in the room and wanted to recruit! Finally, there is no possible reason to persuade yourself to try again. Alas, when I got to the toilet and sighed, was it really dry? Oh, by the way, I should ask google and baidu. Maybe they know? So I entered

Dma error linux and press Enter. Wow, I didn't expect many people to ask this question. In a lot of "medicines", I slowly found a cure for this disease. Suddenly, I found a very critical sentence, "I added a line of" ide = nodma "at startup. That's all ,... ", so I suspect this may be the medicine I need. I can't wait to restart the system and set the kernel startup parameters:

Root (hd0, 4)
Kernel/boot/kernel-2.6.11.12-3 root =/dev/hda5 ide = nodma
Boot

After the car, wait for dozens of seconds. Wow! The results are satisfying, and the problem has been solved. I am so happy! So far, the Linux Startup task from the CF card has basically been completed. Well, I'm glad to go on to the next step and configure the system.

7. SSH service self-starting configuration. Because this system is a re-built system based on LFS, it basically relies on its own to customize a variety of services, usually in other Linux releases such as Red Hat, CentOS, ARCH, DeBian, configuring this service is not a problem at all, but it is not true in this system. By observing the scripts in the/etc directory of the system, I found no rc. local, I manually created an rc. local, then add the command to start the SSH service, and restart the system. As a result, SSH does not exist. It seems that rc is manually added. the local file is useless. So I will further observe/etc/rc. d. I visited the directory several times and found that it should be in/etc/rc. d/rcsysinit. d. add something to implement self-startup, so I tried to execute: ln-s .. /init. d/sshd command, and then restart the system, I suspect that SSHD is started before the network, and cannot be connected without reading network information. Then, I carefully observed the/etc/rc. d/rcsysinit. d file. It seems that it is the startup script of the basic service required by the system. So I was thinking that the inittab setting in my system sets the startup level to "3" and should read the scripts in rc3.d during system startup, I had a solution to this, so I deleted/etc/rc. d/rcsysinit. d, and then enter/etc/rc. d/rc3.d directory is executed

Ln-s ../init. d/sshd S50sshd, and then restart the system. Haha, the system has taken another step forward, but at the same time, I understand that there is still a long way to go from a starting system to an available server operating system. Work hard. You can.

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.