Resize disks - Proxmox VE (https://pve.proxmox.com/mediawiki/opensearch_desc.php) (Proxmox VE (en)) (https://pve.proxmox.com/mediawiki/api.php?action=rsd) (Proxmox VE Atom feed) (https://pve.proxmox.com/mediawiki/index.php?title=Special:RecentChanges&feed=atom) (https://pve.proxmox.com/wiki/Resize_disks) Resize disks From Proxmox VE Jump to navigation Jump to search Contents 1 1. Resizing guest disk 1.1 General considerations 1.2 qm command 1.3 Using GUI 2 2. Enlarge the partition(s) in the virtual disk 2.1 Offline for all guests 2.2 Online for Windows Guests 2.3 Online for Linux Guests 2.3.1 Example with EFI 2.3.2 Example without EFI 3 3. Enlarge the filesystem(s) in the partitions on the virtual disk 3.1 Online for Linux guests with LVM 3.2 Online for Linux guests without LVM 1. Resizing guest disk General considerations When you resize the disk of a VM, to avoid confusion and disasters think the process like adding or removing a disk platter. If you enlarge the hard disk, once you have added the disk plate, your partition table and file system knows nothing about the new size, so you have to act inside the VM to fix it. If you reduce (shrink) the hard disk, of course removing the last disk plate will probably destroy your file system and remove the data in it! So in this case it is paramount to act in the VM in advance , reducing the file system and the partition size. SystemRescueCD comes very handy for it, just add its iso as cdrom of your VM and set boot priority to CD-ROM. Shrinking disks is not supported by the PVE API and has to be done manually. Another page (deleted) with overlapping content was (https://pve.proxmox.com/mediawiki/index.php?title=Resizing_disks&action=edit&redlink=1) (Resizing disks (page does not exist)) Resizing disks | (http://web.archive.org/web/20150914170505/http://pve.proxmox.com/wiki/Resize_disks) Archive qm command You can resize your disks online or offline with command line: qm resize exemple: to add 5G to your virtio0 disk on vmid100: qm resize 100 virtio0 +5G For virtio disks: Linux should see the new size online without reboot with kernel >= 3.6 Windows should see the new size online without reboot with last virtio drivers. for virtio-iscsi disk: Linux should see the new size online without reboot with kernel >= 3.7 Windows should see the new size online without reboot with last virtio drivers. Using GUI You can also select your VM from the list > Hardware > Hard Disk > Disk Action > Resize You will be presented with the option of increasing the disk size: (https://pve.proxmox.com/wiki/File:Screenshot_2023-05-24_at_21-08-39_pve_-_Proxmox_Virtual_Environment.png) (https://pve.proxmox.com/wiki/File:Screenshot_2023-05-24_at_21-08-39_pve_-_Proxmox_Virtual_Environment.png) (Enlarge) Increase disk size 2. Enlarge the partition(s) in the virtual disk Depending on the installed guest there is several diffent ways to resize the partions Offline for all guests Use gparted or similar tool (recommended)In gparted and possibly most other tools, LVM and Windows dynamic disc is not supported Boot the virtual machine with gparted or similar tool, enlarge the partion and optionally the file system. With som linux clients you often need to enlarge the extended partion, move the swappartion, shrink the extended partion and enlarge the root partion. (or simple delete the swap and partion andre create it again - but remember to activwate the swap agin (last step).Gparted have some warnings about some specific operations not well supported with windows guest - outside the scope of this document but read the warnings in gparted. Online for Windows Guests Guest is Windows 7, Windows Vista or Windows Server 2008 logon as administrator and extend the disk and filesystem (Using Disk manager) For more info (http://www.petri.co.il/extend-disk-partition-vista-windows-server-2008.htm) www.petri.co.il/extend-disk-partition-vista-windows-server-2008.htm Guest is Windows 10: logon as administrator and extend the disk and filesystem (Using Disk manager). If you do not see the ability to extend the disk (i.e. nothing seems to have happened as a result of using the resize command), go to the Windows command prompt and do a: shutdown -s -t 0 (This is a "normal" shutdown, as opposed to the "fast" shutdown that's the default for Win 8 and onwards.) After a reboot, you'll now see the ability to expand the disk. Online for Linux Guests Here we will enlarge a LVM PV partition, but the procedure is the same for every kind of partitions. Note that the partition you want to enlarge should be at the end of the disk. If you want to enlarge a partition which is anywhere on the disk, use the offline method. Check that the kernel has detected the change of the hard drive size (here we use VirtIO so the hard drive is named vda) dmesg | grep vda [ 3982.979046] vda: detected capacity change from 34359738368 to 171798691840 Example with EFI Print the current partition table fdisk -l /dev/vda | grep ^/dev GPT PMBR size mismatch (67108863 != 335544319) will be corrected by w(rite). /dev/vda1 34 2047 2014 1007K BIOS boot /dev/vda2 2048 262143 260096 127M EFI System /dev/vda3 262144 67108830 66846687 31.9G Linux LVM Resize the partition 3 (LVM PV) to occupy the whole remaining space of the hard drive) parted /dev/vda (parted) print Warning: Not all of the space available to /dev/vda appears to be used, you can fix the GPT to use all of the space (an extra 268435456 blocks) or continue with the current setting? Fix/Ignore? F (parted) resizepart 3 100% (parted) quit Example without EFI Another example without EFI using parted: parted /dev/vda (parted) print Number Start End Size Type File system Flags 1 1049kB 538MB 537MB primary fat32 boot 2 539MB 21.5GB 20.9GB extended 3 539MB 21.5GB 20.9GB logical lvm Yoy will want to resize the 2nd partition first (extended): (parted) resizepart 2 100% (parted) resizepart 3 100% Check the new partition table (parted) print Number Start End Size Type File system Flags 1 1049kB 538MB 537MB primary fat32 boot 2 539MB 26.8GB 26.3GB extended 3 539MB 26.8GB 26.3GB logical lvm (parted) quit 3. Enlarge the filesystem(s) in the partitions on the virtual disk If you did not resize the filesystem in step 2 Online for Linux guests with LVM Enlarge the physical volume to occupy the whole available space in the partition: pvresize /dev/vda3 List logical volumes: lvdisplay --- Logical volume --- LV Path /dev/{volume group name}/root LV Name root VG Name {volume group name} LV UUID DXSq3l-Rufb-... LV Write Access read/write LV Creation host, time ... LV Status available # open 1 LV Size <19.50 GiB Current LE 4991 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:0 Enlarge the logical volume and the filesystem (the file system can be mounted, works with ext4 and xfs). Replace "{volume group name}" with your specific volume group name: #This command will increase the partition up by 20GB lvresize --size +20G --resizefs /dev/{volume group name}/root #Use all the remaining space on the volume group lvresize --extents +100%FREE --resizefs /dev/{volume group name}/root Online for Linux guests without LVM Enlarge the filesystem (in this case root is on vda1) resize2fs /dev/vda1 Retrieved from "" (https://pve.proxmox.com/wiki/Special:Categories) (Special:Categories) Category : (https://pve.proxmox.com/wiki/Category:HOWTO) (Category:HOWTO) HOWTO Cookies help us deliver our services. By using our services, you agree to our use of cookies. (https://www.proxmox.com/en/privacy-policy) More information (OK) OK Navigation menu (https://pve.proxmox.com/mediawiki/index.php?title=Special:UserLogin&returnto=Resize+disks) (You are encouraged to log in; however, it is not mandatory [alt-shift-o]) Log in (https://pve.proxmox.com/wiki/Resize_disks) (View the content page [alt-shift-c]) Page (https://pve.proxmox.com/mediawiki/index.php?title=Talk:Resize_disks&action=edit&redlink=1) (Discussion about the content page (page does not exist) [alt-shift-t]) Discussion (https://pve.proxmox.com/wiki/Resize_disks) Read (https://pve.proxmox.com/mediawiki/index.php?title=Resize_disks&action=edit) (This page is protected. You can view its source [alt-shift-e]) View source (https://pve.proxmox.com/mediawiki/index.php?title=Resize_disks&action=history) (Past revisions of this page [alt-shift-h]) View history (More options) Search (Search Proxmox VE) (Search Proxmox VE [alt-shift-f]) (Search the pages for this text) (Search) (Go to a page with this exact name if it exists) (Go) (https://pve.proxmox.com/wiki/Main_Page) (Visit the main page) (https://pve.proxmox.com/wiki/Main_Page) Proxmox VE (https://pve.proxmox.com/pve-docs/) Documentation (current) (https://pve.proxmox.com/pve-docs-7/) Documentation (7.x) (https://pve.proxmox.com/wiki/Downloads) Downloads (https://pve.proxmox.com/wiki/Installation) Installation (https://pve.proxmox.com/wiki/Get_support) Get support Sites (https://www.proxmox.com/) proxmox.com (https://forum.proxmox.com/) Support forum (https://bugzilla.proxmox.com/) Bugtracker (https://git.proxmox.com/) Source code (https://pve.proxmox.com/wiki/FAQ) FAQ Tools (https://pve.proxmox.com/wiki/Special:WhatLinksHere/Resize_disks) (A list of all wiki pages that link here [alt-shift-j]) What links here (https://pve.proxmox.com/wiki/Special:RecentChangesLinked/Resize_disks) (Recent changes in pages linked from this page [alt-shift-k]) Related changes (https://pve.proxmox.com/wiki/Special:SpecialPages) (A list of all special pages [alt-shift-q]) Special pages (Printable version of this page [alt-shift-p]) Printable version (https://pve.proxmox.com/mediawiki/index.php?title=Resize_disks&oldid=11650) (Permanent link to this revision of this page) Permanent link (https://pve.proxmox.com/mediawiki/index.php?title=Resize_disks&action=info) (More information about this page) Page information (https://pve.proxmox.com/mediawiki/index.php?title=Special:CiteThisPage&page=Resize_disks&id=11650&wpFormIdentifier=titleform) (Information on how to cite this page) Cite this page This page was last edited on 25 May 2023, at 01:46. (https://pve.proxmox.com/wiki/Proxmox_VE:Privacy_policy) Privacy policy (https://pve.proxmox.com/wiki/Proxmox_VE:About) About Proxmox VE (https://pve.proxmox.com/wiki/Proxmox_VE:General_disclaimer) Disclaimers (https://www.mediawiki.org/) (Powered by MediaWiki) ()