Fix a Weird Transmission Permission Error when Write to Network Drive

TLDR: This problem may be caused by file allocation function if you are using CIFS protocol, see the latest paragraph for solutions.

I logged in my raspberry pi last weekend and found there is a bunch of state D processes. I checked the IO stream of the system and does not find anything wrong and everything works well. Despite these processes do not affect the pi-server, as a perfectionist, I decided a reboot to kill these processes. But the weird thing happened, I can not boot my pi-server up, I fixed this problem and when I logged it again, I found that transmission reports a “permission error” when I download or seed torrents.

I mount my NAS to pi-server by using CIFS protocol, I set up the permission correctly in /etc/fstab file. I can read and write files in the mounted directory, but when I use some download software like transmission or aria2, these all report “permission error”, even running as “pi” user or even root. The weird thing is: I can successfully download files using aria2c (CLI) in the foreground, but it got “permission error” when I run it as a daemon, same error as transmission.

It seems like a simple permission issue, I checked the fstab file and permission of the mounted directory carefully and modified the permission and ownership again and again, but it does not work. Google gives me tons of results but not beyond the scope of chmod 777 or chown. (And at that time, another weird thing happened, my monitor start flashing when I visit StackOverflow or askubuntu. I changed browsers, replug the DP port, replug my laptop from the dock station… but the problem still happens… What a terrible weekend night, but my expand monitor works fine tonight). Finally, I found that transmission cannot allocate files on the network drive and they reported as “permission error”.

Actually, the “permission error” problem was caused by the file allocation function. For some reason, my pi-server which mounted network drive via CIFS protocol does not support falloc file allocation function. The solution is simple, change the allocation method or disable preallocation. If you are using transmission, edit transmission settings file:

$ sudo vim /etc/transmission-daemon/settings.json

set:

"preallocation": 0,

save and restart transmission daemon.

ref: transmission documentation

If you are using aria2, edit config file:

$ sudo vim /etc/aria2.conf

and change the file allocation method based on your network-drive IO:

file-allocation=falloc

Then restart aria2 deamon and try again.

ref: aria2 documentation

 

It works for me.

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注