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

XHTML Web Page Tutorial

This article is mainly to let beginners understan...

Solution for Baidu site search not supporting https (tested)

Recently, https has been enabled on the mobile ph...

Zabbix monitoring docker application configuration

The application of containers is becoming more an...

GZIP compression Tomcat and improve web performance process diagram

1. Introduction I recently worked on a project an...

Docker builds python Flask+ nginx+uwsgi container

Install Nginx First pull the centos image docker ...

Docker's four network types principle examples

Four network types: None: Do not configure any ne...

Docker container accesses the host's MySQL operation

background: There is a flask project that provide...

How to use lazy loading in react to reduce the first screen loading time

Table of contents use Install How to use it in ro...

Nginx local directory mapping implementation code example

Sometimes you need to access some static resource...

js implements a simple English-Chinese dictionary

This article shares the specific code of js to im...

Understanding flex-grow, flex-shrink, flex-basis and nine-grid layout

1. flex-grow, flex-shrink, flex-basis properties ...

What is Software 404 and 404 Error and what is the difference between them

First of all, what is 404 and soft 404? 404: Simpl...

HTML adaptive table method

<body style="scroll:no"> <tabl...

Example code for implementing WeChat account splitting with Nodejs

The company's business scenario requires the ...