Home>Article>Operation and Maintenance> How many partitions are there in linux
There are three partitions by default in Linux: 1. Boot partition, which is the partition where the kernel and files used during the boot process are stored. It is some core files used when starting Linux; 2. swap partition, which is It is a virtual memory partition under Linux. Its function is to virtualize the disk space into memory for use after the physical memory is used up; 3. The root partition, also known as the system partition, everything in the system is stored in the root partition and is also used. Called the root partition.
#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
Linux can be divided into 3 partitions by default, namely the boot partition, the swap partition and the root partition.
boot partition
In linux, boot is the partition that stores the kernel and files used during the boot process. It is the partition that starts linux Some core files used during boot include the system Kernel configuration file, the directory of the startup management program GRUB, the main source of module supply during startup, the Initrd file and the vmlinuz file.
/boot partition is the kernel of the operating system and the files used in the boot process. It is usually a partition required by the version a few years ago. The size is about 100MB, but now the new version does not require it. This partition is divided separately, which means you can leave /boot alone.
Installing Linux only requires two basic partitions, namely the root partition and the swap partition. If your disk space is large enough, you can allocate more space to the root partition. You can also create commonly used directories on the desktop, such as Putting the downloaded software package on the desktop will not affect the speed of your entering the Linux system. Of course, this requires you to have a large enough root partition.
swap partition
SWAP is the virtual memory partition under LINUX. Its function is to transfer the disk space ( That is, the SWAP partition) is virtualized into memory to use
It has a similar function to the swap file of the Windows system, but it is a continuous disk space and is invisible to the user.
It should be noted that although this SWAP partition can be used as "virtual" memory, its speed is much slower than physical memory, so if you need faster speed, you cannot place high hopes on SWAP ,The best way is still to increase the physical memory. The SWAP partition is only a temporary solution.
The reasonable value of the swap partition (swap) is generally about 2 times the memory?
A popular and rumored saying is that when installing a Linux system, the size of the swap partition swap should be twice the memory. In other words, if the memory is 2G, then 4G of hard disk space should be allocated as swap space. In fact, this is a serious waste. The real situation is: you can decide the size of the swap partition based on the size of your system memory and the programs you use, or you can even eliminate the need for a swap partition at all!
Root partition
The Linux root partition means the system partition. Everything in the system is stored in the root partition, also known as is the root partition; Linux is a tree file system, and the root partition is its root node. Any directory files will be hung below the root node, and Linux has only one root. No matter how many partitions the hard disk is divided into, these partitions must be It can be used only after being mounted to the root directory.
The so-called root partition, to put it bluntly, is the system partition, the root partition, and everything is placed in it.
Linux is a tree file system, the root partition is its root node, and any directory files will be hung below the root node. Linux has only one root. You can partition your hard disk, but the partition device must be mounted to a specified location under the Linux root directory, such as /usr, /var, /home, etc. If you want to operate on a partition, you can only operate in the directory where the partition is mounted. Therefore, no matter how many partitions the hard disk is divided into, these partitions must be mounted to the root directory before they can be used.
Recommended learning:Linux video tutorial
The above is the detailed content of How many partitions are there in linux. For more information, please follow other related articles on the PHP Chinese website!