Introduction to root directory expansion under Linux system

Introduction to root directory expansion under Linux system

1. Check Linux disk status

df -lh 

insert image description here

The lsblk command is used to list information about all available block devices and display the dependencies between them.

insert image description here

insert image description here

Create a new disk partition

fdisk /dev/vda 

insert image description here

Change the new partition disk type

insert image description here

Save the partition operation and restart the operating system

insert image description here

insert image description here

insert image description here

Formatting a partition

insert image description here

mkfs.xfs /dev/vda3 

insert image description here

Create a new physical volume

pvcreate /dev/vda3

#The pvcreate command is used to initialize the physical hard disk partition as a physical volume for LVM use.

insert image description here

View lvm volume group information

vgdisplay

#The vgdisplay command is used to display the information of the LVM volume group. If the "volume group" parameter is not specified, the properties of all volume groups are displayed separately

insert image description here

Adding physical volumes to a volume group

vgextend /dev/mapper/vg --maycur /dev/vda3


#Use df -h to view the name of the volume group to be added. No need to add root

insert image description here

Start expansion

lvextend -L +49G /dev/mapper/vg --maycur-root /dev/vda3

#lvextend command is used to expand the space size of the logical volume online without interrupting the application's access to the logical volume

insert image description here

Synchronize file system

xfs_growfs /dev/mapper/vg --maycur-root 

insert image description here

This is the end of this article about expanding the root directory under the Linux system. For more relevant content about expanding the root directory of Linux, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Detailed steps to expand LVM disk in Linux
  • How to expand the root directory disk space in Linux system
  • How to expand the disk capacity of a Linux server (picture)

<<:  Solution to forgetting mysql database password

>>:  HTML implements read-only text box and cannot modify the content

Recommend

Scoring rules of YSlow, a webpage scoring plugin developed by Yahoo

YSlow is a page scoring plug-in developed by Yaho...

Docker image import, export, backup and migration operations

Export: docker save -o centos.tar centos:latest #...

Nginx/Httpd load balancing tomcat configuration tutorial

In the previous blog, we talked about using Nginx...

How to use MySQL covering index and table return

Two major categories of indexes Storage engine us...

MySQL multi-instance deployment and installation guide under Linux

What is MySQL multi-instance Simply put, MySQL mu...

A detailed introduction to the Linux directory structure

When you first start learning Linux, you first ne...

Several important MySQL variables

There are many MySQL variables, some of which are...

How to display and format json data on html page

JSON data is displayed and formatted on the HTML ...

How to submit the value of a disabled form field in a form Example code

If a form field in a form is set to disabled, the ...

Complete steps to install Anaconda3 in Ubuntu environment

Table of contents Introduction to Anaconda 1. Dow...

Solve the problem of using swiper plug-in in vue

Since I used this plugin when writing a demo and ...

HTML drag and drop function implementation code

Based on Vue The core idea of ​​this function is ...

How to install and configure WSL on Windows

What is WSL Quoting a passage from Baidu Encyclop...

ftp remotely connect to Linux via SSH

First install ssh in Linux, taking centos as an e...