Cannot resize VM

hinhthoi

New Member
Aug 6, 2016
26
0
1
36
Hi,

I'm trying to resize a test VM, which was originally created with 32 GB disk space. I have tried to resize to 60GB, but from within the VM I still saw 32 GB space. I'd like to ask how to update the new space in the VM ? Thanks for any help!

From host
root@pve:~# qm config 605
agent: 1
bootdisk: virtio0
cores: 1
ide2: local:iso/CentOS-6.9-x86_64-minimal.iso,media=cdrom
memory: 1024
name: clone-C6-amd64
net0: e1000=82:A8:DA:34:60:91,bridge=vmbr0
numa: 0
ostype: other
scsihw: virtio-scsi-pci
smbios1: uuid=da9b3579-ef9c-4154-aa7e-84e1cea1821f
sockets: 1
virtio0: local-lvm:vm-605-disk-1,size=60G

From VM
root@testVM:~# df -h
Filesystem Size Used Avail Use% Mounted on
udev 234M 4.0K 234M 1% /dev
tmpfs 49M 428K 49M 1% /run
/dev/sda1 31G 2.3G 28G 8% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
none 5.0M 0 5.0M 0% /run/lock
none 245M 0 245M 0% /run/shm
none 100M 0 100M 0% /run/user
 
Hi,

you have to resize the fs in the VM.
And if you use LVM in the VM this have to be resizes before you can resize the fs.
 
Hi,

you have to resize the fs in the VM.
And if you use LVM in the VM this have to be resizes before you can resize the fs.

Also going to need to resize the partition. I would say a recovery CD is your only option as it looks like your OS is on the disk which you are trying to increase. Make sure you have good backups!
 
it looks like your OS is on the disk which you are trying to increase

What do you mean by this? The OS used to install the KVM was on the /var/lib/vz/template/iso folder of the host, while the disk I'm trying to increase is the virtual disk of the KVM, how is there the relationship here?

I have tried following the guide in this page https://pve.proxmox.com/wiki/Resize_disks

Within the KVM, I issued the following commands
Code:
[root@pve ~]# parted /dev/vda
GNU Parted 2.1
Using /dev/vda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print free
Model: Virtio Block Device (virtblk)
Disk /dev/vda: 64.4GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system  Flags
        32.3kB  1049kB  1016kB           Free Space
 1      1049kB  525MB   524MB   primary  ext4         boot
 2      525MB   34.4GB  33.8GB  primary               lvm
        34.4GB  64.4GB  30.1GB           Free Space

(parted) resize 2
WARNING: you are attempting to use parted to operate on (resize) a file system.
parted's file system manipulation code is not as robust as what you'll find in
dedicated, file-system-specific packages like e2fsprogs.  We recommend
you use parted only to manipulate partition tables, whenever possible.
Support for performing most operations on most types of file systems
will be removed in an upcoming release.
Start?  [525MB]? 525MB
End?  [34.4GB]? 64GB
Error: Could not detect file system.
(parted)

As you want to extend the partition number 2, however, the parted command complains that it could not detect file system. As shown in the output, the filesystem of partition 1 is ext4, but there is no filesystem for partition 2.


Could you tell me how to proceed? Is this normal output?
 
What do you mean by this? The OS used to install the KVM was on the /var/lib/vz/template/iso folder of the host, while the disk I'm trying to increase is the virtual disk of the KVM, how is there the relationship here?

I have tried following the guide in this page https://pve.proxmox.com/wiki/Resize_disks

Within the KVM, I issued the following commands
Code:
[root@pve ~]# parted /dev/vda
GNU Parted 2.1
Using /dev/vda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print free
Model: Virtio Block Device (virtblk)
Disk /dev/vda: 64.4GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system  Flags
        32.3kB  1049kB  1016kB           Free Space
 1      1049kB  525MB   524MB   primary  ext4         boot
 2      525MB   34.4GB  33.8GB  primary               lvm
        34.4GB  64.4GB  30.1GB           Free Space

(parted) resize 2
WARNING: you are attempting to use parted to operate on (resize) a file system.
parted's file system manipulation code is not as robust as what you'll find in
dedicated, file-system-specific packages like e2fsprogs.  We recommend
you use parted only to manipulate partition tables, whenever possible.
Support for performing most operations on most types of file systems
will be removed in an upcoming release.
Start?  [525MB]? 525MB
End?  [34.4GB]? 64GB
Error: Could not detect file system.
(parted)

As you want to extend the partition number 2, however, the parted command complains that it could not detect file system. As shown in the output, the filesystem of partition 1 is ext4, but there is no filesystem for partition 2.


Could you tell me how to proceed? Is this normal output?

Just to be fair, this is not related to proxmox at all and is probably not the best place to get answers for such an issue.

Im talking about the OS of VM, not the OS of the host.

The only way I know of to resize a partition is to actually delete and re-create it. This is why you will need to boot the VM off of a rescue disk or something like gparted.
 
  • Like
Reactions: hinhthoi
Hi,

I have got it done. I used SystemRescueCD, booted the VM from the SystemRescueCD and used the gparted tools in there, without getting similar errors as using gparted from within the VM OS
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!