Storage question, im stumped after hours of research :(! Shrink local and increase Directory storage

redactedhosting

New Member
Apr 20, 2024
12
0
1
Hi all, im trying to reduce my local storage and re assign it to my "agents" storage that i use for all of my LXCs & VMs. Im short, i have 6ish TB in my node1 local, and i am looking at 3.6TB Agents storage in directory type.

My question is how can i cut local in half, and move the remaining 3tb to 3.6TB Agents storage. Screenshots attached. Thank you for any advice on this.
lsblk && lvs:

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
loop0 7:0 0 20G 0 loop
loop1 7:1 0 32G 0 loop
loop2 7:2 0 100G 0 loop
sda 8:0 0 6.5T 0 disk
├─sda1 8:1 0 1007K 0 part
├─sda2 8:2 0 1G 0 part
└─sda3 8:3 0 6.5T 0 part
├─pve-swap 252:0 0 8G 0 lvm [SWAP]
└─pve-root 252:1 0 6.5T 0 lvm /
sdb 8:16 0 3.3T 0 disk
└─sdb1 8:17 0 3.3T 0 part /mnt/pve/agents
sr0 11:0 1 1024M 0 rom
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
root pve -wi-ao---- <6.54t
swap pve -wi-ao---- 8.00g
 

Attachments

  • storage4.PNG
    storage4.PNG
    14.6 KB · Views: 11
  • storage3.PNG
    storage3.PNG
    32 KB · Views: 8
  • storage2.PNG
    storage2.PNG
    32.2 KB · Views: 10
  • storage1.PNG
    storage1.PNG
    22.5 KB · Views: 8
Hi, I admit I don't quite understand your question. What exactly you want to achieve.
Are you trying to use a part of sda in the storage of type "directory" in sdb? I don't know if it's possible without reformatting sdb first. From your post I understand that in sdb you already have got data (VM and LXC images).

Please post the result of pvesm status

One could reformat sdb to be another PV (physical volume) for LVM and add it into "pve" VG. But sdb contains data, doesn't it?...

Then shrink pve-root and use the regained space for a new LV (logical volume) for VMs and LXCs.

And there are even more questions. E.g. do you want to keep "directory" type storage? Or use LVM-thin? They have different features and possibilities. See the links below.

You should also consider what happens when one of the disks have failed.

Have you already studied https://pve.proxmox.com/pve-docs/chapter-pvesm.html and https://pve.proxmox.com/wiki/Storage ? Maybe you have, as you have written "stumped after hours of research" ;)

But first of all, have backups! :)
 
Hi,
what you can try is:
  1. reduce size of LV pve-root (lvreduce)
  2. create a partition sda4 with the freed up space, type LVM (sgdisk)
  3. create a PV of this partition sda4 (pvecreate) and a new Volume Group (vgcreate).
  4. create a new LV (lvcreate) for the agents.
  5. mount the new LV
  6. copy the data from /mnt/pve/agents to the new LV
  7. remove the agents storage from PVE and if required umount it
  8. wipe the disk sdb, initialize as gpt and for LVM with sgdisk
  9. create a PV of sdb (pvecreate)
  10. add the PV to the agents Volume Group (vgextend)
  11. extend the LV of the agents (lvextend)
  12. add the LV as directory to PVE storage
Having a backup is a good idea nevertheless.