Get all paths of disk-device mounts

I want to get all paths of disk-device mounts from a container.

I’m currently doing:

local -a DEVICES
local -a TYPE
local -a MOUNTS

# Get all devices of the container
mapfile -t DEVICES < <(${LXC} config device list ${CONTAINER} | sort)
# Now get type of each device
mapfile -t TYPE < <(printf "%s\n" "${DEVICES[@]}" | xargs -i ${LXC} config device get ${CONTAINER} {} type)
# Get path of each disk device
mapfile -t MOUNTS < <((for ((i=0; i<${#DEVICES[@]}; i++)); do
	printf '%s %s\n' "${DEVICES[i]}" "${TYPE[i]}"
done) | grep disk | sed -e "s/[[:space:]]disk//" | xargs -i ${LXC} config device get ${CONTAINER} {} path)

echo ${MOUNTS[@]}

Is there a faster an more elegant way to do this?



lxc query /1.0/containers/NAME | jq '.expanded_devices | with_entries(select(.value.type == "disk")) | .[].path'