Important partitions are retained during Linux system reinstallation.

Source: Internet
Author: User
Retained important partitions during Linux system reinstallation-general Linux technology-Linux technology and application information. For details, refer to the following section. For those familiar with Windows operating systems, it is generally known that only partition C is formatted when the system is re-installed, and other partitions are not moved, so as to keep the existing data as much as possible, greatly reducing data recovery. Similar operations can be implemented for Linux operating systems. Like using Windows, you must have a good plan for the hard disk partition before installing the Linux system for the first time, so that you can prepare for reinstalling the system without formatting the entire hard disk.

I usually do this: divide the hard disk into four partitions:/,/home,/opt, and swap (swap partition) (For ease of understanding, I don't need hda1, hda2 ,... or sda1, sda2 ,... ). TD. c4-I ~ 0

You can view the root partition/as a Windows C partition, and only format the root partition/when reinstalling the system /. The/home partition should store user directories and user accumulated data as much as possible, and/opt should be used for software installed by myself, such as java JDK and Eclipse. Swap partition swap is generally twice the memory size. To expand the memory in the future, I usually set it to 4 times the memory size. Of course, for users who do not want to separate/opt partitions, it is entirely possible to put them in a single partition with the root partition/, and they will be able to completely control the installed software in the future, for example, "green software" Eclipse, Ant, and Tomcat are all installed in their own user directories.

Based on the above ideas, my computer's hard disk capacity is 40 GB, the partition is roughly as follows:/home, 22G; SWAP, 2048 M;/opt, 5G; the rest are given to the root partition /. Remember this information. When you need to reinstall the system, select manual partitioning. Generally, the installation system will automatically detect existing partitions based on the size of existing partitions, you can quickly determine the location of the file system to be mounted to each partition, for example, the largest existing partition mounted to the/home directory. In this way, when the operating system (Linux) needs to be reinstalled, as long as the installation system can identify the previous partition, you can choose to only format the root partition, however, if other partitions are left intact, the important historical data of these partitions will naturally not need to be restored.

Such experience will gradually become familiar with the increasing number of Linux system reinstalls.

Note:

1. There should be no more partitions and the size should be different:

It is recommended that you only need/,/home, and swap, and set a rule for the partition size to facilitate identification when installing the system again, for example, to distinguish hard disks by the above three points, you can specify that/home is the largest,/second, and swap is the smallest. Only root partitions/formatting are performed each time you reinstall the system.

2. Make necessary backups:

Before reinstalling the system, make sure to back up the necessary data to prevent misoperations or use of the data that has accumulated for many years. This is also the habit of using any operating system to work. It is dangerous to put eggs in a basket.

3. Hard Disk Partition identification between different Linux releases:

If you are installing a release version that is completely different from the previous version, you should pay more attention to data backup, because the installation system of different versions cannot correctly identify the previous hard disk partition. GqN = & Y7] [F

4. Handling of old User Directories:

It is better to create a general user with the same name as before, the software configuration file under the user directory (to hide the file or directory ". XXX) may still work, delete useless or useless, and re-configure necessary;

5. Software Issues with the previous custom installation (such as in the/opt partition ):

If not, delete it and reinstall it. For example, if JDK is installed in this partition (directory), you only need to re-install it in the/etc/profile file or ~ /. Bashrc (~ Is your user directory) configure the path environment variable.

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.