Dump PVE drive to a smaller new disk

Hi,
what are the steps to perform to resize the main disk from 2TB to 1TB in order to be able to perform a Dump to a new 1TB device to replace the main disk of the PVE host?

Do I simply need to execute pvresize --setphysicalvolumesize 800G /dev/nvme0n1p3 to resize the big partition with VMs and
then dump the whole /dev/nvme0 (or /dev/nvme0n1??) to the target 1TB drive? It will obviously fail because after copying 1TB of data the destination drive will be full but all the 3 partitions should be on the target disk before it fills up, am I right?

Is it sufficient to do a pvresize or do I need to decrease also the volumegroup size? Is it done automagically? After booting from the new disk then can simply resize back to fill al the 1TB available? Do I need to resize (destroy and recreate the corresponding entry) /dev/nvme0n1p3 in fdisk? How do I choose the exact boundaries of the partition? Can I "simply" do all the operations with gparted or some tools like that to avoid missing some points?

I'd like to understand if there is some sort of risk in decreasing the PV in this way.

Thank you in advance for any help.

Bash:
# ls /dev/nvme*                                                                                                                                              
/dev/nvme0  /dev/nvme0n1  /dev/nvme0n1p1  /dev/nvme0n1p2  /dev/nvme0n1p3

# vgs pve                                                                                                                                                    
  VG  #PV #LV #SN Attr   VSize  VFree                                                                                                                                                                      
  pve   1  33   0 wz--n- <1.82t 16.37g                                                                                                                                                                    

# pvs                                                                                                                                                        
  PV             VG  Fmt  Attr PSize  PFree                                                                                                                                                                
  /dev/nvme0n1p3 pve lvm2 a--  <1.82t 16.37g                                                                                                                                                              

# lvs                                                                                                                                                        
                                                                                                                                                                                                           
  vm-9001-cloudinit                       pve Vwi-a-tz--  4.00m data                0.00                                                                                                                  
  LV                                      VG  Attr       LSize  Pool Origin         Data%  Meta%  Move Log Cpy%Sync Convert                                                                                
  base-9000-disk-0                        pve Vri---tz-k 20.00g data                                                                                                                                      
  base-9001-disk-0                        pve Vri---tz-k 20.00g data                                                                                                                                      
  data                                    pve twi-aotz--  1.67t                     4.40   0.32                                                                                                            
  root                                    pve -wi-ao---- 96.00g                                                                                                                                            
  snap_vm-1001-disk-0_initial-setup       pve Vri---tz-k 20.00g data vm-1001-disk-0                                                                                                                        
  snap_vm-1011-disk-0_cluster-initialized pve Vri---tz-k 20.00g data vm-1011-disk-0                                                                                                                        
  snap_vm-1012-disk-0_cluster-initialized pve Vri---tz-k 20.00g data vm-1012-disk-0                                                                                                                        
  snap_vm-1013-disk-0_cluster-initialized pve Vri---tz-k 20.00g data vm-1013-disk-0                                                                                                                        
  snap_vm-1021-disk-0_cluster-initialized pve Vri---tz-k 20.00g data vm-1021-disk-0                                                                                                                        
  snap_vm-1022-disk-0_cluster-initialized pve Vri---tz-k 20.00g data vm-1022-disk-0                                                                                                                        
  swap                                    pve -wi-ao----  8.00g                                                                                                                                            
  vm-100-disk-0                           pve Vwi-a-tz-- 64.00g data                23.77                                                                                                                  
  vm-100-disk-1                           pve Vwi-a-tz--  4.00m data                1.56                                                                                                                  
  vm-1001-cloudinit                       pve Vwi-a-tz--  4.00m data                9.38                                                                                                                  
  vm-1001-disk-0                          pve Vwi-a-tz-- 20.00g data                13.61                                                                                                                  
  vm-101-disk-0                           pve Vwi-aotz-- 32.00g data                12.70                                                                                                                  
  vm-1011-cloudinit                       pve Vwi-a-tz--  4.00m data                9.38                                                                                                                  
  vm-1011-disk-0                          pve Vwi-a-tz-- 20.00g data                31.76                                                                                                                  
  vm-1012-cloudinit                       pve Vwi-a-tz--  4.00m data                9.38                                                                                                                  
  vm-1012-disk-0                          pve Vwi-a-tz-- 20.00g data                27.87                                                                                                                  
  vm-1013-cloudinit                       pve Vwi-a-tz--  4.00m data                9.38                                                                                                                  
  vm-1013-disk-0                          pve Vwi-a-tz-- 20.00g data                28.30                                                                                                                  
  vm-102-disk-0                           pve Vwi-a-tz-- 64.00g data                14.60                                                                                                                  
  vm-1021-cloudinit                       pve Vwi-a-tz--  4.00m data                9.38                                                                                                                  
  vm-1021-disk-0                          pve Vwi-a-tz-- 20.00g data                24.79                                                                                                                  
  vm-1022-cloudinit                       pve Vwi-a-tz--  4.00m data                9.38                                                                                                                  
  vm-1022-disk-0                          pve Vwi-a-tz-- 20.00g data                25.55                                                                                                                  
  vm-103-disk-0                           pve Vwi-aotz-- 32.00g data                19.20                                                                                                                  
  vm-104-cloudinit                        pve Vwi-aotz--  4.00m data                9.38                                                                                                                  
  vm-104-disk-0                           pve Vwi-aotz-- 20.00g data                13.68                                                                                                                  
  vm-105-disk-0                           pve Vwi-aotz--  8.00g data                22.69                                                                                                                  
  vm-9000-cloudinit                       pve Vwi-a-tz--  4.00m data                9.38

# fdisk -l                                                                                                                                                   
Disk /dev/nvme0n1: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors                                                                                                                                       
Disk model: Sabrent Rocket Q4                                                                                                                                                                              
Units: sectors of 1 * 512 = 512 bytes                                                                                                                                                                      
Sector size (logical/physical): 512 bytes / 512 bytes                                                                                                                                                      
I/O size (minimum/optimal): 512 bytes / 512 bytes                                                                                                                                                          
Disklabel type: gpt                                                                                                                                                                                        
Disk identifier: 76B44B6A-E36D-4507-99AC-2B905F6BAF4E                                                                                                                                                      
                                                                                                                                                                                                           
Device           Start        End    Sectors  Size Type                                                                                                                                                    
/dev/nvme0n1p1      34       2047       2014 1007K BIOS boot                                                                                                                                               
/dev/nvme0n1p2    2048    1050623    1048576  512M EFI System                                                                                                                                              
/dev/nvme0n1p3 1050624 3907029134 3905978511  1.8T Linux LVM
[...]
 
Last edited:

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!