Mount disk: permission denied
by gustav3000 from LinuxQuestions.org on (#5NVAM)
I'm unable to write anything to /var/cache/distfiles directory.
Code:gentoo1 ~ # touch /var/cache/distfiles/abc
touch: cannot touch '/var/cache/distfiles/abc': Permission deniedMy container config:
Code:### This is a YAML representation of the configuration.
### Any line starting with a '# will be ignored.
###
### A sample configuration looks like:
### name: instance1
### profiles:
### - default
### config:
### volatile.eth0.hwaddr: 00:16:3e:e9:f8:7f
### devices:
### homedir:
### path: /extra
### source: /home/user
### type: disk
### ephemeral: false
###
### Note that the name is shown but cannot be changed
architecture: x86_64
config:
image.architecture: amd64
image.description: Gentoo current amd64 (20210821_16:07)
image.os: Gentoo
image.release: current
image.serial: "20210821_16:07"
image.type: squashfs
image.variant: default
volatile.base_image: df34d189eb4eb7224156b35f05c461afef5ac550eb3cc70ce2618dd7740a27ef
volatile.eth0.host_name: veth3e12b0b5
volatile.eth0.hwaddr: 00:16:3e:4d:df:70
volatile.idmap.base: "0"
volatile.idmap.current: '[{"Isuid":true,"Isgid":false,"Hostid":1000000,"Nsid":0,"Maprange":1000000000},{"Isuid":false,"Isgid":true,"Hostid":1000000,"Nsid":0,"Maprange":1000000000}]'
volatile.idmap.next: '[{"Isuid":true,"Isgid":false,"Hostid":1000000,"Nsid":0,"Maprange":1000000000},{"Isuid":false,"Isgid":true,"Hostid":1000000,"Nsid":0,"Maprange":1000000000}]'
volatile.last_state.idmap: '[{"Isuid":true,"Isgid":false,"Hostid":1000000,"Nsid":0,"Maprange":1000000000},{"Isuid":false,"Isgid":true,"Hostid":1000000,"Nsid":0,"Maprange":1000000000}]'
volatile.last_state.power: RUNNING
volatile.uuid: 2dde94a6-4c75-42d7-a0c9-c3f5e8588738
devices:
distfiles:
path: /var/cache/distfiles/
source: /var/cache/distfiles/
type: disk
ephemeral: false
profiles:
- default
stateful: false
description: ""Directory /var/cache/distfiles is owned by portage user and group on the host.
I have distfiles directory mounted at rpool/ROOT/distfiles. Any ideas how to get r/w access to that directory inside the LXD container? What do you think about adding portage user, group to /etc/subuid and /etc/subgid? Directory /var/cache/distfiles is owned by portage : portage.
Code:gentoo1 ~ # touch /var/cache/distfiles/abc
touch: cannot touch '/var/cache/distfiles/abc': Permission deniedMy container config:
Code:### This is a YAML representation of the configuration.
### Any line starting with a '# will be ignored.
###
### A sample configuration looks like:
### name: instance1
### profiles:
### - default
### config:
### volatile.eth0.hwaddr: 00:16:3e:e9:f8:7f
### devices:
### homedir:
### path: /extra
### source: /home/user
### type: disk
### ephemeral: false
###
### Note that the name is shown but cannot be changed
architecture: x86_64
config:
image.architecture: amd64
image.description: Gentoo current amd64 (20210821_16:07)
image.os: Gentoo
image.release: current
image.serial: "20210821_16:07"
image.type: squashfs
image.variant: default
volatile.base_image: df34d189eb4eb7224156b35f05c461afef5ac550eb3cc70ce2618dd7740a27ef
volatile.eth0.host_name: veth3e12b0b5
volatile.eth0.hwaddr: 00:16:3e:4d:df:70
volatile.idmap.base: "0"
volatile.idmap.current: '[{"Isuid":true,"Isgid":false,"Hostid":1000000,"Nsid":0,"Maprange":1000000000},{"Isuid":false,"Isgid":true,"Hostid":1000000,"Nsid":0,"Maprange":1000000000}]'
volatile.idmap.next: '[{"Isuid":true,"Isgid":false,"Hostid":1000000,"Nsid":0,"Maprange":1000000000},{"Isuid":false,"Isgid":true,"Hostid":1000000,"Nsid":0,"Maprange":1000000000}]'
volatile.last_state.idmap: '[{"Isuid":true,"Isgid":false,"Hostid":1000000,"Nsid":0,"Maprange":1000000000},{"Isuid":false,"Isgid":true,"Hostid":1000000,"Nsid":0,"Maprange":1000000000}]'
volatile.last_state.power: RUNNING
volatile.uuid: 2dde94a6-4c75-42d7-a0c9-c3f5e8588738
devices:
distfiles:
path: /var/cache/distfiles/
source: /var/cache/distfiles/
type: disk
ephemeral: false
profiles:
- default
stateful: false
description: ""Directory /var/cache/distfiles is owned by portage user and group on the host.
I have distfiles directory mounted at rpool/ROOT/distfiles. Any ideas how to get r/w access to that directory inside the LXD container? What do you think about adding portage user, group to /etc/subuid and /etc/subgid? Directory /var/cache/distfiles is owned by portage : portage.