Home>Article>Operation and Maintenance> What should I do to expand the capacity of Tencent Cloud hard disk?
1.PHP programmers have fun with the Linux series-how to install and use CentOS
2.PHP programmers have fun with the Linux series-setting up the lnmp environment
3.PHP programmers have fun with it Linux series-Building an FTP code development environment
4.PHP programmers have fun with Linux series-backup and restore MySQL
5.PHP programmers have fun with Linux series-automatic backup and SVN
6.PHP programmers have fun with the Linux series-installing nginx on Linux and Windows
7.PHP programmers have fun with the Linux series-nginx beginners guide
8.PHP programmers have fun with Convert to Linux series-HTTPS in Nginx
9.PHP programmers have fun with Linux series-use supervisor to implement daemon process
10.PHP programmers have fun with Linux series-upgrade PHP to PHP7
11. PHP programmers have fun with Linux series-telnet to easily use mailboxes
The website search disk is running on Tencent Cloud's server. It suddenly couldn't be opened a few days ago, so I logged in to the server. Take a look at what's going on and find that the hard disk is full. Now let's record how to solve it
Check the hard disk space size
Use Use the df command to check the usage of the hard disk. The parameter is df -h. -h is --human-readable to display the space usage in a human-readable form.
Not hung up Before loading the hard disk, the /dev/vda1 hard disk has been 100% used.
Find large files
The first thing that comes to mind is to find Let’s take a look at the large files. Here I used the find command. The parameters are as follows
find / -type f -size +20M | xargs du -h|sort -n
-type f The specified type is a file, -size +20M is to find files larger than 20M, the xargs command can convert the matched files into command line parameters, the du command is to count the size of the file, and the sort command is to sort
/usr/local/xunsearch/data/This directory is my xunsearch search data directory. It seems that there is too much data. Now I want to expand it.
Buy cloud hard drive
I bought a cloud hard drive, the smallest one is 10G, it costs 3 yuan a month, the steps are very simple, just follow the next step, show After it is mounted, you can go to the server to use it.
List all hard disks of the server
Use the fdisk command, the parameter is -l , you can see all the hard disks on the server
I now have two hard disks /dev/vda and /dev/vdb, the hardware naming rules a-p are The sequence number of the hard disk
To partition the hard disk
Still use the command fdisk, fdisk /dev/vdb to partition this new hard disk, you will enter a Interactive interface, the parameters to be entered here are:
n Create a new partition
p The partition is the primary partition
Partition number Partition serial number, just press Enter
Just press Enter for the starting magnetic column
Directly press Enter for the ending magnetic column
wq Save
The partition of the hard disk is now ok, mine has been divided Passed, so I didn’t take a complete picture. /dev/vdb1 is this partition
##Format partition
Use this command mkfs.ext4 /dev/vdb1Mount partition
Use the mount command, mount /dev/vdb1 /usr/local/xunsearch/data/ mont device file mounting directory At this time, the partition mounting has also been completed.Automatic mounting
The current mounting will be gone after restarting the system, so it must be automatically mounted Edit the file /etc/fstab , Content: Device file mounting directory file system permission option self-check priority /dev/vdb1 /usr/local/xunsearch/data ext3 defaults 0 0 Save file The hard disk situation at this time is like this, the website address: www.sopans.com ##The above is the detailed content of What should I do to expand the capacity of Tencent Cloud hard disk?. For more information, please follow other related articles on the PHP Chinese website!