Linux practice: detailed introduction to partition planning methods

Source: Internet
Author: User
Article Title: Linux practice: detailed introduction to partition planning methods. 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.

Note: If you have a certain degree of Linux Foundation, please remember that the minimum score/and swap when installing Linux. The following content may be difficult for Linux cainiao, but it can be used as a learning reference.

The "/usr" partition should be 1 GB idle so far. First, do you need to install a large number of software in your system? If you just try something fresh, stop here. As mentioned above, all the miscellaneous things are thrown into "/opt", and it is best to partition "/opt.

Divide "/opt" into five categories:

The system and all kinds of data need to be backed up, so we have "backup". Instead of putting all the user data in the "/" partition, we have created the "home" directory here "; if you have programs installed on your own, you can create the directory "prog". If you have public resources such as flash and mp3, you can create the directory "store". DOS/Window partitions are frequently accessed, therefore, it will not be placed in the temporary mount point "/mnt", but all will be placed in "zzz.

The first four directories can be divided into one partition for each directory, but I can only free up three more partitions. My own practice is to "backup" the next partition and "home" the next partition, "prog" is the next partition, "store" is actually created in "prog", and then linked to "/opt.

This is also subject to your actual situation. However, it is best to have a partition under "/opt/prog" because KDE handles some problems with links. In the personal home directory, various settings of the desktop environment are often stored, while the settings of different Linux distributions are different, therefore, under "/opt/home", I created some directories with the same name and permissions and linked them to the user's home directories respectively, named "123 ". Apart from installing software in it, all sorts of miscellaneous things are sometimes thrown into this "123" and are actually thrown into a directory under "/opt/home.

There are also several subdirectories in the "prog" directory:

"/Opt/prog/c ". "C", constant, fixed, and fixed. After installation, the old software cannot be moved to the nest, or too many may cause trouble to move the nest, such as the "JBuilder8" that has been used ". When a new software is installed, I don't know whether it works normally if I move the software to another location after the installation is complete, so the new software is usually installed here.

"/Opt/prog/l ". "L", linkable, can be connected everywhere. After the software in "/opt/prog/c" is installed, I will try to move the installation directory of the software to another place and rename the installation directory, then, use the original name as a symbolic link in "/opt/prog/c" to point to the installation directory renamed by shift. "Apache", "MySQL" and other software can still work normally under such circumstances. I will move this type of software from "/opt/prog/c" to "/opt/prog/l, in "/opt/prog/c", create a link pointing to the new location.

"/Opt/prog/m ". "M", moveable, can be moved around. There are also some software, such as "Tomcat", "JDK", and "PostgreSQL". Even if they are not in their initial installation location and change their names, you only need to change the environment variables, or do a little bit of setup, they can also work normally. This kind of software is very convenient to move, and I will move it to the place where I can leave immediately after I pat my ass.

"/Opt/prog/tmp ". Temporary utility stack. The installation file of the new software is temporarily put here. The new software is compiled and installed here.

"/Opt/prog/store ". I don't have more partitions for "/opt/store", so on my machine, "/opt/store" actually points to the symbolic link here.

To do this, we need to grab at least one partition from the Window. During Linux installation, it is best not to change the three partitions and the partitions in front of the Linux system. Only the partitions after the Linux system will be transferred, which will not affect Win. If your Linux server is installed in the last few partitions, or the subsequent partitions are not enough, you have to grab the previous partitions. In this case, it is best not to change the number of partitions. This will not have much impact.

Unfortunately, if you have to change the number of partitions, your Linux may not start after the adjustment. Now you have to use the boot disk created during installation. Calculate again to see which partition is your Linux "/" at this time. Assume that the Linux "/" partition is "hdxy" at this time. Use a floppy disk to boot and enter "linux 1 root =/dev/hdxy" when ":" is displayed ", linux will start at runlevel 1. Alternatively, you can use another method to enable Linux to start at runtime Level 1. Follow the previous steps to create a new boot sector image for Linux. Don't forget to adjust "/etc/fstab", which is also based on your actual situation.

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.