Permission issue for storage volume in lxd

we created container and created storage volume using below commands
Created zfs storage pool using sudo zpool create disk2_pool /dev/sdb

->sudo lxc launch ubuntu:20.04 etcd-1
Creating etcd-1
Starting etcd-1
->sudo lxc storage volume create local etcd-storage size=200GB
Storage volume etcd-storage created
->sudo lxc config device add etcd-1 test-storage disk source=/disk2_pool path=/dev/etcd
Device etcd-storage added to etcd-1

->sudo lxc exec etcd-1 bash
after entered into container ,Try to create directory and one file but is showing permission issue like below
root@etcd-1:/dev/etcd# mkdir a
mkdir: cannot create directory ‘a’: Permission denied
root@etcd-1:/dev/etcd# sudo mkdir a
mkdir: cannot create directory ‘a’: Permission denied
root@etcd-1:/dev/etcd# sudo touch a
touch: cannot touch ‘a’: Permission denied

That etcd folder owner is nobody ,nogroup
4 drwxr-xr-x 2 nobody nogroup 4096 Jan 18 12:19 etcd
Try to change owner but unable to change…How to fix it,Please help on this

You need to add the shift option when adding the device:

lxc config device add etcd-1 test-storage disk source=/disk2_pool path=/dev/etcd shift=true

Tried but it is giving below error

sudo lxc config device add etcd-1 test-storage disk source=/disk2_pool path=/dev/etcd shift=true
Error: Failed to start device “test-storage”: shiftfs is required by disk entry but isn’t supported on system

Right. You need to enable it in the snap first. Here’s how to do it:

sudo snap set lxd shiftfs.enable=true
sudo systemctl reload snap.lxd.daemon

ok,Thanks
Will try