In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
How to partition the linux operating system? Many novices are not very clear about this. In order to help you solve this problem, the following editor will explain it in detail. People with this need can come and learn. I hope you can gain something.
1. What is zoning?
Partition is to divide a hard disk drive into several logical drives, and partition is to use continuous blocks of the hard disk as a separate magnetic hard drive. A partition table is an index of a hard disk partition, and the partition information is written into the partition table.
2. Why should there be multiple partitions?
Prevent data loss: if the system has only one partition, then the partition is corrupted and the user will lose all the data.
Increase disk space efficiency: partitions can be formatted with different block sizes. If there are many 1K files and the hard disk partition block size is 4K, 3K space will be wasted for each file stored. At this point, we need to take the average of these file sizes to divide the block size.
The surge of data to the limit will not cause the system to hang: separating the user data from the system data can prevent the tie hang caused by the user data filling the entire hard disk.
3. Introduction to the usage of the partition tool fdisk
Introduction to fdisk command parameters
P, print partition table. N. Create a new partition. D. Delete a partition. Q. Exit is not saved. W. Write the partition to the partition table, save and exit.
Example:
[root@localhost ~] # fdisk / dev/hdd
Press the "p" key to print the partition table. This hard magnet has not been partitioned yet. Press the "n" key to create a new partition. There are two menus e for extended partition and p for primary partition. Press the "p" key and prompt: "Partition number (1-4):" Select the primary partition number.
Enter "1" for the first primary partition. Press enter directly to indicate that the 1 cylinder starts zoning. Prompt the last cylinder or size. Enter + 5620m and press enter to indicate that the first partition is 5G space. Press "p" to view the partition. Such a primary partition will be divided.
Next, divide it into the second primary partition and give all the remaining space to the second primary partition.
Press the "n" key to add a new partition, press the "p" key to set the primary partition, enter "2" to set the primary partition number to 2, and press enter twice to allocate the remaining space to the second primary partition. Press "p" to print the partition table
Press the "w" key to save exit.
Readers can divide the appropriate partitions according to the size of their hard drives.
4. Use zoning
The partition of the hard disk must be formatted and mounted before using it.
[root@localhost ~] # mkfs.ext3 / dev/hdd1 [root@localhost ~] # mkfs.ext3 / dev/hdd2
Create a mount directory
[root@localhost ~] # mkdir / hdd1 / hdd2 mount / dev/hdd1 / dev/hdd2 [root@localhost ~] # mount / dev/hdd1 / hdd1 [root@localhost ~] # mount / dev/hdd2 / hdd2
View
[root@localhost ~] # df-h Filesystem Size Used Avail Use% Mounted on / dev/hda3 7.5G 2.8G 4.3G 40% / / dev/hda1 99M 17M 78M 18% / boot tmpfs 62m 062m 0% / dev/shm / dev/hdd1 2.5G 68M 2.3G 3% / hdd1 / dev/hdd2 2.5G 68M 2.3G 3% / hdd2
Now write data to the / hdd1 directory and store it on the hard drive / dev/hdd.
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
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.