In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces "how to mount a new data disk in CentOS7". In daily operation, I believe many people have doubts about how to mount a new data disk in CentOS7. The editor consulted all kinds of materials and sorted out a simple and easy-to-use method of operation. I hope it will be helpful to answer the doubts about "how to mount a new data disk in CentOS7". Next, please follow the editor to study!
View hard disk information
First of all, let's use the command df-th to view the current system mount:
We see that there is no new data disk mounted, the data disk is more than 200 g.
Then use the command fdisk-l to view the hard disk information.
You can see that there are two hard drives / dev/xvda and / dev/xvde. Boot xvda is the system disk, and xvde is our new data disk. In other words, the system found a new data disk / dev/xvde, but did not mount it. Note that sometimes the new data disk is not called xvde, it may be called xvdb.
Execute mount command
1. Execute the command fdisk / dev/xvde, enter fdisk mode, and start partitioning the newly added data disk.
In the echo information, enter n and enter, and then enter all the subsequent operations by default. The return message at the end of the figure above tells us that there is a 200g hard disk partition and that it has been established.
2. Next, type p, enter, and view the details of the new partition.
As shown in the figure above, then enter w to save and write the partition result to the partition table.
If the echo message is as follows, the partition is successful:
The partition table has been altered!
Calling ioctl () to re-read partition table.
Syncing disks.
3. Execute the command partprobe to synchronize the new partition table changes to the operating system.
4. Execute the following command to set the new partition file system to the format required by the system.
Mkfs-t ext4 / dev/xvde1
5. Mount the newly created partition to the / mnt/datadisk mount point. / mnt/datadisk is a new mount point of our system, that is, the directory. If the directory does not exist, you can define the mount directory.
Mount / dev/xvde1 / mnt/datadisk
6. Use the command df-th to check the disk mount.
The figure above shows that the new disk / dev/xvde1 has been successfully mounted to / mnt/datadisk.
Power on and mount automatically
The mounted disk needs to be automatically mounted on boot. Instead of using / etc/fstab to specify / dev/xvde1 directly, it is recommended to use uuid to configure auto-mount data disk.
First execute the command blkid / dev/xvde1 to query the uuid of the disk partition:
Dev/xvde1: uuid= "1d4e1d9d-d15c-1273-8442-2303b05b96ad" type= "ext4"
Then edit / etc/fstab, adding a line at the end:
Uuid=1d4e1d9d-d15c-1273-8442-2303b05b96ad / mnt/datadisk ext4 defaults 1 1
Just replace the uuid and directory with your own.
Finally, restart the machine and use df-th to check the mount status. If you can see the new disk mount information, you are done.
At this point, the study on "how to mount a new data disk in CentOS7" 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.