pink
Posts: 3
Joined: Mon Jun 18, 2012 6:04 pm

Cannot write to network drive

Mon Jun 18, 2012 6:29 pm

I am running Debian-Squeeze and I have an Apple TimeCapsule, which I mount:

mount.cifs //10.0.1.1/ThymeCapsule /mnt/thyme -o user=THYME,password=xxxxxx

As root, I have no problems creating directories and files on the drive. However, I installed Transmission and set the download directory to /mnt/thyme/transmission (a directory I created prior to installation) and I continually get "Permission denied."

There are a ton of results when googling the issue, some of the things I have tried include changing permissions to 777 and changing ownership to debian-transmission; neither of which worked. (That is, neither the ownership nor the permissions changed when running their respective commands.)

On the other hand, I also created an ArchLinux SD Card, and when Transmission runs onit, it has no problem writing the TimeCapsule.

Is there anything I am overlooking?

bredman
Posts: 1415
Joined: Tue Jan 17, 2012 2:38 pm

Re: Cannot write to network drive

Mon Jun 18, 2012 6:48 pm

To change permission, you will need to add sudo before the the chmod command.

Mode 777 is a bit excessive. To allow all users read and write to a directory xxxx, use the command
sudo chmod a=rw /mnt.thyme/xxxx

pink
Posts: 3
Joined: Mon Jun 18, 2012 6:04 pm

Re: Cannot write to network drive

Mon Jun 18, 2012 7:06 pm

I did use sudo, I also logged in as root and tried it.

Since this is a networked drive, is there anything I could try doing on a different computer?

gr3ener
Posts: 15
Joined: Thu Jun 14, 2012 2:02 am

Re: Cannot write to network drive

Mon Jun 18, 2012 11:10 pm

I'm on the same boat as you, just one step behind. I've mounted my NAS but when I cd to the mount directory, and I list directories it doesn't show. What's yours like?

pink
Posts: 3
Joined: Mon Jun 18, 2012 6:04 pm

Re: Cannot write to network drive

Tue Jun 19, 2012 2:45 pm

I have no problem viewing or accessing files on the drive, and if I want to seed a file that is already there, I have no problem getting Transmission to access it.

It is only creating new files and directories through transmission (and other programs as well) that I have a problem with.

tom3f
Posts: 11
Joined: Thu Apr 26, 2012 6:26 pm

Re: Cannot write to network drive

Thu Jul 05, 2012 4:40 pm

Hello, I think that this issue is bug in transmission. But I found solution how to solve this problem.

1. Stop transmission
sudo service transmission-daemon stop

