How to obtain the path to iso storage folder ?

shodan

Active Member
Sep 1, 2022
166
52
33
Hi,

I'm trying to make a shell function get_iso_paths()
which would return every path to every storage id of type dir which has content type iso

I found that I can get the storage id of type dir with content type iso with

Code:
pvesm status --content iso

Example

Code:
root@proxmox:~# pvesm status --content iso
Name           Type     Status           Total            Used       Available        %
lvm-iso         dir     active       205314024       198659016               0   96.76%
root@proxmox:~#

So function

Code:
get_storage_id_dir_with_iso() { pvesm status --content iso | awk '$2 == "dir" {print $1}'; }

output
Code:
root@proxmox:~# get_storage_id_dir_with_iso
lvm-iso
root@proxmox:~#

However I want the path for each folder that contains those iso

Is there a standard way to get "path of a dir type storage id" ?

Other than parsing /etc/pve/storage.cfg ?
 
Best I could come up with for now it


Code:
get_iso_paths() {
    while read -r storage; do
        path=$(awk -v storage="$storage" '
            $1 == "dir:" && $2 == storage {found=1; next}
            found && $1 == "path" {print $2; exit}
            found && /^dir:|lvmthin:/ {exit}  # Stop if we reach another storage definition
        ' /etc/pve/storage.cfg)

        if [[ -n "$path" ]]; then
            echo "$path/template/iso"
        else
            echo "ERROR: Path not found for storage '$storage'" >&2
        fi
    done < <(get_storage_id_dir_with_iso)
}

oneliner version

Code:
get_iso_paths() { while read -r s; do awk -v s="$s" '$1 == "dir:" && $2 == s {f=1; next} f && $1 == "path" {print $2 "/template/iso"; exit} f && /^dir:|lvmthin:/ {exit}' /etc/pve/storage.cfg; done < <(get_storage_id_dir_with_iso); }


output
Code:
root@proxmox:~# get_iso_paths
/mnt/iso/template/iso
root@proxmox:~# get_iso_paths
/var/lib/vz/template/iso
/mnt/ct-template/template/iso
/mnt/iso/template/iso
root@proxmox:~#
 
  • Like
Reactions: Kingneutron
I have also created a shell function that return the path to a dir type specified on the first arguemnt

Code:
get_iso_path() { awk -v s="$1" '$1 == "dir:" && $2 == s {f=1; next} f && $1 == "path" {print $2 "/template/iso"; exit} f && /^dir:|lvmthin:/ {exit}' /etc/pve/storage.cfg; }


here is the output

Code:
root@proxmox:/var/lib/vz/template/cache# get_iso_path lvm-iso
/mnt/iso/template/iso
root@proxmox:/var/lib/vz/template/cache#
 
Ok,

So in my case I needed to be able to find my iso file's absolute path no matter where it was

So I made this function called get-iso-file-path

Here is the usage information

Code:
Usage: get-iso-file-path <ISO_PATH> [SMB_OPTIONS]

Description:
  Resolves the full path of an ISO file from various sources, including:
  - Local filesystem paths (absolute or relative)
  - Proxmox storage pools (storage:iso_name)
  - Recursively searching Proxmox ISO storage directories
  - SMB/CIFS network shares (//server/share/path/to/file.iso)

Arguments:
  <ISO_PATH>      The path to the ISO file. This can be:
                  - A relative or absolute local path (e.g., "Win10.iso", "/mnt/iso/Win10.iso")
                  - A Proxmox storage pool reference (e.g., "lvm-iso:Win10.iso")
                  - A path to an SMB/CIFS share (e.g., "//example.com/share/examplefolder/Win10.iso")

  [SMB_OPTIONS]   Optional. Only applies to SMB paths. Authentication options
                  for mounting a Samba share (e.g., "username=user,password=pass").
                  If not provided, defaults to guest access.

Examples:
  1. Local file:
     $ get-iso-file-path Win10_22H2_EnglishInternational_x64.iso
     Output: /mnt/iso/template/iso/Win10_22H2_EnglishInternational_x64.iso

  2. Proxmox storage pool:
     $ get-iso-file-path lvm-iso:Win10_22H2_EnglishInternational_x64.iso
     Output: /mnt/iso/template/iso/Win10_22H2_EnglishInternational_x64.iso

  3. SMB share with guest access:
     $ get-iso-file-path //example.com/share/examplefolder/Win10_22H2_EnglishInternational_x64.iso
     Output: /tmp/repack-iso/examplefolder/Win10_22H2_EnglishInternational_x64.iso

  4. SMB share with authentication:
     $ get-iso-file-path //example.com/share/examplefolder/Win10_22H2_EnglishInternational_x64.iso username=user,password=pass
     Output: /tmp/repack-iso/examplefolder/Win10_22H2_EnglishInternational_x64.iso

  5. Non-existent file:
     $ get-iso-file-path nonexistent.iso
     Error: ISO file 'nonexistent.iso' not found.

Notes:
  - If an SMB share is already mounted, it will be unmounted before remounting.
  - If an ISO file is not found in any known location, an error message is returned.


Here is the test output


Code:
root@proxmox:/mnt/iso/template# get-iso-file-path Win10_22H2_EnglishInternational_x64.iso
/mnt/iso/template/iso/Win10_22H2_EnglishInternational_x64.iso
root@proxmox:/mnt/iso/template# get-iso-file-path /mnt/iso/template/iso/Win10_22H2_EnglishInternational_x64.iso
/mnt/iso/template/iso/Win10_22H2_EnglishInternational_x64.iso
root@proxmox:/mnt/iso/template# get-iso-file-path iso/Win10_22H2_EnglishInternational_x64.iso
/mnt/iso/template/iso/Win10_22H2_EnglishInternational_x64.iso
root@proxmox:/mnt/iso/template# get-iso-file-path lvm-iso:Win10_22H2_EnglishInternational_x64.iso
/mnt/iso/template/iso/Win10_22H2_EnglishInternational_x64.iso
root@proxmox:/mnt/iso/template# get-iso-file-path //shodan.lan/guest/Win10_22H2_EnglishInternational_x64.iso
/tmp/repack-iso/Win10_22H2_EnglishInternational_x64.iso
root@proxmox:/mnt/iso/template# get-iso-file-path "//shodan.lan/share/Win10_22H2_EnglishInternational_x64.iso" "username=user,password=qwerty"
/tmp/repack-iso/Win10_22H2_EnglishInternational_x64.iso
root@proxmox:/mnt/iso/template# get-iso-file-path Win10_22H2_EnglishInternational_x64WRONG.iso
Error: ISO file 'Win10_22H2_EnglishInternational_x64WRONG.iso' not found.
root@proxmox:/mnt/iso/template# get-iso-file-path /mnt/iso/template/iso/Win10_22H2_EnglishInternational_x64WRONG.iso
Error: ISO file '/mnt/iso/template/iso/Win10_22H2_EnglishInternational_x64WRONG.iso' not found.
root@proxmox:/mnt/iso/template# get-iso-file-path iso/Win10_22H2_EnglishInternational_x64WRONG.iso
Error: ISO file 'iso/Win10_22H2_EnglishInternational_x64WRONG.iso' not found.
root@proxmox:/mnt/iso/template# get-iso-file-path lvm-iso:Win10_22H2_EnglishInternational_x64WRONG.iso
Error: ISO file 'lvm-iso:Win10_22H2_EnglishInternational_x64WRONG.iso' not found.
root@proxmox:/mnt/iso/template# get-iso-file-path //shodan.lan/guest/Win10_22H2_EnglishInternational_x64WRONG.iso
Error: File 'Win10_22H2_EnglishInternational_x64WRONG.iso' not found in mounted share.
root@proxmox:/mnt/iso/template# get-iso-file-path "//shodan.lan/share/Win10_22H2_EnglishInternational_x64WRONG.iso" "username=user,password=qwerty"
Error: File 'Win10_22H2_EnglishInternational_x64WRONG.iso' not found in mounted share.
root@proxmox:/mnt/iso/template#


the shell function itself, readable version


Code:
get-iso-file-path() {
    local input_path="$1"
    local smb_options="$2"  # User-provided SMB options (without "-o")
    local sourceiso=""

    # Check if the path is an SMB share (starts with //)
    if [[ "$input_path" == //* ]]; then
        if ! command -v mount.cifs &>/dev/null; then
            echo "Error: mount.cifs not found. Cannot mount SMB share." >&2
            return 1
        fi

        local smb_server_share="$(echo "$input_path" | cut -d'/' -f3,4)"  # Extract //server/share
        local smb_subpath="$(echo "$input_path" | cut -d'/' -f5-)"        # Extract subfolders & filename

        # Unmount if already mounted
        if mountpoint -q /tmp/repack-iso; then
            umount /tmp/repack-iso
        fi

        mkdir -p /tmp/repack-iso

        # Ensure guest mode uses "password=" to prevent password prompts
        if [[ -z "$smb_options" ]]; then
            smb_options="username=guest,password="
        fi

        mount.cifs "//$smb_server_share" /tmp/repack-iso -o "$smb_options" 2>/dev/null || \
        mount.cifs "//$smb_server_share" /tmp/repack-iso -o username=user,password=qwerty 2>/dev/null

        if [ $? -ne 0 ]; then
            echo "Error: Failed to mount SMB share '//$smb_server_share'." >&2
            return 1
        fi

        if [ -f "/tmp/repack-iso/$smb_subpath" ]; then
            echo "/tmp/repack-iso/$smb_subpath"
            return 0
        else
            echo "Error: File '$smb_subpath' not found in mounted share." >&2
            umount /tmp/repack-iso
            return 1
        fi
    fi

    # Check if input is a regular file (absolute or relative)
    if [ -f "$input_path" ]; then
        echo "$(realpath "$input_path")"
        return 0
    fi

    # Check if input is a Proxmox storage path (storage:filename.iso)
    if [[ "$input_path" == *":"* ]]; then
        local storage="${input_path%%:*}"
        local filename="${input_path#*:}"
        local storage_path="$(awk -v s="$storage" '$1 == "dir:" && $2 == s {f=1; next} f && $1 == "path" {print $2 "/template/iso"; exit} f && /^dir:|lvmthin:/ {exit}' /etc/pve/storage.cfg)"

        if [ -n "$storage_path" ] && [ -f "$storage_path/$filename" ]; then
            echo "$storage_path/$filename"
            return 0
        fi
    fi

    # Search all known Proxmox ISO storage paths
    while read -r path; do
        if [ -f "$path/$input_path" ]; then
            echo "$path/$input_path"
            return 0
        fi
    done < <(pvesm status --content iso | awk '$2 == "dir" {print $1}' | while read -r s; do awk -v s="$s" '$1 == "dir:" && $2 == s {f=1; next} f && $1 == "path" {print $2 "/template/iso"; exit} f && /^dir:|lvmthin:/ {exit}' /etc/pve/storage.cfg; done)

    # If no file is found
    echo "Error: ISO file '$input_path' not found." >&2
    return 1
}

oneliner function version

Code:
get-iso-file-path() { local input_path="$1" smb_options="${2:+-o $2}"; if [[ "$input_path" == //* ]]; then command -v mount.cifs &>/dev/null || { echo "Error: mount.cifs not found." >&2; return 1; }; local smb_server_share="$(echo "$input_path" | cut -d'/' -f3,4)"; local smb_subpath="$(echo "$input_path" | cut -d'/' -f5-)"; mountpoint -q /tmp/repack-iso && umount /tmp/repack-iso; mkdir -p /tmp/repack-iso; [[ -z "$smb_options" ]] && smb_options="-o username=guest,password="; mount.cifs "//$smb_server_share" /tmp/repack-iso $smb_options 2>/dev/null || mount.cifs "//$smb_server_share" /tmp/repack-iso -o username=user,password=qwerty 2>/dev/null || { echo "Error: Failed to mount SMB share '//$smb_server_share'." >&2; return 1; }; [ -f "/tmp/repack-iso/$smb_subpath" ] && echo "/tmp/repack-iso/$smb_subpath" && return 0 || { echo "Error: File '$smb_subpath' not found in mounted share." >&2; umount /tmp/repack-iso; return 1; }; fi; [ -f "$input_path" ] && echo "$(realpath "$input_path")" && return 0; if [[ "$input_path" == *":"* ]]; then local storage="${input_path%%:*}" filename="${input_path#*:}"; local storage_path="$(awk -v s="$storage" '$1 == "dir:" && $2 == s {f=1; next} f && $1 == "path" {print $2 "/template/iso"; exit} f && /^dir:|lvmthin:/ {exit}' /etc/pve/storage.cfg)"; [ -n "$storage_path" ] && [ -f "$storage_path/$filename" ] && echo "$storage_path/$filename" && return 0; fi; while read -r path; do [ -f "$path/$input_path" ] && echo "$path/$input_path" && return 0; done < <(pvesm status --content iso | awk '$2 == "dir" {print $1}' | while read -r s; do awk -v s="$s" '$1 == "dir:" && $2 == s {f=1; next} f && $1 == "path" {print $2 "/template/iso"; exit} f && /^dir:|lvmthin:/ {exit}' /etc/pve/storage.cfg; done); echo "Error: ISO file '$input_path' not found." >&2; return 1; }
 
Ok,

So in my case I needed to be able to find my iso file's absolute path no matter where it was

So I made this function called get-iso-file-path

Here is the usage information

Code:
Usage: get-iso-file-path <ISO_PATH> [SMB_OPTIONS]

Description:
  Resolves the full path of an ISO file from various sources, including:
  - Local filesystem paths (absolute or relative)
  - Proxmox storage pools (storage:iso_name)
  - Recursively searching Proxmox ISO storage directories
  - SMB/CIFS network shares (//server/share/path/to/file.iso)

Arguments:
  <ISO_PATH>      The path to the ISO file. This can be:
                  - A relative or absolute local path (e.g., "Win10.iso", "/mnt/iso/Win10.iso")
                  - A Proxmox storage pool reference (e.g., "lvm-iso:Win10.iso")
                  - A path to an SMB/CIFS share (e.g., "//example.com/share/examplefolder/Win10.iso")

  [SMB_OPTIONS]   Optional. Only applies to SMB paths. Authentication options
                  for mounting a Samba share (e.g., "username=user,password=pass").
                  If not provided, defaults to guest access.

Examples:
  1. Local file:
     $ get-iso-file-path Win10_22H2_EnglishInternational_x64.iso
     Output: /mnt/iso/template/iso/Win10_22H2_EnglishInternational_x64.iso

  2. Proxmox storage pool:
     $ get-iso-file-path lvm-iso:Win10_22H2_EnglishInternational_x64.iso
     Output: /mnt/iso/template/iso/Win10_22H2_EnglishInternational_x64.iso

  3. SMB share with guest access:
     $ get-iso-file-path //example.com/share/examplefolder/Win10_22H2_EnglishInternational_x64.iso
     Output: /tmp/repack-iso/examplefolder/Win10_22H2_EnglishInternational_x64.iso

  4. SMB share with authentication:
     $ get-iso-file-path //example.com/share/examplefolder/Win10_22H2_EnglishInternational_x64.iso username=user,password=pass
     Output: /tmp/repack-iso/examplefolder/Win10_22H2_EnglishInternational_x64.iso

  5. Non-existent file:
     $ get-iso-file-path nonexistent.iso
     Error: ISO file 'nonexistent.iso' not found.

Notes:
  - If an SMB share is already mounted, it will be unmounted before remounting.
  - If an ISO file is not found in any known location, an error message is returned.


Here is the test output


Code:
root@proxmox:/mnt/iso/template# get-iso-file-path Win10_22H2_EnglishInternational_x64.iso
/mnt/iso/template/iso/Win10_22H2_EnglishInternational_x64.iso
root@proxmox:/mnt/iso/template# get-iso-file-path /mnt/iso/template/iso/Win10_22H2_EnglishInternational_x64.iso
/mnt/iso/template/iso/Win10_22H2_EnglishInternational_x64.iso
root@proxmox:/mnt/iso/template# get-iso-file-path iso/Win10_22H2_EnglishInternational_x64.iso
/mnt/iso/template/iso/Win10_22H2_EnglishInternational_x64.iso
root@proxmox:/mnt/iso/template# get-iso-file-path lvm-iso:Win10_22H2_EnglishInternational_x64.iso
/mnt/iso/template/iso/Win10_22H2_EnglishInternational_x64.iso
root@proxmox:/mnt/iso/template# get-iso-file-path //shodan.lan/guest/Win10_22H2_EnglishInternational_x64.iso
/tmp/repack-iso/Win10_22H2_EnglishInternational_x64.iso
root@proxmox:/mnt/iso/template# get-iso-file-path "//shodan.lan/share/Win10_22H2_EnglishInternational_x64.iso" "username=user,password=qwerty"
/tmp/repack-iso/Win10_22H2_EnglishInternational_x64.iso
root@proxmox:/mnt/iso/template# get-iso-file-path Win10_22H2_EnglishInternational_x64WRONG.iso
Error: ISO file 'Win10_22H2_EnglishInternational_x64WRONG.iso' not found.
root@proxmox:/mnt/iso/template# get-iso-file-path /mnt/iso/template/iso/Win10_22H2_EnglishInternational_x64WRONG.iso
Error: ISO file '/mnt/iso/template/iso/Win10_22H2_EnglishInternational_x64WRONG.iso' not found.
root@proxmox:/mnt/iso/template# get-iso-file-path iso/Win10_22H2_EnglishInternational_x64WRONG.iso
Error: ISO file 'iso/Win10_22H2_EnglishInternational_x64WRONG.iso' not found.
root@proxmox:/mnt/iso/template# get-iso-file-path lvm-iso:Win10_22H2_EnglishInternational_x64WRONG.iso
Error: ISO file 'lvm-iso:Win10_22H2_EnglishInternational_x64WRONG.iso' not found.
root@proxmox:/mnt/iso/template# get-iso-file-path //shodan.lan/guest/Win10_22H2_EnglishInternational_x64WRONG.iso
Error: File 'Win10_22H2_EnglishInternational_x64WRONG.iso' not found in mounted share.
root@proxmox:/mnt/iso/template# get-iso-file-path "//shodan.lan/share/Win10_22H2_EnglishInternational_x64WRONG.iso" "username=user,password=qwerty"
Error: File 'Win10_22H2_EnglishInternational_x64WRONG.iso' not found in mounted share.
root@proxmox:/mnt/iso/template#


the shell function itself, readable version


Code:
get-iso-file-path() {
    local input_path="$1"
    local smb_options="$2"  # User-provided SMB options (without "-o")
    local sourceiso=""

    # Check if the path is an SMB share (starts with //)
    if [[ "$input_path" == //* ]]; then
        if ! command -v mount.cifs &>/dev/null; then
            echo "Error: mount.cifs not found. Cannot mount SMB share." >&2
            return 1
        fi

        local smb_server_share="$(echo "$input_path" | cut -d'/' -f3,4)"  # Extract //server/share
        local smb_subpath="$(echo "$input_path" | cut -d'/' -f5-)"        # Extract subfolders & filename

        # Unmount if already mounted
        if mountpoint -q /tmp/repack-iso; then
            umount /tmp/repack-iso
        fi

        mkdir -p /tmp/repack-iso

        # Ensure guest mode uses "password=" to prevent password prompts
        if [[ -z "$smb_options" ]]; then
            smb_options="username=guest,password="
        fi

        mount.cifs "//$smb_server_share" /tmp/repack-iso -o "$smb_options" 2>/dev/null || \
        mount.cifs "//$smb_server_share" /tmp/repack-iso -o username=user,password=qwerty 2>/dev/null

        if [ $? -ne 0 ]; then
            echo "Error: Failed to mount SMB share '//$smb_server_share'." >&2
            return 1
        fi

        if [ -f "/tmp/repack-iso/$smb_subpath" ]; then
            echo "/tmp/repack-iso/$smb_subpath"
            return 0
        else
            echo "Error: File '$smb_subpath' not found in mounted share." >&2
            umount /tmp/repack-iso
            return 1
        fi
    fi

    # Check if input is a regular file (absolute or relative)
    if [ -f "$input_path" ]; then
        echo "$(realpath "$input_path")"
        return 0
    fi

    # Check if input is a Proxmox storage path (storage:filename.iso)
    if [[ "$input_path" == *":"* ]]; then
        local storage="${input_path%%:*}"
        local filename="${input_path#*:}"
        local storage_path="$(awk -v s="$storage" '$1 == "dir:" && $2 == s {f=1; next} f && $1 == "path" {print $2 "/template/iso"; exit} f && /^dir:|lvmthin:/ {exit}' /etc/pve/storage.cfg)"

        if [ -n "$storage_path" ] && [ -f "$storage_path/$filename" ]; then
            echo "$storage_path/$filename"
            return 0
        fi
    fi

    # Search all known Proxmox ISO storage paths
    while read -r path; do
        if [ -f "$path/$input_path" ]; then
            echo "$path/$input_path"
            return 0
        fi
    done < <(pvesm status --content iso | awk '$2 == "dir" {print $1}' | while read -r s; do awk -v s="$s" '$1 == "dir:" && $2 == s {f=1; next} f && $1 == "path" {print $2 "/template/iso"; exit} f && /^dir:|lvmthin:/ {exit}' /etc/pve/storage.cfg; done)

    # If no file is found
    echo "Error: ISO file '$input_path' not found." >&2
    return 1
}

oneliner function version

Code:
get-iso-file-path() { local input_path="$1" smb_options="${2:+-o $2}"; if [[ "$input_path" == //* ]]; then command -v mount.cifs &>/dev/null || { echo "Error: mount.cifs not found." >&2; return 1; }; local smb_server_share="$(echo "$input_path" | cut -d'/' -f3,4)"; local smb_subpath="$(echo "$input_path" | cut -d'/' -f5-)"; mountpoint -q /tmp/repack-iso && umount /tmp/repack-iso; mkdir -p /tmp/repack-iso; [[ -z "$smb_options" ]] && smb_options="-o username=guest,password="; mount.cifs "//$smb_server_share" /tmp/repack-iso $smb_options 2>/dev/null || mount.cifs "//$smb_server_share" /tmp/repack-iso -o username=user,password=qwerty 2>/dev/null || { echo "Error: Failed to mount SMB share '//$smb_server_share'." >&2; return 1; }; [ -f "/tmp/repack-iso/$smb_subpath" ] && echo "/tmp/repack-iso/$smb_subpath" && return 0 || { echo "Error: File '$smb_subpath' not found in mounted share." >&2; umount /tmp/repack-iso; return 1; }; fi; [ -f "$input_path" ] && echo "$(realpath "$input_path")" && return 0; if [[ "$input_path" == *":"* ]]; then local storage="${input_path%%:*}" filename="${input_path#*:}"; local storage_path="$(awk -v s="$storage" '$1 == "dir:" && $2 == s {f=1; next} f && $1 == "path" {print $2 "/template/iso"; exit} f && /^dir:|lvmthin:/ {exit}' /etc/pve/storage.cfg)"; [ -n "$storage_path" ] && [ -f "$storage_path/$filename" ] && echo "$storage_path/$filename" && return 0; fi; while read -r path; do [ -f "$path/$input_path" ] && echo "$path/$input_path" && return 0; done < <(pvesm status --content iso | awk '$2 == "dir" {print $1}' | while read -r s; do awk -v s="$s" '$1 == "dir:" && $2 == s {f=1; next} f && $1 == "path" {print $2 "/template/iso"; exit} f && /^dir:|lvmthin:/ {exit}' /etc/pve/storage.cfg; done); echo "Error: ISO file '$input_path' not found." >&2; return 1; }
Thank you for posting this, this seems very useful. I attempted to write my own little script to do this but your solution seems to be more effective. :)
 
Other than parsing /etc/pve/storage.cfg ?
To avoid parsing config files, you can also use the Proxmox VE API, which exposes all of this in an independent way.
With this, you can combine pvesh and jq to retrieve all data and filter it.

E.g. to get all possible ISO paths:
Code:
pvesh get /storage --output-format json  | jq '.[] | select(.content | contains("iso")) | .path'
 
  • Like
Reactions: Kingneutron
Thank you cheiss this is exactly what I needed !

example

Code:
root@proxmox:~# pvesh get /storage
┌─────────────────┐
│ storage         │
╞═════════════════╡
│ local           │
├─────────────────┤
│ local-14tb-lvm  │
├─────────────────┤
│ local-lvm       │
├─────────────────┤
│ lvm-ct-template │
├─────────────────┤
│ lvm-iso         │
└─────────────────┘
root@proxmox:~# pvesh get /storage --output-format json
[{"content":"rootdir,images","digest":"a5a61dbd61ee0116a9e96b658e7db154872747d5","storage":"local-lvm","thinpool":"data","type":"lvmthin","vgname":"pve"},{"content":"backup","digest":"a5a61dbd61ee0116a9e96b658e7db154872747d5","path":"/var/lib/vz","shared":0,"storage":"local","type":"dir"},{"content":"rootdir,images","digest":"a5a61dbd61ee0116a9e96b658e7db154872747d5","nodes":"proxmox","storage":"local-14tb-lvm","thinpool":"thinlv","type":"lvmthin","vgname":"thinvg"},{"content":"iso","digest":"a5a61dbd61ee0116a9e96b658e7db154872747d5","path":"/mnt/iso","prune-backups":"keep-all=1","shared":0,"storage":"lvm-iso","type":"dir"},{"content":"vztmpl","digest":"a5a61dbd61ee0116a9e96b658e7db154872747d5","path":"/mnt/ct-template","prune-backups":"keep-all=1","shared":0,"storage":"lvm-ct-template","type":"dir"}]
root@proxmox:~# pvesh get /storage --output-format json  | jq '.[] | select(.content | contains("iso")) | .path'
"/mnt/iso"
root@proxmox:~#
 
  • Like
Reactions: cheiss