In Ubuntu 16.04, increasing disk space

After you increase the disk in the control panel, you need to expand at the operating system level.

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

Run the parted utility:
root@Ubuntu16x64:~# partedNext, execute the commands in the interface of the parted utility: Remember the disk size ZZ.ZGB. The value “End” – enter the new disk size in gigabytes – the value from the output of (parted) p, which we remembered earlier. Exit parted: The following information will be displayed:
(parted) p
Model: Virtual disk (scsi)
Disk //sda: ZZ.ZGB

(parted) resizepart 2
(parted) quit

Information: You may need to update /etc/fstab.

Run fdisk:
root@Ubuntu16x64:~# fdisk /dev/sdaNext, run the commands in the fdisk utility interface.
Create a partition:
Command ( for help): nSelect the partition type – logical. (L)
Select (default p): l

Adding logical partition X

Take note of the partition number created during the execution of the command (marked as X in the example).
We accept the default values ​​- press Enter twice: Change the partition type, while specifying the partition number that we remembered earlier (in the example it is designated as X).
First sector (XXX-YYY, default ZZZ):
Last sector, +sectors or +size{K,M,G} (XXX-YYY, default ZZZ):

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

We inform the kernel about the changes:root@Ubuntu16x64:~# partx -v -a /dev/sdaIn the displayed response, we see the line.

/dev/sda: partition #X added

We initialize the section, instead of X we again use the section number that we remembered earlier.root@Ubuntu16x64:~# pvcreate /dev/sdaX

Physical volume "/dev/sdaX" successfully created

Add a physical partition to an existing volume group:root@Ubuntu16x64:~# vgextend -vg /dev/sdaX

Volume group "ubuntu-vg" successfully extended

Expanding the logical volume.root@Ubuntu16x64:~# lvextend -l +100%FREE //dev/ubuntu-vg/root

Extending logical volume root to YY.ZZ GiB
Logical volume root successfully resized

Expanding the file system.root@Ubuntu16x64:~# resize2fs /dev/ubuntu-vg/root



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!