Home >Operation and Maintenance >CentOS >Teach you how to mount a new hard drive on CentOS Pagoda in three minutes
This article brings you relevant knowledge about centos, which mainly introduces the issues related to CentOS pagoda mounting a new hard drive. Let’s take a look at how to operate it. I hope it will help Everyone is helpful.
Recommended tutorial: "centos Learning Tutorial"
If the server has data, please back it up first Data in action!
#If the server has data, please back up the data before operating!
#If the server has data, please back up the data before operating!
Idea:
First copy all the data of the pagoda under www and rename it www_bak
Mount the new hard disk in the www directory (At the same time, the data in www will be cleared). After restoring the backed up www_bak data to www, the mounting ends!
1. First check whether our new hard drive has been loaded successfully
fdisk -l
The newly added hard disk of my server is called vdb. Please modify the corresponding name according to your actual situation
2. Format partition
mkfs.ext4 /dev/vdb
3. Add partition mounting information to the startup mount
echo "/dev/vdb /www ext4 defaults 0 0" >> /etc/fstab
Please back up the www folder first
4. Remount All partitions
mount -a
5. Check whether the mounting is successful
df
6. Copy the previously backed up www_bak to www, the mounting is successful !
Recommended tutorial: "centos tutorial"
The above is the detailed content of Teach you how to mount a new hard drive on CentOS Pagoda in three minutes. For more information, please follow other related articles on the PHP Chinese website!