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

Detailed steps to download Tomcat and put it on Linux

If you have just come into contact with Linux, th...

Detailed explanation of basic management of KVM virtualization in CentOS7

1. Install kvm virtualization : : : : : : : : : :...

Detailed steps to install mysql in Win

This article shares the detailed steps of install...

Vue realizes the progress bar change effect

This article uses Vue to simply implement the cha...

Comprehensive website assessment solution

<br />Sometimes you may be asked questions l...

How to implement Echats chart large screen adaptation

Table of contents describe accomplish The project...

About the role of meta in HTML (collected and sorted from the Internet)

W3Cschool explains it this way The <meta> el...

Solve the problem of ifconfig being unavailable in docker

Recently, when I was learning docker, I found tha...

How does Vue download non-same-origin files based on URL

Generally speaking, we can have the following two...

TypeScript union types, intersection types and type guards

Table of contents 1. Union Type 2. Crossover Type...

Sample code for CSS dynamic loading bar effect

Using the knowledge of CSS variables, I will dire...

Three methods to modify the hostname of Centos7

Method 1: hostnamectl modification Step 1 Check t...