Preface I just bought a new VPS. The data disk of the new VPS is not mounted to the system by default, so we need to mount it ourselves. When we add a new hard disk to the server, we need to perform a mounting operation. This article briefly records the mounting operation process. View Hard Drive Information First, we use the command df -TH to view the current system mount status: We can see that there is no new data disk mounted, and the data disk is over 200G. Then use the command fdisk -l to view the hard disk information. You can see that there are two hard disks /dev/xvda and /dev/xvde. xvda is the system disk, and xvde is our newly added data disk. That is to say, the system found the newly added data disk /dev/xvde, but did not mount it. Note that sometimes the newly added data disk is not called xvde, it may be called xvdb. Execute the mount command 1. Execute the command fdisk /dev/xvde to enter the fdisk mode and start partitioning the newly added data disk. In the displayed information, enter n and press Enter. Press Enter for all subsequent operations to accept the default settings. The information displayed by pressing Enter at the end of the above picture tells us that a 200G hard disk partition has been created. 2. Next, enter p and press Enter to view the detailed information of the newly created partition. As shown above, enter w to save and write the partition results into the partition table. If the following information is displayed, the partition is successful:
3. Execute the partprobe command to synchronize the new partition table changes to the operating system. 4. Execute the following command to set the file system of the newly created partition 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 newly created mount point in our system, that is, a directory. If the directory does not exist, you must create it in advance. You can define the mount directory yourself. mount /dev/xvde1 /mnt/datadisk 6. Use the command df -Th to check the disk mounting status. The above figure shows that the new disk /dev/xvde1 has been successfully mounted to /mnt/datadisk. Automatically mount at boot The mounted disk needs to be set to automatically mount at boot time. We do not use the method of directly specifying /dev/xvde1 in /etc/fstab, but recommend using UUID to configure automatic mounting of data disks. First execute the command /dev/xvde1: UUID="1d4e1d9d-d15c-1273-8442-2303b05b96ad" TYPE="ext4" Then edit /etc/fstab and add 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 Summarize The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. Thank you for your support of 123WORDPRESS.COM. You may also be interested in:
|
<<: Implementing a web calculator based on JavaScript
>>: Common operation commands of MySQL in Linux system
1. Problem Description root@mysqldb 22:12: [xucl]...
Recently, the company purchased a DELL R730 serve...
Table of contents 1. Template 2. Generics 3. Gene...
Basic environment configuration Please purchase t...
I have been making websites for a long time, but I...
Use JS timer to make an element to make a method ...
JavaScript can do a lot of great things. This art...
Preface I believe that everyone has had experienc...
Div basic layout <div class="main"&g...
Effect The effect is as follows Implementation ...
This article introduces the installation of Windo...
As usual, today I will talk about a very practica...
1. Favicon.cc To create ico icon websites online,...
These two attributes are often used, but their di...
WeChat applet calculator example, for your refere...