Linux system configuration and optimization experience

Source: Internet
Author: User
Article title: Linux system configuration and optimization experience. 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.
Author: Wang Jiping
  
  
As a Linux enthusiast, I have installed various Linux distribution kits. During each installation process, a large number of configurations
Optimization takes a lot of time and may cause some details to be omitted. This document is for installation and use
RedHat 6.1 is used as an example to talk about some of your experiences and communicate with friends who participate in the IBM "I love Linux" online gathering.
  
About Hard disk partitioning
  
In my experience, when installing Linux, we must create separate partitions to store users' private data.
It can be used to back up system configuration files for later configuration.
  
Edit the/etc/inittab file
  
Most Linux releases have six Virtual Consoles. In fact, three are sufficient and can
Saves valuable memory space. Edit the/etc/inittab file and add # to the front of the following three lines #.
  
4: 2345: respawn:/sbin/mingetty tty4
5: 2345: respawn:/sbin/mingetty tty5
6: 2345: respawn:/sbin/mingetty tty6
  
Run init q to re-read the/etc/inittab file, and disable virtual control of tty4, tty5, and tty6.
Platform. If you do not consider system security, you can use the fourth virtual console to view various system information,
Edit the/etc/syslog. conf file and add it to the last line:
  
.? /Dev/tty4
Then run killall-HUP syslog.
Edit the/etc/inputrc file
  
You only need to edit the/etc/inputrc file, set INPUTRC environment variables, and use the Tab command to complete the full function.
It can implement the DOSKEY function similar to MSDOS. In this way, various operations on files and directories are convenient and convenient.
  
Edit the/etc/rc. local file
  
If you need to customize your login information, make sure to modify the/etc/rc. d/rc. local file because
The/etc/rc. d/rc. local file must be modified by the/etc/issue and/etc/issue.net files.
Customize your/etc/issue file to speed up the Linux boot process and add the following content:
  
Echo "base = 0xd8000000 size = 0x800000 type = write-combining">/proc/mtrr
# Enable NumLock
For tty in/dev/tty [1-3]; do
Setleds-D + num <
Done
  
Customize the vim environment
  
In Linux, there are many editors, including emacs, vim, and joe.
Linux users, the author's suggestion is to find a few reference books, first understand the use of these editors,
After Linux is installed, you will not be confused when editing and viewing some configuration files.
  
Edit the/etc/mtools. conf file
  
Generally, both Windows 98 and Linux operating systems are installed on your own machine.
Package, you do not need to install the corresponding file system, which can be between MSDOS, Windows 98 and Linux file systems,
Read, Write, move, and display files. Suppose Windows 98 is installed in/dev/hda1,/dev/hda5
In the partition, modify the/etc/mstools. conf file and add the following content:
  
Drive c: file = "/dev/hda1"
Drive d: file = "/dev/hda5"
In this way, you can execute commands such as mdir c.
  
Copy various configuration files
  
Edit and copy the corresponding configuration file, for example, samba configuration file/etc/smb. conf,
The configuration file of the domain name server and the DHCP configuration file/etc/dhcpd. conf. Normally, these files
Once configured, few changes are made, which can save a lot of time. Make sure that the original configuration file is ready.
Backup. if the configuration file is changed, back up it!
  
Compile Linux kernel
  
Generally, the kernel installed in various Linux system suites is suitable for most machines, but the disadvantage is that the kernel is large and complete.
Contains many modules that are not needed at all. You can only configure the kernel according to your own needs and machine hardware conditions,
In order to achieve the optimal. Note that you must have a comprehensive understanding of your machine before compiling the kernel.
I am aware of it.
  
The following is a brief procedure for compiling the kernel: (redhat6.1 is used as an example)
  
1. log on to/usr/src/linux, edit the Makefile file, and modify EXTRAVERSION =-xx. xx indicates editing.
The translated version number, preferably a number that is greater than the original value.
  
2. configure the kernel based on the hardware configuration of your machine.
  
# Make menuconfig
  
3. streamline the dependencies between files and clear the previously generated target files and other files.
  
# Make clean; make dep
  
4. Compile and install the kernel and install the module.
  
# Make bzImage
# Make modules; make modules_install
  
5. install the kernel.
  
# Cp arch/i386/boot/bzImage/boot/vmlinuz-y.y.yy-xx
Copy the kernel to the/boot directory. y. y. yy indicates the Linux version and xx indicates the compiled version.
# Cp System. map/boot/System. map-y.y.yy-xx
# Cd/boot
# Ln-s System. map-y.y.yy-xx System. map
Finally, edit the configuration file/etc/lilo. conf of lilo.
  
6. test the new kernel.
  
After the boot is complete, check whether the modules. dep file is created in the/lib/modules/y. y. yy-xx directory.
If the file exists, you can modify/etc/rc. d/rc. sysinit and set the command content related to the execution module dependency.
Annotations to accelerate the Linux startup process.
  
Note that before testing the new kernel, you 'd better keep the original kernel so that if the new kernel fails to boot Linux
You can use the old kernel to guide the Linux operating system.
  
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.