[SOLVED] Change "local" directory path

mathais86

New Member
Jan 30, 2023
11
0
1
Hi,
I'm sorry, but I did some researches, and I can't change this path.
Actually, Local directory is /var/lib/vz
I would want to set this to /srv/proxmox/vz
I tried to create the file /etc/pve/storage.cfg with these lines and reboot server, but the path is allways /var/lib/vz.
Thank you.

Code:
dir: local
        path /srv/proxmox/vz
        content iso,vztmpl,backup

# default image store on LVM based installation
lvmthin: local-lvm
        thinpool data
        vgname pve
        content rootdir,images

# default image store on ZFS based installation
zfspool: local-zfs
        pool rpool/data
        sparse
        content images,rootdir
 
can you explain what you mean by this? changing the path will not migrate existing data to new location, nor will it remove old local physically. Only new disks/iso/etc will be placed there


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
Yes, I can explain.
I just uploaded an ISO to ProxMox ISO, as you can see, the report show the old path.
My new path configuration isn't efficient :
/var/lib/vz/template/iso/ubuntu-22.04.1-live-server-arm64.iso
Code:
starting file import from: /var/tmp/pveupload-cb077f59673033456fd9ffda526
target node: mathieuubuntu
target file: /var/lib/vz/template/iso/ubuntu-22.04.1-live-server-arm64.iso
file size is: 1436102656
command: cp -- /var/tmp/pveupload-cb077f59673033456fd9ffda526 /var/lib/vz/template/iso/ubuntu-22.04.1-live-server-arm64.iso
finished file import successfully
TASK OK
 
looks like "local" storage is reserved/hard-coded. I recommend you create a new "dir" storage to your liking and point it wherever it makes sense.


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
I solve it !
I disabled "local" storage and add a new custom named "local-mb"
Capture d’écran 2023-01-30 à 23.15.26.png


Capture d’écran 2023-01-30 à 23.18.17.png


Capture d’écran 2023-01-30 à 23.21.15.png
 

Attachments

  • Capture d’écran 2023-01-30 à 23.18.17.png
    Capture d’écran 2023-01-30 à 23.18.17.png
    329.4 KB · Views: 59
I had a similar case in which I needed to change the location.
In my case I had an external application that wanted to create a host via the API
This method forced the use the local directory, but the space left on that location was insufficient.

I managed to workaround the issue by making the folder /var/lib/vz a symlink pointing to my new location at /mnt/pve/data.
However this only works if you remove the /var/lib/vz folder and immediately create the symlink afterwards.
If you wait too long, the system will automatically recreate the /var/lib/vz folder.

I used this script to make it work:
Bash:
cp -pdf /var/lib/vz/* /mnt/pve/data
rm -Rf /var/lib/vz
ln -sn /mnt/pve/data /var/lib/vz
Afterwards I enabled the local directory and was able to continue creating the new host via the API.

Disclaimer:
This worked fine for me, but this is kind of a "hack".
Unless some "Distinguished Member" says otherwise, I would consider this method: "Use at your own risk".