0

KVM Host Environment:-

# cat /etc/issue
Welcome to openSUSE 13.2 "Harlequin" - Kernel \r (\l).

# /usr/bin/qemu-system-x86_64 --version
QEMU emulator version 2.1.3

With the below commands i have resized the VM host

virsh destroy vm1
qemu-img resize vm1.img +30G
virsh start vm1 && virsh console vm1

my vm host running status,

# virsh list --all
 Id    Name                           State
----------------------------------------------------
 5     vm1                     running

Login to vm console,

# virsh console vm1
Connected to domain vm1
Escape character is ^]

Login incorrect

Give root password for maintenance
(or press Control-D to continue):

VM host disk space

# df -kh
Filesystem      Size  Used Avail Use% Mounted on
/dev/root       7.8G  7.8G     0 100% /
devtmpfs         16G     0   16G   0% /dev
tmpfs            16G     0   16G   0% /dev/shm
tmpfs            16G  8.7M   16G   1% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs            16G     0   16G   0% /sys/fs/cgroup
# fdisk /dev/vda

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/vda: 88 GiB, 94489280512 bytes, 184549376 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0008f07d

Device     Boot Start      End  Sectors Size Id Type
/dev/vda1  *     2048 16773532 16771485   8G 83 Linux

Here still my space is not increased, let me know further what i am missing ?

Ekam
  • 11
  • 4

2 Answers2

0

As usual when working with storage make sure you have backups.

Use fdisk to increase the size of the partition too: it’s not enough to resize the virtual disk. Basically remove the old partition (after noting its starting block) then recreate a new one filling as much of the disk as you want, and write the changes.

Once the partition has been resized, you need to extend the file system using the appropriate tool for the file system of your volume.

Mikael H
  • 5,031
  • 2
  • 9
  • 18
0

In guest VM1, you need call resize2fs:

resize2fs /dev/vda
zersh
  • 161
  • 2
  • inside vm, getting below error `# resize2fs /dev/vda` `resize2fs 1.42.13 (17-May-2015)` `resize2fs: Device or resource busy while trying to open /dev/vda` `Couldn't find valid filesystem superblock.` – Ekam Jul 11 '22 at 11:19
  • try resize2fs /dev/root – zersh Jul 11 '22 at 11:50
  • `# resize2fs /dev/root` `resize2fs 1.42.13 (17-May-2015)` `open: No such file or directory while opening /dev/root` – Ekam Jul 11 '22 at 12:39
  • yes, I didn't look at what fdisk print you have partition /dev/vda1 :) then, try /dev/vda1 – zersh Jul 11 '22 at 13:09
  • `# resize2fs /dev/vda1` `resize2fs 1.42.13 (17-May-2015)` `The filesystem is already 2096435 (4k) blocks long. Nothing to do!` – Ekam Jul 11 '22 at 13:30