Answer the question
In order to leave comments, you need to log in
How to increase the size of / in Ubuntu 16 server?
Already tormented just pipets! help me please.
There is a virtual machine on Hyper-V where the Ubuntu 16.04.2 server
ran out of space, I increased the hard disk in Hyper-V from 12 to 18 gigs.
Then I booted into live cd ubuntu 16 desctop and there gparted increased the size of the hard drive. but nothing worked, in the end this is the picture
[email protected]:~# df -h
Filesystem Size Used Avail Use% Mounted on
udev 468M 0 468M 0% /dev
tmpfs 98M 5.5M 93M 6% /run
/dev/mapper/ubuntu--vg-root 12G 4.8G 5.9G 45% /
tmpfs 488M 0 488M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 488M 0 488M 0% /sys/fs/cgroup
/dev/sda1 472M 154M 294M 35% /boot
tmpfs 98M 0 98M 0% /run/user/0
[email protected]:~# fdisk /dev/sda
Welcome to fdisk (util-linux 2.27.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): p
Disk /dev/sda: 18 GiB, 19327352832 bytes, 37748736 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0xf8490f13
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 999423 997376 487M 83 Linux
/dev/sda2 1001470 37748735 36747266 17.5G 5 Extended
/dev/sda5 1001472 37748735 36747264 17.5G 8e Linux LVM
Partition 2 does not start on physical sector boundary.
Command (m for help):
[email protected]:~# resize2fs /dev/mapper/ubuntu--vg-root
resize2fs 1.42.13 (17-May-2015)
The filesystem is already 3008512 (4k) blocks long. Nothing to do!
Answer the question
In order to leave comments, you need to log in
Judging by the characteristic name of the block device, your system is on LVM.
Accordingly, in addition to increasing the block device and expanding the FS, it is necessary to tell LVM that the block device has become larger and say to increase the logical volume.
pvresize /dev/sda5
lvextend -l +100%FREE /dev/mapper/ubuntu--vg-root
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question