Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSError: [Errno 13] Permission denied when executed as snapbtr #8

Closed
elumbella opened this issue Apr 11, 2019 · 2 comments
Closed

OSError: [Errno 13] Permission denied when executed as snapbtr #8

elumbella opened this issue Apr 11, 2019 · 2 comments

Comments

@elumbella
Copy link

elumbella commented Apr 11, 2019

I followed the instructions to install the script. I am able to execute the script with sudo as my regular user but it won't work when logged in as snapbtr. The output is

[snapbtr@rob-thinkpad ~]$ sudo /bin/snapbtrex.py --path /mnt/.snapshots/ --snap /home
Traceback (most recent call last):
  File "/usr/bin/snapbtrex.py", line 922, in <module>
    sys.exit(main(sys.argv))
  File "/usr/bin/snapbtrex.py", line 892, in main
    operations.snap(path=pa.snap)
  File "/usr/bin/snapbtrex.py", line 313, in snap
    self.check_call(args)
  File "/usr/bin/snapbtrex.py", line 268, in check_call
    shell=shell)
  File "/usr/lib/python2.7/subprocess.py", line 394, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child
    raise child_exception
OSError: [Errno 13] Permission denied

I tried creating a snapshot using "btrfs subvolume create", which works fine, however "btrfs subvolume delete" doesn't, it also throws "Operation not permitted". Maybe this has something to do with it?

@yoshtec
Copy link
Owner

yoshtec commented Apr 13, 2019

Hi this sounds like the sudoers file is not correct did you check if the line:
snapbtr ALL=(root:nobody) NOPASSWD:NOEXEC: /bin/btrfs subvolume*
does exist?
Please check where the btrfs tools are via which btrfs it may point to /sbin/btrfsthen you'll have to alter the sudoers file accordingly.

The script uses the snapshot subcommand sudo btrfs subvolume snapshot -r /home /mnt/.snapshot/TIMESTAMP

@elumbella
Copy link
Author

I played around with it some more. I then realized, that running snapbtrex.py using sudo was the issue. Running it directly works fine. You might want to edit that in your readme. Thanks for your support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants