1

Context

I'm setting up ZFS autobackup on my home server for offsite backups. All commands printed below are run as non-root.

Problem

A 'permission denied' error arises originating from the target machine when the following command is issued:

(zfs send --large-block --embed --raw --verbose --parsable --props \
 -i @previous_snap localpool/mydataset@newest_snap) | \
(ssh ostsite 'zfs recv -u -o canmount=noauto -v -s \
remotepool/myserver/localpool/mydataset')

Full command output:

incremental localpool/mydataset@previous_snap   localpool/mydataset@newest_snap 624
size    624
receiving incremental stream of localpool/mydataset@newest_snap into     remotepool/myserver/localpool/mydataset@newest_snap
received 1.31K stream in 1 seconds (1.31K/sec)
cannot set property for 'remotepool/myserver/localpool/mydataset': permission denied

Findings so far

ZFS doesn't explicitly say which property cannot be set, but the only one I'm requesting to be set is canmount=noauto. On the target machine, I've delegated some zfs permissions to the receiving user:

sudo zfs allow myuser snapshot,receive,create,mountpoint,mount,userprop remotepool/myserver

And when I manually execute zfs set canmount=noauto remotepool/myserver/localpool/mydataset, this succeeds.

Questions

  1. How can I see which property cannot be set?
  2. How can I allow this property to be set (at recv-time)?
Ostheer
  • 11
  • 3
  • *And when I manually execute `zfs set canmount=noauto remotepool/myserver/localpool/mydataset`, this succeeds.* Are you running that as `root`, or as a normal user? What user are you using to send/receive the snapshots? – Andrew Henle Jul 28 '23 at 21:47
  • @AndrewHenle I've updated the question. the `zfs set` command succeeds as a regular user. The send and receive commands are also issued by regular users. – Ostheer Jul 28 '23 at 21:49
  • I'm pretty sure that low level filesystem operations require root or at least specific elevated rights. – paladin Aug 03 '23 at 15:26
  • @paladin hmm. But then I'm confused as to why it works when I manually execute `zfs set canmount ...` (as a regular user with appropriate zfs delegation). – Ostheer Aug 15 '23 at 17:50

0 Answers0