What is "vm-101-state-ReadyToResizeDisk"

kenden

Member
Feb 10, 2024
6
0
6
I wanted to add 15G to a debian VM 101. But I increased its size to 160G by mistake. I have not allocated the space in the vm yet and wanted to SET the disk size to 80GB. The vm root is 62GB currently.

At the very end of the fdisk listing is this ReadyToResizedDisk with a size of 32.49G. Where did that size come from? I see that it is parent of the vm-101-disk-0"

I was planning to use lvreduce to change the disk to 80GB but I am not sure how "ReadyToResizeDisk" device and "vm-101-disk-0" are related.

I am stuck on how to proceed and would appreciate advice on recommended steps to get the vm useable disk size to ~80GB.

TIA.

Code:
fdisk -l 
Disk /dev/mapper/pve-vm--101--disk--0: 160 GiB, 171798691840 bytes, 335544320 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes
Disklabel type: dos
Disk identifier: 0xada334b5

Device                                 Boot     Start       End   Sectors  Size Id Type
/dev/mapper/pve-vm--101--disk--0-part1 *         2048 132216831 132214784   63G 83 Linux
/dev/mapper/pve-vm--101--disk--0-part2      132218878 134215679   1996802  975M  5 Extended
/dev/mapper/pve-vm--101--disk--0-part5      132218880 134215679   1996800  975M 82 Linux swap / Solaris

Partition 2 does not start on physical sector boundary.
.....
.....
Disk /dev/mapper/pve-vm--101--state--ReadyToResizeDisk: 32.49 GiB, 34884026368 bytes, 68132864 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes


The config file shows the ReadyToResizeDisk, and it shows up in /dev/
Code:
 qm config 101 
parent: ReadyToResizeDisk
scsi0: local-lvm:vm-101-disk-0,iothread=1,size=160G
scsihw: virtio-scsi-single

Code:
root@pve:/dev/pve# ls /dev/pve/vm-101*
/dev/pve/vm-101-disk-0    /dev/pve/vm-101-state-ReadyToResizeDisk
 
The easiest way to reverse this is to restore a snapshot or backup. Due to thin provisioning it's not really a problem to keep it as is though. Can you share lvs -a?
 
Last edited:
The easiest way to reverse this is to restore a snapshot or backup. Due to thin provisioning it's not really a problem to keep it as is though. Can you share lvs -a?

Sure, thanks..

Code:
root@pve:~# lvs -a
  LV                                   VG  Attr       LSize    Pool Origin        Data%  Meta%  Move Log Cpy%Sync Convert
  base-10000-disk-0                    pve Vri---tz-k    8.00g data                                                     
  base-11000-disk-0                    pve Vri---tz-k    8.00g data                                                     
  data                                 pve twi-aotz-- <816.21g                    38.53  1.48                           
  [data_tdata]                         pve Twi-ao---- <816.21g                                                           
  [data_tmeta]                         pve ewi-ao----   <8.33g                                                           
  [lvol0_pmspare]                      pve ewi-------   <8.33g                                                           
  root                                 pve -wi-ao----   96.00g                                                           
  snap_vm-101-disk-0_ReadyToResizeDisk pve Vri---tz-k  160.00g data vm-101-disk-0                                       
  swap                                 pve -wi-ao----    8.00g                                                           
  vm-100-disk-0                        pve Vwi-a-tz--    4.00m data               14.06                                 
  vm-100-disk-1                        pve Vwi-a-tz--   80.00g data               59.96                                 
  vm-100-disk-2                        pve Vwi-a-tz--    4.00m data               1.56                                   
  vm-1000-disk-0                       pve Vwi-aotz--   18.00g data               99.77                                 
  vm-1001-disk-0                       pve Vwi-a-tz--   10.00g data               17.03                                 
  vm-101-disk-0                        pve Vwi-aotz--  160.00g data               39.63                                 
  vm-101-state-ReadyToResizeDisk       pve Vwi-a-tz--  <32.49g data               8.87                                   
  vm-103-disk-0                        pve Vwi-aotz--    8.00g data               61.51                                 
  vm-104-disk-0                        pve Vwi-a-tz--    8.00g data               99.10                                 
  vm-105-disk-0                        pve Vwi-aotz--   32.00g data               88.20                                 
  vm-106-disk-0                        pve Vwi-a-tz--    4.00m data               14.06                                 
  vm-107-disk-0                        pve Vwi-a-tz--   32.00g data               13.97                                 
  vm-107-disk-1                        pve Vwi-a-tz--   32.00g data               0.00                                   
  vm-107-disk-2                        pve Vwi-a-tz--   32.00g data               11.87                                 
  vm-108-disk-0                        pve Vwi-a-tz--   50.00g data               7.43                                   
  vm-109-disk-0                        pve Vwi-aotz--   80.00g data               94.43                                 
  vm-110-disk-0                        pve Vwi-aotz--    4.00m data               14.06                                 
  vm-110-disk-1                        pve Vwi-aotz--   32.00g data               73.53                                 
  vm-111-disk-0                        pve Vwi-a-tz--    4.00m data               14.06                                 
  vm-111-disk-1                        pve Vwi-a-tz--    4.00m data               1.56                                   
  vm-112-disk-0                        pve Vwi-a-tz--   25.00g data               24.82                                 
  vm-113-disk-0                        pve Vwi-a-tz--  132.00g data               6.58                                   
  vm-114-disk-0                        pve Vwi-a-tz--   64.00g data               8.91                                   
  vm-115-disk-0                        pve Vwi-a-tz--   50.00g data               6.76                                   
  vm-117-disk-0                        pve Vwi-a-tz--    8.00g data               22.73
 
The state is due to RAM being included in your snapshot. It looks like your snapshot was done after resizing which is bad. Do you have backups from before? Shrinking is possible but you have to be careful and it's a lot of steps with many variables. Check lsblk -o+FSTYPE inside the VM first.
 
  • Like
Reactions: Johannes S
The state is due to RAM being included in your snapshot. It looks like your snapshot was done after resizing which is bad. Do you have backups from before? Shrinking is possible but you have to be careful and it's a lot of steps with many variables. Check lsblk -o+FSTYPE inside the VM first.
No back-up before the proxmox change. I had the clever idea to create before resizing sda and the fs. The backup was taking forever and that's when I realized I created a much larger disk that planned. sda has not been allocated to root and that is why I thought that it might just be a few steps to reduce the size of the disk at the proxmox level. I was moving to do that but the "vm-101-state-ReadyToResizeDisk" confused me.

Code:
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS FSTYPE
sda      8:0    0  160G  0 disk             
├─sda1   8:1    0   63G  0 part /           ext4
├─sda2   8:2    0    1K  0 part             
└─sda5   8:5    0  975M  0 part [SWAP]      swap
sr0     11:0    1 1024M  0 rom

.
 
Please don't quote every message. You can simply shrink the volume as your partition was not resized yet. I'm always scared about rounding issues so I'd account for that with a bit of a buffer. I.e partition size + 1G. In your case this is not needed and should be safe. Shut down the VM, remove snapshots, make a backup, then try this
Bash:
lvresize -L 80G pve/vm-101-disk-0
qm rescan
Extending the partition inside the VM is difficult due to the partition layout. It's not at the end so you have to move space around. I'd attach gparted and use that. Also look into creating a proper snapshot and backup schedule.
 
Last edited:
  • Like
Reactions: Johannes S
Thanks for your help. I was able to resize the partition. Did not think about mounting an Iso of gparted, thanks for that too. I do need to set up something to do backups/snapshots automatically. What duh moment I had when I realized I created all of my confusion when I created the snapshot.