Teach you how to mount a new hard drive on CentOS Pagoda in three minutes

WBOY
Release: 2022-03-28 14:18:19
forward
5495 people have browsed it

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.

Teach you how to mount a new hard drive on CentOS Pagoda in three minutes

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!

Copy the www folder and change the name to www_bak

1. First check whether our new hard drive has been loaded successfully

fdisk -l
Copy after login

Teach you how to mount a new hard drive on CentOS Pagoda in three minutes

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
Copy after login

3. Add partition mounting information to the startup mount

echo "/dev/vdb /www ext4 defaults 0 0" >> /etc/fstab
Copy after login

Please back up the www folder first

4. Remount All partitions

mount -a
Copy after login

5. Check whether the mounting is successful

df
Copy after login

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!

Related labels:
source:learnku.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template