In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Abstract: this article will introduce the partition and installation of the new hard disk under the linux through the virtual machine VMware simulation to add the new hard disk. In this paper, we will add a virtual hard disk with 10G SCSI interface through a virtual machine, then create three partitions for the new virtual hard disk, set up the ext3fs file system on the first and third partition, and reserve the second partition as the swap swap partition.
First of all, install the hard disk on the host computer, which refers to the installation of the hardware. In this paper, a 10G virtual SCSI hard disk is added through a virtual machine. How to add a hard disk under a virtual machine can be found at the following URL: https://jingyan.baidu.com/article/0eb457e50394d803f0a90554.html
After adding a new hard drive, we can use the following command to see if the system has correctly identified the new hard drive.
Through the results, we can see that there are two hard drives sda and sdb on the current system, sda is divided into three sda1, sda2 and sda5, and the second hard disk is a whole block and has not been partitioned yet. The system has correctly identified this new SCSI hard drive.
Next, use fdisk to partition the new hard drive.
Start the fdisk program with the target device (/ dev/sdb) as a parameter. Fdisk is an interactive application, and after performing an operation, fdisk displays a prompt with a colon: wait for the user to enter a command. As you can see in the picture, typing m will give you help.
Then we will create a new partition using the n command (new).
Select p to create the primary partition and e to create the logical partition. We will build all three partitions on the primary partition. After selecting p, you will choose the partition number. There are 4 primary partitions on a hard disk. The first partition is established on the first primary partition sdb1 of the hard disk sdb. Then select the cylinder at the beginning of the partition, starting here at 2048. The partition size is 2G. In this way, the first partition is created, of course, we have not yet written the partition to the hard disk, this step will be written after all the partitions have been created, we now use the p (print) command to view the first partition we created.
Then partitions 2 and 3 are partitioned according to the above method. The second partition swap divides into 1G size and the third partition 2G. As shown in the following picture.
Since the second partition is a swap partition, we need to change the type of partition to swap. The new partition is ext4 by default. You can use the t command to change its type, select 2 for the partition number, and then the modified type can be viewed through the L command, where swap is 82.
In this way, the setup of the three partitions is complete, and use the command to view the partition information. Then write the partitioned partition to the hard disk through the w command, and the settings made are not written to the hard disk before using the w command.
Then use the mkfs command to write to the ext3fs file system. Then check with fsck. Then create a new / web directory to mount. As shown in the picture. The third partition is similar to the first partition, without further explanation, and is mounted in the / store directory.
Zone 3:
Then the second partition swap partition is initialized and activated. The swap partition needs to be initialized using the mkswap command, which takes the device name of the partition as an argument, and finally uses the swapon command to check and activate the swap partition. Use the swapon command with-s to view the swap partitions that already exist on the current system. As shown in the picture.
Above, the partition and initialization of the newly added hard disk have been completed. The next step is to modify the / etc/fstab configuration file so that the hard drive is mounted automatically each time you boot. For this section, please refer to my previous blog "detailed description of / etc/fstab configuration file". At this point, the partition and installation of the new hard drive have been completed.
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.