2. (I don't know if necessary) add your user to debian-transmission group
sudo adduser your_username debian-transmission

3. Change startup user for transmission
sudo nano /etc/init.d/transmission-daemon
and change user name to your username: USER=your_username

4. Change owner rights to transmission configuration files to you.
sudo chown your_username -R /var/lib/transmission-daemon/info/

5. Change owner right of download folder to your user
sudo chown your_username -R /home/your_username/torrents

6. Start transmission
sudo service transmission-daemon start

Now you can download without problem and after restart will everithing still work.
(I tried only one manual stop and start and one restart, but i hope it will until transmission update)

valhar2000
Posts: 1
Joined: Sat Nov 10, 2012 1:23 am

Re: Cannot write to network drive

Sat Nov 10, 2012 1:27 am

Tom3f's advice almost did it for me, but I found that I could not start the Transmission daemon again.

I had a hunch, and it turned out that I also needed to change the ownership of the file /etc/transmission-daemon/settings.json, which is symbolically linked to /var/lib/transmission-daemon/info/settings.josn (or perhaps the other way around).

After doing that, Tom3f's advice solved the problem for me.

Holymartyr
Posts: 6
Joined: Sat Feb 09, 2013 10:06 pm

Re: Cannot write to network drive

Sat Feb 09, 2013 10:14 pm

Sorry to revive an old thread, especially with my first post - but I need some help on this issue, and I can't seem to find the right info anywhere...

I'm having a similar issue as the OP was. I installed transmission-daemon and transmission, set everything up, and worked just fine as long as I downloaded and uploaded to the Pi's SD card.

Now that I got my NAS HDD working, and figured out how to mount it on the Pi, I tried uploading and downloading torrents to it, but got permission errors.

So I followed what tom3f said to do, and, well it didn't do anything. So I did more research. I tried changing the 'umask' in transmissions config file to 0 - that didn't help. I tried using

Code: Select all

sudo chmod 777 -R
on the network drive, and that seemed to help a bit. It would now read a .torrent file was there, and loaded it, but didn't change its name to .added and when the torrent started to download it would still throw the permission error.

So I thought 777 gives ALL permissions to EVERYONE, but it seems that both the 'debian-transmission' user and my default 'pi' user don't have write permissions.

Now when I change the user to 'root' in the init.d/transmission-daemon file, everything works as it should be.

I tried using the

Code: Select all

sudo visudo
to add the 'debian-transmission' user so it would use sudo, but that didn't work either.

So from everything I've read, it's not safe to run ANYTHING as root, unless it needs to. I haven't seen anyone else out there who has said they've run it as root, so what am I missing? Thanks!

Holymartyr
Posts: 6
Joined: Sat Feb 09, 2013 10:06 pm

Re: Cannot write to network drive

Thu Apr 11, 2013 4:55 am

Shameless bump >.<

Wanted to update that now because I've had to set transmission-daemon as root, when the power went out, and came back on - the Pi ofc automatically started up as it should, but my NAS did not. So transmission-daemon made a local folder and started downloading torrents to the SD card instead of the NAS, which wouldn't have happened if transmission-dameon would be running under the right permissions >.<

latinclown3
Posts: 5
Joined: Wed Nov 07, 2012 3:18 am

Re: Cannot write to network drive

Tue Aug 06, 2013 1:35 am

I've had similar trouble before, and I tried the same solution with the same results. Could you please use ls -l <dir> on your hard drive to view the permission that is mounted with. The most likely problem as it did work on your SD card before and not on your HDD is that the permssions and owner are not correct to allow transmission to write to it. You may have to edit the /etc/fstab to get it to always mount correctly.

fuzhouzb12
Posts: 1
Joined: Tue Aug 06, 2013 2:21 am

Re: Cannot write to network drive

Tue Aug 06, 2013 2:25 am

Cannot write to network drive

Holymartyr
Posts: 6
Joined: Sat Feb 09, 2013 10:06 pm

Re: Cannot write to network drive

Tue Aug 06, 2013 6:16 am

Actually funny thing.

I decided a few months back to just leave it as root. Then a few days ago, I had a bit of trouble with transmission, and switched over to deluge. After fiddling for 2 days, I finally was able to learn to download and compile deluge, and libtorrent - and so I decided to do a fresh install of raspbian, and re-compile everything cleanly from what I had learned. It went flawlessly.

And then I ran into the same issue I did with transmission that I started this thread about.

So I tried a few things that I had learned over the past few months, like using the 'stat' command on the directory I had the share mounted. I learned that it was owned by root, and only had 0755 permissions. So I tried running

Code: Select all

sudo chown pi /home/NAS
(/home/NAS) being the mounted folder for the network drive, and to my suprise, when I ran

Code: Select all

stat /home/NAS
the owner was still root.

So I tried logging in as root, and doing the same thing - but it didn't work. So then I began to think, maybe samba has something to do with the folder permissions. So I did a bit of research, and decided to take a look at my /etc/fstab file.

Originally, my samba mount line was

Code: Select all

//192.168.1.125/admin /home/NAS/ cifs username=admin,password=qwerty12,workgroup=WORKGROUP,users,auto,user_xattr 0 0
and after a bit of research, I changed it to

Code: Select all

//192.168.1.125/admin /home/NAS cifs username=admin,password=qwerty12,workgroup=WORKGROUP,file_mode=0777dir_mode=0777,uid=pi,gid=pi,forceuid,forcegid 0 0
So I removed the variables that I couldn't find any information for on the samba page (http://www.samba.org/samba/docs/man/man ... ifs.8.html), and added the variables you see above.

With this line in my /etc/fstab file, I rebooted my pi, and it worked. Hope this ends up helping someone else who stumbles across this.

latinclown3
Posts: 5
Joined: Wed Nov 07, 2012 3:18 am

Re: Cannot write to network drive

Tue Aug 06, 2013 2:44 pm

You hit it right on the head with that one. Once the drive is mounted I don't know of how to change the owner, group and permissions, but it's best to change it on mount anyway. This is the solution to most problems with getting transmission, or some other torrent program, to write to a mounted drive.

Holymartyr
Posts: 6
Joined: Sat Feb 09, 2013 10:06 pm

Re: Cannot write to network drive

Tue Aug 06, 2013 3:05 pm

Just one last note!

I set my user to pi, since I decided to run deluge under the default user of pi, rather than create a user specifically for the deluge service.

For transmission, by default it runs under the user 'transmission-daemon' I think, check your /etc/init.d/transmission-daemon file to verify the user there.

So remember to change your samba mount variables accordingly with whichever user is used.

rpiYaba
Posts: 8
Joined: Mon Jan 21, 2013 10:52 am

Re: Cannot write to network drive

Mon Feb 17, 2014 3:59 pm

Is possible or not to save torrents on network drive?
I have router with samba and usb flash drive as network drive.

tyescott
Posts: 1
Joined: Wed Mar 26, 2014 12:27 am

Re: Cannot write to network drive

Wed Mar 26, 2014 12:35 am

So, this may be too late, and it could have been by chance, so here is what I did:

The settings file (/etc/transmission-daemon/settings.json) has an "Incomplete Dir." this location defaults to /home/debian-transmission/Downloads. However, there is no /home/debian-transmission folder. I simply created /home/debian-transmission/Downloads (mkdir -p /home/debian-transmission/Downloads) and changed ownership to the debian-transmission user/group (chown -R debian-transmission:debian-transmission /home/debian-transmission).

Also, make sure your nas is mounted so the user debian transmission can write to it.

I hate to bump an old thread but there are many solutions posted that didn't work for me (and I didn't want to run as root)

