Mount a disk on lxd

i running lxd 4.4 (snap version)
i set snap set lxd shiftfs.enable = true and restart lxd service then
lxc config device add “mycontainer” backup disk source =/mnt/backup path=/backup shift=true
there is a 1TB disk when i login to container i show there is 304 G avail and 603 G used.
i never use it. and there is no file in this disk. container host says also there is a 630 used.
df .h show
/var/snap/lxd/common/lxd/devices/river/disk.Backup.Backup 984G 630G 304G 68% /Backup
but directory
/var/snap/lxd/common/lxd/devices/river/ not exists.
and ls -l /var/snap/lxd/common/lxd/devices is empty.

What that shows is that you have /mnt/backup from your host mounted at /backup in your container as requested.

On Linux, the disk usage is tracked on a per filesystem basis, so the 68% usage you’re seeing most likely means that the disk on your host that is backing /mnt/backup is currently used at 68%.

i mount 1 TB disk in cintainer host then via shift… add this device to my container and mount it on /Backup
but what i can see in my container i have /var/snap…/
lok like in this container is installed a lxd.

Show df -h /mnt/backup on the host

in host
df -h /mnt/Backup
Filesystem Size Used Avail Use% Mounted on
/dev/xvda2 984G 630G 304G 68% /

on container

df -h /Backup/
Filesystem Size Used Avail Use% Mounted on
/var/snap/lxd/common/lxd/devices/river/disk.Backup.Backup 984G 630G 304G 68% /Backup

Ok, so what’s the problem exactly?
As expected, you see the same amount of usage of the drive inside and outside of the container.

disk is one TB and i don’t have any file son it why they show 68% is in used?

On the host, do:

  • mkdir /tmp/test
  • mount /dev/xvda2 /tmp/test
  • ls -lah /tmp/test
  • umount /tmp/test

ok i don’t read your first entry correct. i understand know. thanks