Commonly used solutions
## is divided into 3 areas(recommended learning: Linux video tutorial )
1. Mount point /; primary partition; install system and software; size is 30G; partition format is ext4;
2. Mount point /home; logical partition ; Equivalent to "My Documents"; The size is the rest of the hard disk; The partition format is ext4;
3. swap; Logical partition; Acts as virtual memory; The size is equal to the memory size (I am 2G); The partition format is swap
4. /boot; boot partition; logical partition; size is 200M; partition format is ext4;
button and - button Used to add and delete partitions, change partition attributes (partition format and mount point)
Of course, if you do not separate these spaces independently and use / spaces together, you will have the best space usage efficiency, but this will easily cause system instability or other problems. As mentioned earlier, the root directory of the Linux file system must be mounted. Directories mounted without a specific partition will be placed in the same partition as the root directory.
/bin, /sbin, /lib, /etc, /dev these five directories. It must not be separated from the partition where / is located, because these five directories store necessary tools and data for the system. When the root directory is mounted during the boot process, these tools and data are needed to maintain normal operation. If these five directories are placed in other partitions, the system will not boot normally. Directories above
must not be mounted to other partitions. There is no need to place the directory in a different partition from the root directory:
Such as /cdrom, /mnt, /media, /proc, /run, /sys, /srv, etc. These directories can be placed in other partitions, but there is no need to do so, because the existence of these directories is only needed to maintain operation during operation, and most of them will not take up space. Placing it in other partitions will not benefit the performance of the system. For example, /mnt, /media, and /cdrom only provide a mount point so that physical storage media can be mounted; or, for example, /sys and /proc are actually data on the memory, and all the above data will not occupy the hard disk space at all. . So these directories do not require additional partition storage.
It is mentioned in the FHS recommendation that the smaller the partition where the root directory is located, the more conducive it is to the stability of the system and avoiding other interference; when an error occurs, it will be easier to maintain and correct; and it can improve the performance of the system. . Next, it is best to separate it from the root directory and go to the directories of other partitions:
The so-called "best" means that it is not "necessary" for the stability of the entire operating system. As I said at the beginning, as long as "/" exists, the Linux system will work.
/home /var /usr The three must consider which space must be additionally divided (refer to the role of each partition later). Of course, in terms of system stability, it is best to separate them.
Linux Operation and Maintenance Tutorial column to learn!
The above is the detailed content of ubuntu partition scheme. For more information, please follow other related articles on the PHP Chinese website!