Rclone mount "write error: Operation not permitted"

What is the problem you are having with rclone?

i am trying to create a backup of my raspberry pi to the remote with this GitHub - tom-2015/imgclone: alternative program for piclone to create a backup of your SD card to a .IMG file. i tried using --vfs-cache-mode=full but am getting space issue hence am trying to directly write to the remote without cache. i'm getting permission issue while running the commands. tried running some simple command. some worked and some are not working with permission error.i think it is issue with my rclone mount config,or i am trying to do something that is unsupported. appreciate if someone could share their inputs on this. i will be running the command via sudo btw.

touch test.txt -working fine, even with sudo
cp / mv command - working fine with sudo
nano /mnt/onedrive/file.txt - able to edit it directly
echo "test" >> /mnt/onedrive/file.txt - write error: Illegal seek, same error with sudo
sudo backup command- Operation not permitted

Run the command 'rclone version' and share the full output of the command.

rclone
rclone v1.57.0

  • os/version: raspbian 11.2 (64 bit)
  • os/kernel: 5.10.92-v8+ (aarch64)
  • os/type: linux
  • os/arch: arm64
  • go/version: go1.17.2
  • go/linking: static
  • go/tags: none

Which cloud storage system are you using? (eg Google Drive)

Onedrive

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone mount --daemon --allow-root --allow-other --umask=000 onedrive:testing /mnt/onedrive/ 

The rclone config contents with secrets removed.

[onedrive]
type = onedrive
token = {"access_token":"token"}
drive_id = id
drive_type = business

A log from the command with the -vv flag

rclone mount --daemon --allow-root --allow-other --umask=000 onedrive:testing /mnt/onedrive/ -vv
2022/02/01 13:35:24 DEBUG : rclone: Version "v1.57.0" starting with parameters ["rclone" "mount" "--daemon" "--allow-root" "--allow-other" "--umask=000" "onedrive:testing" "/mnt/onedrive/" "-vv"]
2022/02/01 13:35:24 DEBUG : Creating backend with remote "onedrive:testing"
2022/02/01 13:35:24 DEBUG : Using config file from "/home/pi/.config/rclone/rclone.conf"
2022/02/01 13:35:27 DEBUG : rclone: Version "v1.57.0" finishing with parameters ["/usr/bin/rclone" "mount" "--daemon" "--allow-root" "--allow-other" "--umask=000" "onedrive:testing" "/mnt/onedrive/" "-vv"]

Can you add --log-file /tmp/rclone.log to this command, then look in the log file after attempting the backup. This should give some more clues!