Good Luck!

fiskius
Posts: 25
Joined: Fri Dec 07, 2012 10:12 pm

Re: Cannot write to network drive

Tue Jun 03, 2014 10:42 am

Bump for this thread... I've tried following all these instructions and searched a few other pages. I hope to create a guide if I can get this working:

Objective: Mount a Network drive on Raspbian and use transmission daemon with it.

So far: I can mount the network drive from both /etc/fstab and from the command line, but only as root. Since transmission daemon runs as the user that debian-tranmission it therefore cannot write to this drive. It's formatted as Fat32 and is connected to my router directly, and is accessed by my win7 laptop and RASPBMC with no issues.

What I've done:

1. Install transmission-daemon, set the settings to point to /mnt/USB_32 (my mount point). I switched this for the local SD card to test, I can can use transmission to download with no problems.

2. Mounted the network drive (there is no password)
sudo mount -t cifs //192.168.1.1/USB_Storage/iPlayer /mnt/USB_32 -o sec=none

This mounts, but with the following permissions, the other options do not seem to work (uid=debian-transmission etc etc)
stat /mnt/USB_32 shows:


File: `/mnt/USB_32'
Size: 0 Blocks: 32 IO Block: 16384 directory
Device: 10h/16d Inode: 30992 Links: 3
Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2014-06-02 11:07:03.000000000 +0000
Modify: 2014-06-02 11:07:03.000000000 +0000
Change: 2014-06-03 10:14:48.000000000 +0000
Birth: -

Anyone got any idea of how I can set the debian-tranmission user permissions at mount time? I've tried changing the user that transmission runs as, but then it did not start correctly. I assume I can run it as root, but I'd rather not.

Andy

Holymartyr
Posts: 6
Joined: Sat Feb 09, 2013 10:06 pm

Re: Cannot write to network drive

Tue Jun 03, 2014 6:11 pm

I'm not the most affluent linux user, but from all the testing/playing I did, the problem that was stopping transmission from writing to the network drive was the samba mount line intself. It had nothing to do with altering the 'transmission-user' permissions or anything of that sort. If you look at my post above, I had to add

Code: Select all

file_mode=0777dir_mode=0777,uid=pi,gid=pi,forceuid,forcegid
to the fstab mounting file.

As an additional note, I'm pretty sure I added 'transmission-user' to the 'users' group, as the pi ID is as well. Good luck.

fiskius
Posts: 25
Joined: Fri Dec 07, 2012 10:12 pm

Re: Cannot write to network drive

Sat Jun 07, 2014 8:49 am

Hi HolyMartyr (interesting screen name btw!!)

Yeah I tried your line, but it did not do anything different, it still mounted as root, although just looking closely now reading your post, it seems there is no comma between file_mode=0777 and dir_mode=0777, and I am guessing there should be.... need to check it out again!

file_mode=0777dir_mode=0777,uid=pi,gid=pi,forceuid,forcegid

Holymartyr
Posts: 6
Joined: Sat Feb 09, 2013 10:06 pm

Re: Cannot write to network drive

Sat Jun 07, 2014 5:13 pm

Woops, yes there should be a comma - copy pasta error.

Another thing to add - after all this time working to get transmission running, I eventually ended up switching over to Deluge, because transmission doesn't have a 'plugin' or 'feature' for tagging torrents (AKA Grouping similiar torrents together). The reason I found this feature necessary, was that I have XBMC setup on a computer in my living room, and XBMC is semi-picky about how the folder structure needs to be setup. So with deluge, when I add a torrent of a certain name, say 'Mentalist' - it will automatically group it with the other Mentalist shows, download it to a temporary folder, and when finished, move it into the 'Mentalist' labeled folder.

The only downside is Deluge is much more resource heavy than Transmission is. Any how, I wish you good luck.

daffyduck421
Posts: 1
Joined: Thu Oct 06, 2016 9:49 pm

Re: Cannot write to network drive

Thu Oct 06, 2016 9:52 pm

All of this very detailed advice eventually fixed the problem for me once, but it was back as soon as I made a hard drive configuration change.

What I found to work the following very different method. It requires that you remote to the PI though.

1) Remote desktop to the pi.
2) Open the file viewer and click Go
3) Go to the network page and find your drive logging in and selecting save password forever.
4) Copy the path including smb protocol link and use that in your torrent client i.e. smb://servername/sharename

A little more crude and relies on the GUI, but worked for me.

LXFY
Posts: 1
Joined: Sun Jul 22, 2018 2:26 pm

Re: Cannot write to network drive

Sun Jul 22, 2018 2:42 pm

Sorry to revive an old thread again, I had the same issue with @pink. Transmission reports a "permission error" after my NAS has been mounted (by /etc/fstab). However, I can list files or even use wget command in that directory with the same user and permission. Here is my solution:


It is the file allocation problem, It seems that raspberry pi cannot use falloc method on a cifs device for some reason. However the default allocation method was set as "Fast", so I edited the settings.json file and set

"preallocation": 0,

restart transmission and it worked.


Hope this will help.

ref: https://github.com/transmission/transmi ... -locations

Return to “Beginners”

Who is online

Users browsing this forum: Baidu [Spider], Kantilo, tylersalterego and 46 guests