System Administrator's Linux system maintenance manual

Source: Internet
Author: User
Article Title: System Administrator's Linux system maintenance manual. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
   I. misunderstandings about Linux
1. What is Linux used?
  
First, few users use Linux as a desktop system, because Windows desktop system is good enough. We mainly use Linux as the operating system of the network server. If you and your application meet the following requirements, you should use Linux:
  
* Users are reluctant to spend money on operating systems and network applications.
  
* Use the version D system to be condemned or afraid to take responsibility.
  
* If you want to get the same performance as that of a system that spends money.
  
* Relatively high level in front of users.
  
* Get to know a few Linux experts, or know where to find the answer.
  
2. Are there many differences between each Linux release package?
  
If you were using a lot of PCs from the end of the 1980s s to 95 years ago, you should be very familiar with Linux: it is like a DOS with 32-bit preemptive multitasking core, the difference is that the appearance looks like a UNIX. Linux is built by many people with wisdom. Beginners often ask: "is RedHat good or Slackware good ?". This person also faces hundreds of choices, which is indeed a headache. Most Linux release packages are actually very simple. Almost all release packages have the same kernel (maybe different versions ), the differences between external commands and data files are only limited to different storage locations in the file system (which leads to some compatibility problems because specific files cannot be found in some places ). In addition, some release packages add some utilities to the release package to show their excellence. In fact, there are not too many manufacturers who need to modify the kernel, because this will make the kernel official version constantly updated and messy. Of course, some embedded system developers have made their own systems based on Linux.
  
Having a large number of release packages is a very annoying problem for Linux. At this point, I prefer FreeBSD because it only has one official release version and runs stably. There are too many programmers who can make software for Linux, and more information is provided on Linux. Remember: when a guy tells you which release version to use doesn't matter, he is an expert.
  
3. What are Linux amateurs?
  
This publicity gave many people the impression. In fact, Linux is a serious operating system and has all the features common to the operating system. It can be used in many serious scenarios.
  
4. Is Linux performance better than Windows?
  
The answer here will disappoint you. According to my previous tests, the core performance of Linux 2.2 is lower than that of windows. It is gratifying that the core performance of version 2.4 has greatly improved, basically close to Windows. However, the complex GUI of Windows2000 occupies a considerable amount of system resources.
  
5. Is Linux more complex and professional than Windows?
  
In terms of complexity, Windows2000 is much more complicated than Linux. Windows is also more advanced in core technologies.
  
6. Is Linux more reliable?
  
The reliability of the system should be evaluated from two perspectives. (1) the reliability of the system is similar to that of the two. Windwos is generally believed to be less reliable than Linux because of the large variety of Windows software. Of course, Linux has a simpler structure than Windows, which can also improve reliability to a certain extent. (2) from the security point of view, Linux is much higher than Windows systems, and the principle is simple: great fortune. In addition, the open source code mechanism of Linux makes it possible to quickly discover and eliminate vulnerabilities. Windows is relatively bureaucratic. Here I add that the most reliable system I have ever used is the bsd OS, which is both reliable and secure.
  
7. Does Linux really have to spend a penny?
  
Most release packages require a small amount of money. Of course, you can also go DOWN from the network. In fact, these release packages may not be consistent with your application. Generally, they must be modified and customized to run well. Of course, the cost is incomparable to that of Windows.
  
   Ii. Precautions for Linux Installation
Most of the current release packages are easy to install, basically in a graphical wizard. Each release package is not the same and cannot be described one by one. If you do not even understand the installation, so we should not use Linux. Here are just a few notes.
  
1. To mix Windows with Windows, install Windows first and then Linux.
  
2. When partitioning, You can flexibly decide the partition according to the software to be installed. Common partitions include:/,/root,/usr,/var, and swap. The swap partition type must be set to another one, its space is generally twice the physical memory. /Root partitions are used by the root user in an emergency. It can be 64 MB.
  
3. Of course, you can install the release package for your convenience. However, my habit of installing Linux is to install a minimum system and then install all the compilation tools. The methods for installing the compilation tool are generally implemented through the package management tool of the release package, which is the most convenient. For example, in TurboLinux, run/usr/sbin/Turbopkg. Select all the Developoment-related options or gcc-related options in the management tool.
  
4. lilo must be installed. Otherwise, it is hard to solve the partition problem.
  
5. If it is mixed with Windows, the system will not be able to start after it is installed. You can use the 98 boot disk, and then use FDISK/MBR to reply to the primary boot partition to save the Windows partition.
  
After installing the minimal system and a full set of compilers, we should get a relatively clean system. On this system, you can download and install various applications.
  
   III. Basic use
