Optimize Ubuntu from the beginning

Source: Internet
Author: User
Tags root directory backup linux

At the beginning of installing a Linux system, you should consider how to get the best performance out of your Linux system. Linux itself is also designed to be a good extension of the form, for example, in the Linux system, we can arbitrarily organize disk partitions, some friends like A/, a swap is done, in fact, this is not a very scientific choice, I in many times after reloading, summing up some experience, and friends to share, If there is something wrong, make sure you criticize it.

The first part of a computer with only one hard drive installs Linux

I mentioned in the Forum optimization preliminary article, Linux also has disk fragmentation, so in order to reduce fragmentation, the content of the frequently changed directory in a separate partition. An optimized partitioning strategy that can improve the performance of Linux systems, reduce disk fragmentation, and improve disk I/O capabilities. From the point of view of easy backup data, because many backup tools are efficient at backing up the entire partition, we should allocate a few main directories of the Linux system as separate file systems for each of them.

Here is a brief introduction to several important directories, these directories in Ubuntu installed hard disk partitions, optional special partitions, mounted.

/usr file system in general unchanged files, such as libraries, programs.

The/var file system contains files that will change.

The/home file system contains the user's home directory, which is all the actual data on the system.

/tmp temporary file.

/usr/local This is the/USR directory provided to the general user, where the software is best suited for installation.

/srv Some of the service started, the required data is placed here.

/opt Some large programs, installed here, easy to manage.

/root directory, nothing to say.

My suggestion is that all of the above directories are partitioned separately on the hard drive, and if you want to ask why, I can give an example.

For example, LUMAQQ, this software, we can install him under/OPT, so that if we need to reinstall the system, we can choose not to format the/opt, and ~/.lumaqq This folder back up, so when we reinstall the system, the/opt to mount again, Just put the. Lumaqq This folder under, configure Java, and run a command:

代码:
sudo ln -s /opt/LumaQQ/lumaqq /usr/bin/lumaqq

You can use Lumaqq again, and chat records, such as a series of LUMAQQ related settings will not disappear, avoid the trouble of downloading, but also less installation trouble.

From the point of view of disk fragmentation,/tmp,/var, and/home are the most active partitions, and if we put them directly in the root directory will inevitably cause problems, then the disk fragmentation affects the performance of the entire disk.

Therefore, I recommend that all the above directories are individually partitioned and mounted separately.

In the partition is also a certain degree of ingenuity, according to the characteristics of the disk, we know the more by the disk outside the cylinder, the faster the rotation, and each rotation, the disk read-write head can cover more areas, it means that the external cylinder can be better performance. Therefore, in partitioning, we should consider the high frequency of access to the system can affect the relatively large partition on the disk on the external points. The best scheme from the outside to the inside should be:

/boot->swap->/home->/var->/tmp->/srv->/opt->/usr->/usr/local->/

Of course, there is absolutely no need to stick to this rule and the hard drive to make large-scale changes, can be based on existing partitions to adjust.

The other thing to say is that after you've divided the area, do not use all the space, should leave a few empty partitions as a backup, such as my hard disk last partition is a up to 30g backup partition, which stores all the files I downloaded on the Internet, some of my own things, and in addition to this partition, I also have a 10g large partition that doesn't store anything, just to defragment the disk.

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.