Skip to content

Copied storage volumes don't keep the same permissions as the original #2354

@Obirvalger

Description

@Obirvalger

Is there an existing issue for this?

  • There is no existing issue for this bug

Is this happening on an up to date version of Incus?

  • This is happening on a supported version of Incus

Incus system details

api_status: stable
api_version: "1.0"
auth: trusted
public: false
auth_methods:
- tls
auth_user_name: test
auth_user_method: unix
environment:
  addresses: []
  architectures:
  - x86_64
  - i686
  certificate: |
    -----BEGIN CERTIFICATE-----
    MIICDzCCAZWgAwIBAgIQe9QnHdy2Do7d42nN/WgJ+zAKBggqhkjOPQQDAzA3MRkw
    FwYDVQQKExBMaW51eCBDb250YWluZXJzMRowGAYDVQQDDBFyb290QGluY3VzLXVi
    dW50dTAeFw0yNTA4MDYxNjE2MzFaFw0zNTA4MDQxNjE2MzFaMDcxGTAXBgNVBAoT
    EExpbnV4IENvbnRhaW5lcnMxGjAYBgNVBAMMEXJvb3RAaW5jdXMtdWJ1bnR1MHYw
    EAYHKoZIzj0CAQYFK4EEACIDYgAEIxjVJOSs6LNup0QfEFE0NGEVusw3Dqos6aYs
    MPrCDSYL0OqM8YWhj9JVNX35wfm8DTUgX6S9i8kn4zmu1w2lp2Wf5GDs9MrKF8QX
    F+6KzCUTRvk/nQmjAOaqvqSZ8eJPo2YwZDAOBgNVHQ8BAf8EBAMCBaAwEwYDVR0l
    BAwwCgYIKwYBBQUHAwEwDAYDVR0TAQH/BAIwADAvBgNVHREEKDAmggxpbmN1cy11
    YnVudHWHBH8AAAGHEAAAAAAAAAAAAAAAAAAAAAEwCgYIKoZIzj0EAwMDaAAwZQIw
    Y9mQqdB/4gKtOzNEUfsW9TeWFS5OFOOMUfudAIyDej1BO342eO+C+hzXbkW93mqC
    AjEAqyaKPLX/XFUexEDkj94H8m/FFkI7KTyQ1zgj4p16kMOORLwksxzYbZQEvThm
    vbzp
    -----END CERTIFICATE-----
  certificate_fingerprint: d054974a13c46293e95a4cb8536ed90a93b1f07d4697760088ca67420030e08c
  driver: lxc | qemu
  driver_version: 6.0.3 | 9.2.1
  firewall: nftables
  kernel: Linux
  kernel_architecture: x86_64
  kernel_features:
    idmapped_mounts: "true"
    netnsid_getifaddrs: "true"
    seccomp_listener: "true"
    seccomp_listener_continue: "true"
    uevent_injection: "true"
    unpriv_binfmt: "true"
    unpriv_fscaps: "true"
  kernel_version: 6.14.0-24-generic
  lxc_features:
    cgroup2: "true"
    core_scheduling: "true"
    devpts_fd: "true"
    idmapped_mounts_v2: "true"
    mount_injection_file: "true"
    network_gateway_device_route: "true"
    network_ipvlan: "true"
    network_l2proxy: "true"
    network_phys_macvlan_mtu: "true"
    network_veth_router: "true"
    pidfd: "true"
    seccomp_allow_deny_syntax: "true"
    seccomp_notify: "true"
    seccomp_proxy_send_notify_fd: "true"
  os_name: Ubuntu
  os_version: "25.04"
  project: default
  server: incus
  server_clustered: false
  server_event_mode: full-mesh
  server_name: incus-ubuntu
  server_pid: 4393
  server_version: 6.0.3
  storage: dir
  storage_version: "1"
  storage_supported_drivers:
  - name: btrfs
    version: "6.12"
    remote: false
  - name: dir
    version: "1"
    remote: false
  - name: lvm
    version: 2.03.27(2) (2024-10-02) / 1.02.201 (2024-10-02) / 4.49.0
    remote: false
  - name: lvmcluster
    version: 2.03.27(2) (2024-10-02) / 1.02.201 (2024-10-02) / 4.49.0
    remote: true

Instance details

No response

Instance log

No response

Current behavior

When using the incus storage volume copy command to copy a storage volume, the destination volume ends up with different permissions than the source one.

Expected behavior

The destination volume should have identical permissions to the source volume.

Steps to reproduce

# Create a volume
incus storage volume create default origin-volume

# Change the volume permissions with a container
incus init images:debian/13 chmoder
incus config device add chmoder origin-volume disk path=/mnt/vol pool=default source=origin-volume
incus start chmoder
incus exec chmoder -- chmod a+r /mnt/vol

# Copy the volume
incus storage volume copy default/origin-volume default/copy-volume

# Show different permissions
ls /var/lib/incus/storage-pools/default/custom/default_origin-volume/ -ld
ls /var/lib/incus/storage-pools/default/custom/default_copy-volume/ -ld

Metadata

Metadata

Assignees

Labels

EasyGood for new contributors

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions