How to mount a data disk on Tencent Cloud Server Centos

How to mount a data disk on Tencent Cloud Server Centos

First, check whether the hard disk device has a data disk

# Execute fdisk -l first

# The following are the results: Disk /dev/vda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000736d7

  Device Boot Start End Blocks Id System
/dev/vda1 * 1 2611 20970496 83 Linux


# Check the Tencent Cloud Server Data Hard Drive # We can see that there is a 20GB data disk that is not mounted. Look at the previous path /dev/vda1

Second, data hard disk partition (optional)

# Execute fdisk /dev/vda1

# Enter n, p, 1, Enter, Enter, wq
# The VDA here is the name of the data hard disk we saw above. If it is not this, you need to replace it according to your actual disk name. If it is the same as mine, just copy it directly.

Third, ext3 format partition

# Format as ext3 file system mkfs.ext3 /dev/vda1

Fourth, mount the new partition

# A - Create a new directory mkdir /home

# B - Mount the partition mount /dev/vda1 /home

Fifth, write fstab to set automatic mounting at boot

echo '/dev/vda1 /home ext3 defaults 0 0' >> /etc/fstab

Sixth, check whether the mount is successful (df -h)

# Execute df -h

# The following is the execution result Filesystem Size Used Avail Use% Mounted on
/dev/vda1 20G 1.2G 18G 7% /
/dev/vda1 20G 1.2G 18G 7% /home

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • How to mount disk in centos7 cloud host system
  • Centos7 hard disk mounting method
  • Centos7 installation and configuration of NFS service and mounting tutorial (recommended)
  • Learn how to mount Centos7 soft raid5
  • Detailed explanation of the mount command in Centos to mount the windows7 shared directory
  • Detailed explanation of CentOS Alibaba Cloud server hard disk partition and mounting
  • How to mount a new data disk on Alibaba Cloud CentOS
  • Tutorial on mounting SSD cloud disk on Alibaba Cloud CentOS 7 system
  • Complete steps for mounting a new data disk in CentOS7

<<:  Detailed explanation of the role of the new operator in Js

>>:  The difference between Decimal type and Float Double in MySQL (detailed explanation)

Recommend

Install Docker environment in Linux environment (no pitfalls)

Table of contents Installation Prerequisites Step...

How to install MySQL 5.7.29 with one click using shell script

This article refers to the work of 51CTO blog aut...

MySQL 5.7.21 installation and configuration method graphic tutorial (window)

Install mysql5.7.21 in the window environment. Th...

Detailed explanation of the process of modifying Nginx files in centos7 docker

1. Install nginx in docker: It is very simple to ...

Some experience in building the React Native project framework

React Native is a cross-platform mobile applicati...

More than 100 lines of code to implement react drag hooks

Preface The source code is only more than 100 lin...

js to achieve cool fireworks effect

This article shares the specific code for using j...

A brief discussion on MySQL large table optimization solution

background The amount of new data in the business...

JS implements simple addition and subtraction of shopping cart effects

This article example shares the specific code of ...

A brief discussion on when MySQL uses internal temporary tables

union execution For ease of analysis, use the fol...

5 Reasons Why Responsive Web Design Isn’t Worth It

This article is from Tom Ewer's Managewp blog,...

Let's talk about the performance of MySQL's COUNT(*)

Preface Basically, programmers in the workplace u...

Solution to prevent caching in pages

Solution: Add the following code in <head>: ...