1. File System
  
No matter how many partitions there are, the entire file system is a complete tree structure. Frequently Used directories include:
  
(1)/usr: used to store various application files. The/usr/local is used to store the installed software.
  
(2)/var: used to store all data files
  
(3)/proc: the files in it are used to indicate various configurations and statuses of the system kernel. This is not a real file system, but a variety of data in the memory. You can obtain some common system information from here. For example, CPU memory or something.
  
(4)/etc: All system configuration files are placed here. Generally, the configuration file of the software installed later will not be placed here. Unless you install the software with the release package with RPM or you intentionally do this. I don't like to mix different software files, so I usually put different software configuration files in their respective directories.
  
2. Common commands
  
Here I will list some frequently used commands. For specific usage instructions, refer to the relevant manual page (hopefully your English is not as bad as mine ).
  
Vi (this must be something you hate very much. If you give in, you can choose another editor called pico, which is a bit like DOS edit)
  
Head (used to view long files)
  
Tail (same as above)
  
Netstat (view network status)
  
Tar(open the compressed package of .tar.gz)
  
Ps (view process)
  
Kill)
  
Top (view system conditions)
  
Shutdown (shut down the system)
  
Cat (View File Content)
  
Ping (view network connectivity)
  
Ftp (Transfer File)
  
Man (manual)
  
These commands are the most commonly used, so you must remember the basic usage. In fact, each person can remember all the commands or all the parameters of a command, just remember a few common ones. Other books.
  
3. kernel upgrade
  
Skip this section if you are not willing to take risks. However, based on my actual experience, the kernel performance of version 2.4.x is at least 40% higher than that of version 2.2.x, which is worth a try. Currently, almost all of the latest release packages have a new 2.4 kernel, but the version number is conservative. Here, it is recommended that you first check the so-called "currect version release note" information when deciding to upgrade any part, which tells you what changes have been made to this version upgrade. If the modified content does not involve your current environment or needs, but adds drivers for some malicious devices, you do not have to rush to upgrade. In addition, the middle of the Linux kernel version number is an odd number of non-stable versions, such as 2.3. If it is an even number, it is a stable version.
  
To upgrade the kernel, follow these steps:
  
(1) first find the kernel file you intend to upgrade on the Internet, the general name is: linux-2.x.xx.tar.gz, copy this file to/usr/src. (I don't know where to find it? Look at: http://www.kernel.org, it is best to find the .tar.gz format, such as here: http://www.kernel.org/pub/linux/kernel/v2.x ). The following is an example of upgrading from 2.2.18 to 2.5.7 (this is the latest kernel. Do not forget to change the version number when using other versions)
  
(2) decompress: tar zxvf linux-2.5.7.tar.gz to generate a directory: linux-2.5.7.
  
(3) enter/usr/src and use ls? The l command shows a connection in src, similar to: linux-> linux-2.2.18/(the connection points to your current kernel version ). First Delete this connection (rm linux) and use the ln-s linux-2.5.7 linux Command to recreate the connection. I think you won't even copy the version number here, will it?
  
(4) enter the linux-2.5.7 directory, if it is not the first time to compile this kernel, it is best to use the command: make mrproper Delete the last compiled generated. o file, of course, the previously saved configuration is also lost.
  
(5) run the "make menuconfig" command to adjust the Kernel configuration to adapt to your current environment. Remember, do not change configurations that you do not understand. The first task is to adjust the environment of various hardware, such as scsicard: SCSI support/SCSI low-level drivers. Do you know the current scsicard model? It can be found in/proc/scsi. There are also Network adapters in Network Device Support. Do you know the current Nic model? It can be found in this file:/proc/net/PRO_LAN_Adapters/eth0.info or/proc/pci. In menuconfig, use the space key to change the option status. The preceding <*> indicates that this function is compiled in the kernel and runs fast. <> This function is not required. Compile the function into a module. Some drivers are usually compiled into a module to reduce the size and ease of replacement.
  
(6) make dep (check the file integrity, the process is very complicated)
  
(7) make bzImage pay attention to Case sensitivity (the compilation started! I think this is the most enjoyable, and the screen is "choppy". At this time, you will feel how many unknown programmers have contributed to this complicated system)
  
(8) make modules (compile functional modules or drivers marked)
  
(9) make modules_install (copy the compiled module to the specified location, usually/lib/modules /. Note: modules of different versions are completely separated in different directories, because modules is closely related to the kernel, and mixing may cause system crash)
  
(10) cd/usr/src/linux-2.5.7/arch/i386/boot, with the command: cp/
Related Article

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.