2022/02/01 22:50:39 DEBUG : rclone: Version "v1.57.0" starting with parameters ["rclone" "mount" "--daemon" "--allow-root" "--allow-other" "--umask=000" "--log-file=/tmp/rclone.log" "-vv" "salim-onedrive:testing" "/mnt/onedrive/"]
2022/02/01 22:50:39 DEBUG : Creating backend with remote "salim-onedrive:testing"
2022/02/01 22:50:39 DEBUG : Using config file from "/home/pi/.config/rclone/rclone.conf"
2022/02/01 22:50:41 DEBUG : rclone: Version "v1.57.0" starting with parameters ["/usr/bin/rclone" "mount" "--daemon" "--allow-root" "--allow-other" "--umask=000" "--log-file=/tmp/rclone.log" "-vv" "salim-onedrive:testing" "/mnt/onedrive/"]
2022/02/01 22:50:41 DEBUG : Creating backend with remote "salim-onedrive:testing"
2022/02/01 22:50:41 DEBUG : Using config file from "/home/pi/.config/rclone/rclone.conf"
2022/02/01 22:50:42 INFO : One drive root 'testing': poll-interval is not supported by this remote
2022/02/01 22:50:42 NOTICE: One drive root 'testing': --vfs-cache-mode writes or full is recommended for this remote as it can't stream
2022/02/01 22:50:42 DEBUG : One drive root 'testing': Mounting on "/mnt/onedrive/"
2022/02/01 22:50:42 ERROR : Ignoring --allow-root. Support has been removed upstream - see AllowRoot doesn't work · Issue #144 · bazil/fuse · GitHub for more info
2022/02/01 22:50:42 DEBUG : : Root:
2022/02/01 22:50:42 DEBUG : : >Root: node=/, err=
2022/02/01 22:50:42 DEBUG : rclone: Version "v1.57.0" finishing with parameters ["/usr/bin/rclone" "mount" "--daemon" "--allow-root" "--allow-other" "--umask=000" "--log-file=/tmp/rclone.log" "-vv" "salim-onedrive:testing" "/mnt/onedrive/"]
2022/02/01 22:51:05 DEBUG : /: Attr:
2022/02/01 22:51:05 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxrwx, err=
2022/02/01 22:51:08 DEBUG : /: Attr:
2022/02/01 22:51:08 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxrwx, err=
2022/02/01 22:51:10 DEBUG : /: Attr:
2022/02/01 22:51:10 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxrwx, err=
2022/02/01 22:51:10 DEBUG : /: ReadDirAll:
2022/02/01 22:51:11 DEBUG : /: >ReadDirAll: item=16, err=
2022/02/01 22:51:11 DEBUG : /: Lookup: name="c1.txt"
2022/02/01 22:51:11 DEBUG : /: >Lookup: node=c1.txt, err=
2022/02/01 22:51:11 DEBUG : c1.txt: Attr:
2022/02/01 22:51:11 DEBUG : c1.txt: >Attr: a=valid=1s ino=0 size=0 mode=-rw-rw-rw-, err=
2022/02/01 22:51:11 DEBUG : /: Lookup: name="code.txt"
2022/02/01 22:51:11 DEBUG : /: >Lookup: node=code.txt, err=
2022/02/01 22:51:11 DEBUG : code.txt: Attr:
2022/02/01 22:51:11 DEBUG : code.txt: >Attr: a=valid=1s ino=0 size=659 mode=-rw-rw-rw-, err=
2022/02/01 22:51:11 DEBUG : /: Lookup: name="file.txt"
2022/02/01 22:51:11 DEBUG : /: >Lookup: node=file.txt, err=
2022/02/01 22:51:11 DEBUG : file.txt: Attr:
2022/02/01 22:51:11 DEBUG : file.txt: >Attr: a=valid=1s ino=0 size=0 mode=-rw-rw-rw-, err=
2022/02/01 22:51:11 DEBUG : /: Lookup: name="mod1"
2022/02/01 22:51:11 DEBUG : /: >Lookup: node=mod1/, err=
2022/02/01 22:51:11 DEBUG : mod1/: Attr:
2022/02/01 22:51:11 DEBUG : mod1/: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxrwx, err=
2022/02/01 22:51:11 DEBUG : /: Lookup: name="normal.txt"
2022/02/01 22:51:11 DEBUG : /: >Lookup: node=normal.txt, err=
2022/02/01 22:51:11 DEBUG : normal.txt: Attr:
2022/02/01 22:51:11 DEBUG : normal.txt: >Attr: a=valid=1s ino=0 size=0 mode=-rw-rw-rw-, err=
2022/02/01 22:51:11 DEBUG : /: Lookup: name="t.t"
2022/02/01 22:51:11 DEBUG : /: >Lookup: node=t.t, err=
2022/02/01 22:51:11 DEBUG : t.t: Attr:
2022/02/01 22:51:11 DEBUG : t.t: >Attr: a=valid=1s ino=0 size=15 mode=-rw-rw-rw-, err=
2022/02/01 22:51:11 DEBUG : /: Lookup: name="tes.img"
2022/02/01 22:51:11 DEBUG : /: >Lookup: node=tes.img, err=
2022/02/01 22:51:11 DEBUG : tes.img: Attr:
2022/02/01 22:51:11 DEBUG : tes.img: >Attr: a=valid=1s ino=0 size=0 mode=-rw-rw-rw-, err=
2022/02/01 22:51:11 DEBUG : /: Lookup: name="test.img"
2022/02/01 22:51:11 DEBUG : /: >Lookup: node=test.img, err=
2022/02/01 22:51:11 DEBUG : test.img: Attr:
2022/02/01 22:51:11 DEBUG : test.img: >Attr: a=valid=1s ino=0 size=0 mode=-rw-rw-rw-, err=
2022/02/01 22:51:11 DEBUG : /: Lookup: name="test.log"
2022/02/01 22:51:11 DEBUG : /: >Lookup: node=test.log, err=
2022/02/01 22:51:11 DEBUG : test.log: Attr:
2022/02/01 22:51:11 DEBUG : test.log: >Attr: a=valid=1s ino=0 size=640 mode=-rw-rw-rw-, err=
2022/02/01 22:51:11 DEBUG : /: Lookup: name="test.txt"
2022/02/01 22:51:11 DEBUG : /: >Lookup: node=test.txt, err=
2022/02/01 22:51:11 DEBUG : test.txt: Attr:
2022/02/01 22:51:11 DEBUG : test.txt: >Attr: a=valid=1s ino=0 size=0 mode=-rw-rw-rw-, err=
2022/02/01 22:51:11 DEBUG : /: Lookup: name="test1.txt"
2022/02/01 22:51:11 DEBUG : /: >Lookup: node=test1.txt, err=
2022/02/01 22:51:11 DEBUG : test1.txt: Attr:
2022/02/01 22:51:11 DEBUG : test1.txt: >Attr: a=valid=1s ino=0 size=0 mode=-rw-rw-rw-, err=
2022/02/01 22:51:11 DEBUG : /: Lookup: name="test2"
2022/02/01 22:51:11 DEBUG : /: >Lookup: node=test2/, err=
2022/02/01 22:51:11 DEBUG : test2/: Attr:
2022/02/01 22:51:11 DEBUG : test2/: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxrwx, err=
2022/02/01 22:51:11 DEBUG : /: Lookup: name="tt.tt"
2022/02/01 22:51:11 DEBUG : /: >Lookup: node=tt.tt, err=
2022/02/01 22:51:11 DEBUG : tt.tt: Attr:
2022/02/01 22:51:11 DEBUG : tt.tt: >Attr: a=valid=1s ino=0 size=10 mode=-rw-rw-rw-, err=
2022/02/01 22:51:11 DEBUG : /: Lookup: name="tt.tt1"
2022/02/01 22:51:11 DEBUG : /: >Lookup: node=tt.tt1, err=
2022/02/01 22:51:11 DEBUG : tt.tt1: Attr:
2022/02/01 22:51:11 DEBUG : tt.tt1: >Attr: a=valid=1s ino=0 size=10 mode=-rw-rw-rw-, err=
2022/02/01 22:51:51 DEBUG : /: Lookup: name="tt.tt"
2022/02/01 22:51:51 DEBUG : /: >Lookup: node=tt.tt, err=
2022/02/01 22:51:51 DEBUG : tt.tt: Attr:
2022/02/01 22:51:51 DEBUG : tt.tt: >Attr: a=valid=1s ino=0 size=10 mode=-rw-rw-rw-, err=
2022/02/01 22:51:51 DEBUG : tt.tt: Open: flags=OpenWriteOnly+OpenAppend+0x20000
2022/02/01 22:51:51 DEBUG : tt.tt: Open: flags=O_WRONLY|O_APPEND|0x20000
2022/02/01 22:51:51 DEBUG : tt.tt: >Open: fd=tt.tt (w), err=
2022/02/01 22:51:51 DEBUG : tt.tt: >Open: fh=&{tt.tt (w)}, err=
2022/02/01 22:51:51 DEBUG : &{tt.tt (w)}: Flush:
2022/02/01 22:51:51 DEBUG : tt.tt: WriteFileHandle.Flush unwritten handle, writing 0 bytes to avoid race conditions
2022/02/01 22:51:51 ERROR : tt.tt: WriteFileHandle: Can't open for write without O_TRUNC on existing file without --vfs-cache-mode >= writes
2022/02/01 22:51:51 DEBUG : &{tt.tt (w)}: >Flush: err=operation not permitted
2022/02/01 22:51:51 DEBUG : &{tt.tt (w)}: Write: len=20, offset=10
2022/02/01 22:51:51 DEBUG : tt.tt: waiting for in-sequence write to 10 for 1s
2022/02/01 22:51:52 DEBUG : tt.tt: aborting in-sequence write wait, off=10
2022/02/01 22:51:52 DEBUG : tt.tt: failed to wait for in-sequence write to 10
2022/02/01 22:51:52 ERROR : tt.tt: WriteFileHandle.Write: can't seek in file without --vfs-cache-mode >= writes
2022/02/01 22:51:52 DEBUG : &{tt.tt (w)}: >Write: written=0, err=illegal seek
2022/02/01 22:51:52 DEBUG : &{tt.tt (w)}: Flush:
2022/02/01 22:51:52 DEBUG : tt.tt: WriteFileHandle.Flush unwritten handle, writing 0 bytes to avoid race conditions
2022/02/01 22:51:52 ERROR : tt.tt: WriteFileHandle: Can't open for write without O_TRUNC on existing file without --vfs-cache-mode >= writes
2022/02/01 22:51:52 DEBUG : &{tt.tt (w)}: >Flush: err=operation not permitted
2022/02/01 22:51:52 DEBUG : &{tt.tt (w)}: Release:
2022/02/01 22:51:52 DEBUG : tt.tt: WriteFileHandle.Release closing
2022/02/01 22:51:52 DEBUG : &{tt.tt (w)}: >Release: err=
2022/02/01 22:52:08 DEBUG : /: Attr:
2022/02/01 22:52:08 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxrwx, err=
2022/02/01 22:52:08 DEBUG : /: Lookup: name="salim-onedrive:testing"
2022/02/01 22:52:08 DEBUG : /: >Lookup: node=, err=no such file or directory
2022/02/01 22:52:08 DEBUG : : Statfs:
2022/02/01 22:52:09 DEBUG : : >Statfs: stat={Blocks:1317011456 Bfree:1171648779 Bavail:1171648779 Files:1000000000 Ffree:1000000000 Bsize:4096 Namelen:255 Frsize:4096}, err=
2022/02/01 22:52:09 DEBUG : /: Lookup: name="initbck.img"
2022/02/01 22:52:09 DEBUG : /: >Lookup: node=, err=no such file or directory
2022/02/01 22:52:09 DEBUG : /: Lookup: name="initbck.img"
2022/02/01 22:52:09 DEBUG : /: >Lookup: node=, err=no such file or directory
2022/02/01 22:52:09 DEBUG : /: Lookup: name="initbck.img"
2022/02/01 22:52:09 DEBUG : /: >Lookup: node=, err=no such file or directory
2022/02/01 22:52:09 DEBUG : /: Create: name="initbck.img"
2022/02/01 22:52:09 DEBUG : initbck.img: Open: flags=O_WRONLY|O_CREATE|0x20800
2022/02/01 22:52:09 DEBUG : : Added virtual directory entry vAddFile: "initbck.img"
2022/02/01 22:52:09 DEBUG : initbck.img: >Open: fd=initbck.img (w), err=
2022/02/01 22:52:09 DEBUG : /: >Create: node=initbck.img, handle=&{initbck.img (w)}, err=
2022/02/01 22:52:09 DEBUG : initbck.img: Attr:
2022/02/01 22:52:09 DEBUG : initbck.img: >Attr: a=valid=1s ino=0 size=0 mode=-rw-rw-rw-, err=
2022/02/01 22:52:09 DEBUG : initbck.img: Setattr: a=Setattr [ID=0x4c Node=0x10 Uid=0 Gid=0 Pid=4623] size=9564061696 handle=0x1 lockowner
2022/02/01 22:52:09 DEBUG : initbck.img: Truncating 1 file handles
2022/02/01 22:52:09 ERROR : initbck.img: WriteFileHandle: Truncate: Can't change size without --vfs-cache-mode >= writes
2022/02/01 22:52:09 DEBUG : initbck.img: >Setattr: err=operation not permitted
2022/02/01 22:52:09 DEBUG : &{initbck.img (w)}: Flush:
2022/02/01 22:52:09 DEBUG : initbck.img: WriteFileHandle.Flush unwritten handle, writing 0 bytes to avoid race conditions
2022/02/01 22:52:09 DEBUG : : Added virtual directory entry vAddFile: "initbck.img"
2022/02/01 22:52:09 DEBUG : &{initbck.img (w)}: >Flush: err=
2022/02/01 22:52:09 DEBUG : &{initbck.img (w)}: Release:
2022/02/01 22:52:09 DEBUG : initbck.img: WriteFileHandle.Release closing
2022/02/01 22:52:09 DEBUG : One drive root 'testing': File to upload is small (0 bytes), uploading instead of streaming
2022/02/01 22:52:09 DEBUG : initbck.img: Starting singlepart upload
2022/02/01 22:52:11 INFO : initbck.img: Copied (new)
2022/02/01 22:52:11 DEBUG : : Added virtual directory entry vAddFile: "initbck.img"
2022/02/01 22:52:11 DEBUG : &{initbck.img (w)}: >Release: err=

hi, this is the error

your command is not using --vfs-cache-mode, in effect --vfs-cache-mode-off
"Open modes O_APPEND, O_TRUNC are ignored"

this is not related to write error but worth fixing by removing that flag.

That effectively means that the tool will need --vfs-cache-mode writes or --vfs-cache-mode full in order to work :frowning:

while there is no --magic flag, there are some things to do to mimize the lack of free space.

to minimze the time the image is stored, in the local vfs file cache, after upload
--vfs-cache-max-age=1m

1 Like

I wanted to avoid using cache actually. but seems impossible for my use case. thanks for pointing this out. it did helped.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.