I installed PBS in an unprivileged Container.
The HDD I want to use for the backup is mounted on the host
I created a directory
Then I added the UID/GID mapping for the "backup" user in
And added
Now my mountpoint in PBS looks like this:
When I try to create the datastore as root I get an error:
Also as root it is not possible to ls
When I remove the UID/GID mappings the ls command works, but then I can not access the mounted directory.
The HDD I want to use for the backup is mounted on the host
Code:
cat /etc/fstab
...
LABEL="Backup_Proxmox" /mnt/backup/ ext4 defaults 0 2
I created a directory
/mnt/backup/pbs/store1
on the HDD, changed the permission to backup:backup
and mounted it in the container
Code:
ls -la /mnt/backup/pbs/
total 12
drwxr-xr-x 3 root root 4096 Oct 16 08:19 .
drwxr-xr-x 7 guido root 4096 Oct 16 08:12 ..
drwxr-xr-x 2 backup backup 4096 Oct 16 14:11 store1
Code:
pct set 102 -mp0 /mnt/backup/pbs/store1,mp=/backup/store1
Then I added the UID/GID mapping for the "backup" user in
/etc/pve/lxc/102.conf
Code:
lxc.idmap: u 0 100000 34
lxc.idmap: u 34 34 1
lxc.idmap: u 35 100035 65501
lxc.idmap: g 0 100000 34
lxc.idmap: g 34 34 1
lxc.idmap: g 35 100035 65501
And added
root:34:1
to /etc/subuid
and /etc/subgid
Now my mountpoint in PBS looks like this:
Code:
ls -la /backup
total 13
drwxr-xr-x 3 root root 3 Oct 16 06:30 .
drwxr-xr-x 18 root root 24 Oct 16 13:26 ..
drwxr-xr-x 2 backup backup 4096 Oct 16 12:11 store1
When I try to create the datastore as root I get an error:
Code:
proxmox-backup-manager datastore create store1 /backup/store1
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: unable to read "/etc/proxmox-backup/authkey.key" - Permission denied (os error 13)', src/auth_helpers.rs:182:65
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Also as root it is not possible to ls
Code:
root@pbs:/backup# ls -la /etc/proxmox-backup/authkey.key
ls: cannot access '/etc/proxmox-backup/authkey.key': Permission denied
When I remove the UID/GID mappings the ls command works, but then I can not access the mounted directory.