In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "the concept of Linux partition". In the daily operation, I believe that many people have doubts about the concept of Linux partition. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "the concept of Linux partition". Next, please follow the editor to study!
I. the concept of Linux zoning
First of all, I would like to introduce the concept of partition in Linux, which is hard for me to learn at the beginning. In Linux, each hard disk device can have up to four primary partitions (including extended partitions), and any extended partition must occupy a primary partition number, that is, in a hard disk, there are up to four primary and extended partitions.
For earlier DOS and Windows (versions prior to Windows 2000), only one primary partition was recognized, and the partition could be further refined by adding a logical drive letter (logical partition) to the extended partition. The role of the primary partition is for the computer to boot the operating system, so the boot of each operating system, or bootstrap, should be stored on the primary partition.
This is the difference between primary partition and extended partition and logical partition. When we specify the bootloader to install the boot Linux, it should be specified on the primary partition, which is an example of *. Linux specifies that the primary partition (or extended partition) occupies the first four numbers from 1 to 16.
Take * IDE hard drives as an example, the primary partition (or extended partition) occupies hda1, hda2, hda3, hda4, while the logical partition occupies 12 numbers such as hda5 to hda16. Therefore, each hard drive under Linux has a total of up to 16 partitions.
For logical partitions, Linux states that they must be built on extended partitions (as well as on DOS and Windows systems), not primary partitions. Therefore, we can see that extended partitions can provide a more flexible partition mode, but cannot be used as a boot for the operating system.
Before, I was not familiar with these concepts, so I took a lot of detours in the zoning. So, in the end what is a good zoning plan, I think it is a matter of opinion, I am divided in this way. In principle, / and / home basically * is to mount two partitions separately, because home can be regarded as a my document in windows, and the home is larger if you have more personal data.
It doesn't matter if it's smaller. It's said to be at least 2G, and I haven't tried it either. Others, such as / tmp and / var, because of the large number of active files, in order to avoid the impact of their file fragments on other areas, they hang a zone. * * / opt mainly installs large software. If you have any extra partitions, hang one for him.
2. Start zoning
Ok, I look at it this way, first of all, divide a 100m main partition out, mount boot. All the files needed to start grub are in the / b o o t directory. In this way, even if there is a problem with the work partition, it can still be started as long as there is no problem with the partition. Therefore, the method of * is to divide the root file into a section with a maximum size of 64m. I gave 100m for insurance.
The subsequent partitions all exist in the form of extended partitions, and there are many logical partitions under the extended partitions. First create a swap partition that is twice or twice the size of powerless memory. If your memory is 1G like mine, just tick 1G. In fact, it doesn't need to be that big. Remember to change the partition format to linux-swap.
Then create a partition as large as possible and give it to / usr, because most of the system software is stored here, including X Server and other graphical interface programs. I divided 20 gigabytes. Next, create a mount partition for / home. Considering that I have a lot of work documents, source code and programs are often put here, so I gave 10G.
For others, such as tmp,var, single-user workmachines don't have to be considered. Of course, I don't know if there will be server applications on my machine in the future, but I still allocate 2G of space to var. All other spaces are mounted to /. Although 2G is generally enough, but the more the better.
Note: in many cases, if you use the installation tool partition that comes with the Ubuntu hard disk partition CD, there will be a lot of problems. If you encounter a problem, two ways are recommended:
1 in the environment of live CD, use sudo fdisk / dev/xxx directly under the terminal
To partition, and then w to save the reboot, and then enter the installation tool, manually edit the registry it recognizes is your edited partition table, do not need to modify the next step.
2 you can also use the fdisk of livecd to divide the area, and then use the livecd on the CD
Installer program, installed on the command line. However, this installer only requires you to mount / and swap. What about the other partitions? You can divide it first, or you can divide it after installing the system. What if you mount other partitions to the desired directory? For instance. If you want to mount / home/user under the new sda8 partition, you can do this:
First, put / dev/sda8 mount into / mnt/sda8. If you don't have this directory, mkdir yourself. Then, cp-R / home/user/* / mnt/sda8/user, and cp-R / home/user/.* / mnt/sda8/user*** modify / etc/fstab by adding a line / dev/sda8 / home ext3 defaults 02 (parameters are determined by yourself).
At this point, the study of "the concept of Linux partition" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.