Reduce Storage Space

miranpiscanc

Member
Dec 6, 2024
47
9
8
Trieste - Italy
Sorry, but I have an urgent issue. How can I reduce the space of a Storage to migrate the VM's hard drive to another Storage? My NAS is in alarm and could fail at any moment. See the photo. Thanks, everyone
Screenshot 2025-01-25 alle 15.48.54.png
 
In an emergency, you can attach just about any old disk as Storage (even a Samba mount to your Win10 PC, as long as you have enough free space) and back it up that way
 
Ok, thanks, but aside from this solution, since I've already done the backup, how can I reduce the size of the hard drive to move the VM storage to another USB-connected disk with an SSD? I have a 500GB SSD, but it won't let me move it due to a small amount of extra data. Thanks.
 
Ok, thanks, but aside from this solution, since I've already done the backup, how can I reduce the size of the hard drive to move the VM storage to another USB-connected disk with an SSD? I have a 500GB SSD, but it won't let me move it due to a small amount of extra data. Thanks.
Could you perhaps either move that extra data or delete it (if it is not needed)?
 
The VM, which is a Win7, doesn’t use the full 500GB. In fact, I’ve reduced the disk space in Windows to 290GB, yet it still won’t let me shrink it. I’m attaching two screenshots to explain better.

Schermata 2025-01-27 alle 10.11.51.png


Schermata 2025-01-27 alle 10.08.17.png

Schermata 2025-01-27 alle 10.10.18.png
 
Is possible that use more space if vm disk is not preallocated and don't use of discard.
If the vm disk is a file can be useful check with "qemu-img info".

EDIT:
seeing that you have a lot of unallocated space you could reduce the size of the disk, if it fails instead because it is pre-allocated and/or tries to copy as pre-allocated, be careful because you do not reduce by cutting the space used by the partition.
Keep attention that shrinking disks is dangerous, perhaps manually copying and converting the disk from cli might be the safest and easiest option.
 
Last edited:
Start to go to the path of actual disk (vm-100-disk-0.raw) and do qemu-img info on it to have exact situation.
If you setted nfs storage should know where mounted, if not look in /etc/pve/storage.cfg.
If path is for example /mnt/nfs will be:
Code:
qemu-img info /mnt/nfs/images/100/vm-100-disk-0.raw
 
Thank you. If I understand correctly, I need to check the size of the file vm-100-disk-0.raw. If I enter the command you provided, after finding the correct path, it responds like this:
Schermata 2025-01-27 alle 14.33.18.png
Schermata 2025-01-27 alle 14.36.18.png
Schermata 2025-01-27 alle 14.36.40.png


Additionally, it’s configured in NFS, and if I type the other command, it responds like this:

Schermata 2025-01-27 alle 14.37.38.png

and additional info

Schermata 2025-01-27 alle 14.40.49.png

Thank you, and sorry for my lack of knowledge
 
From what I see unfortunately it seems that you don't even have the most basic knowledge of linux :(, in these cases I would personally advise against using proxmox.

For looking a configuration file you can use for example "less" (and not trying to execute the config file like you did) but from your latest screenshot you can see the correct path, "/mnt/pve/NapMP_HD/"
Small advice: tab button on keyboard can help you with autocomplete commands and path, for example if you manually wrote "qemu-img info /mnt/pve/N" with tab will autocomplete the directory name and if you press tab again to complete dir will show dir and files that contain.