Resize Disk Issue

ejc317

Member
Oct 18, 2012
263
0
16
Added 50GB to the iSCSI VirtIO disk.

LVS show 150GB instead of 100GB but linux shows 100GB. I did resize2fs and says its already maxed out ... ideas?
 
Hi,
without hotplug enabled (config) and hotplug inside the VM, you need an stop/start of the VM to reconice the new size.

Udo

VM has been start and stopped multiple times ...

fdisk -l shows 150gb but the partition ends at 100gb
 
Hi,
that's fine and the expected behavior. I don't want to use an hypervisor which rewrite my partitiontable... ;)

This must be done from you (or a live-distro like parted magic).

Udo

Yes but issue is when I use resize2fs it wont resize ...
 
Hi!

I am not sure i understood your situation correctly, and although i am not feeling comfortable doing it i have resized some times (and i believe successfully) my filesystem which sat on fdisk partition like this (and i believe generally this procedure is quite solid)

1. make sure you have valid backup
2. assuming it is first and only partition (or last partition)
3. make note with parted or fdisk which sector partition begins and ends; and verify there is extra sectors to use
4. delete partition with fdisk
5. create new partition starting from the same sector (i believe by default it does) and bigger in size
6. reboot virtual machine to let kernel know of the new partition table (this could be substituted probably by some block device probing utility)
7. resize filesystem with resize2fs

This all could be done from within the same machine you are using this partition. Or stop the machine and connect the block device to other virtual machine and manage the resize from there where it is second drive. I recommend to try it out on some test machine first.

Actually i ordinarily use filesysems on kvm machines without partition tables because this way it is easier two change filesysem sizes (assuming i use lvm backed storage) (v. 3.0 has resize thru gui but i havent tired it out myself)

1. stop virtual machine
2. resize lvm volume from host command line
3. resize ext3 filesystem on lvm volume from host command line
4. start virtual machine

True, this way i need to use in vm conf additional line like this

args: -kernel /boot/pve/vmlinuz-2.6.32-5-amd64 -initrd /boot/pve/initrd.img-2.6.32-5-amd64 -append 'root=/dev/vda ro'

If someone would comment on this usage i am interested to hear, especially on how to install debian on such partition-table-less layout in the first place (i usually copy some template filesystem to start with). I like this setup also because when i do full filesystem backup with rsync (i.e. rsnapshot) then it is easier to restore, no need to tinker with bootloader.


Best regards, Imre
 
Last edited:
Or if resizing is a returning issue choose LVM inside VM's and use pvresize to extend. Even better. Instead of resizing an existing disk simply add a new disk to the VM and then simply extend your pv by adding this disk to an existing pv. With this you are able to extend a partition online.
 
Not all clients are using LVM so need a stable solution.

I did it using resize2fs - I was doing it on partition 1 which is obviously at the full length. Needed to do it for the full disk. I eraesd and recreated the partition and did resize2fs and an fsck

not so elegant but it worked
 

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!