Resize /dev/pve/data and transfer it to /dev/pve/root

Jonathan Luigi

New Member
Jan 28, 2017
1
0
1
31
Hi Friends,

Ive recently installed proxmox4.4 on a machine that has 2TB of disk space.
The default partition was:
96GB for /dev/mapper/pve-root
8GB for /dev/mapper/pve-swap


and the rest of the disk size was allocated to /dev/pve/data.

What i would want to do is resize/reduce the disk size of /dev/pve/data by 500GB and transfer that space to /dev/pve/root.
Currenty, I already have 2 VMs running on proxmox.

Is there a way to this without a rescue CD? Any form of help would be great.

Thanks!
Jonathan
 
Hello Jonathan

Hi Friends,

Ive recently installed proxmox4.4 on a machine that has 2TB of disk space.
The default partition was:
96GB for /dev/mapper/pve-root
8GB for /dev/mapper/pve-swap


and the rest of the disk size was allocated to /dev/pve/data.

What i would want to do is resize/reduce the disk size of /dev/pve/data by 500GB and transfer that space to /dev/pve/root.
Currenty, I already have 2 VMs running on proxmox.

Is there a way to this without a rescue CD? Any form of help would be great.

It depends which filesystem you have at /dev/pve/data resp. /dev/pve/root

* In case of ext(2,3,4):

- shrink the filesystem at /dev/pve/data by resize2fs

- shrink the logical volume by lvreduce - be careful to not make it less than the filesystem has been reduced to, see https://blog.shadypixel.com/how-to-shrink-an-lvm-volume-safely/

- extend the volume /dev/pve/root by lvextend

- extend the filesystem at /dev/pve/root by resize2fs

* in case of xfs:

- xfs filesystem cannot be reduced, therefore copy all current files in /dev/pve/data to a save place

- shrink the logical volume by lvreduce

- create a new filesystem at it and restore the previously saved files

- extend the volume /dev/pve/root by lvextend

- extend the filesystem by xfs_grows (see respective man page)

Success!

Mr.Holmes
 

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!