Increasing disk space in CentOS 7

After increasing the disk in the control panel, you need to make available to the operating system:

Open a terminal (see connection instructions ) as root and enter the following commands:
[root@CentOSx64 ~]# echo 1 > /sys/block/sda/device/rescan

Run fdisk:

[root@CentOSx64 ~]# fdisk //sda

Next, run the commands in the fdisk utility interface.

Delete the /dev/sda2 partition:

Command ( for help): dPartition number (1,2, default 2): 2

Create a section:

Command (m for help): n

Select partition type – primary (p)

Select (default p): pPartition number (2-4, default 2): 2

We accept the default values ​​\u200b\u200b- press Enter twice:

First sector (XXX-YYY, default ZZZ):
Last sector, +sectors or +size{K,M,G} (XXX-YYY, default ZZZ):

Change partition type

Command (m for help): t
Partition number (1-2): 2
Hex (type L to list all codes): 8e
...
Command (m for help): w

We inform the kernel about the changes: Change the[root@CentOSx64 ~]# partx -u /dev/sda2physical volume:[root@CentOSx64 ~]# pvresize /dev/sda2Find out the name of the logical volumelvdisplay

 --- Logical volume ---
  LV Path                /dev/vgroup01/swap
  ....
  --- Logical volume ---
  LV Path /dev/vgroup01/var
  ...
  --- Logical volume ---
  LV Path                /dev/vgroup01/root
  ...

Expand the logical volume (XXXXXXX – replace with the name of the volume that we remember)[root@CentOSx64 ~]# lvextend -l +100%FREE /dev/XXXXXXX/root

 Size of logical volume XXXXXXX/root changed from 8.71 GiB (2229 extents) to 98.71 GiB (25269 extents).

 Logical volume root successfully resized

We expand the XXXXXXX file system – we replace it with the name of the volume that we remember)[root@CentOSx64 ~]# xfs_growfs /dev/XXXXXXX/root

Done.

 

Welcome to the world of DomainRooster, where roosters (and hens) rule the roost! We're a one-stop shop for all your entrepreneurial needs, bringing together domain names and website hosting, and all the tools you need to bring your ideas to life. With our help, you'll soar to new heights and hatch great success. Think of us as your trusty sidekick, always there to lend a wing and help you navigate the sometimes-complex world of domain names and web hosting. Our team of roosters are experts in their fields and are always on hand to answer any questions and provide guidance. So why wait? Sign up today and join the ranks of the world's greatest entrepreneurs. With DomainRooster, the sky's the limit! And remember, as the saying goes, "Successful people do what unsuccessful people are not willing to do." So don't be afraid to take that leap of faith - DomainRooster is here to help you reach for the stars. Caw on!