Help with maintaining mounted smb file location (Debian)

General support for problems installing or using Deluge
Post Reply
foetus66
New User
New User
Posts: 5
Joined: Fri Sep 11, 2015 11:15 pm

Help with maintaining mounted smb file location (Debian)

Post by foetus66 »

Hi, I did a couple searches but there are a lot of threads about SIMILAR issues that I couldn't quite put together to solve mine, so figured I'd post a thread more specific.

I've got Deluge 1.3 running headless under Wheezy, administering using the ThinClient and SSH for command line stuff.

I created a folder called /mnt/incoming and set the owner to the user I called deluge, and then put the following line in my fstab:

Code: Select all

//192.168.1.254/incoming  /mnt/incoming  cifs  defaults,uid=deluge,gid=deluge  0 0
This mounts the Samba share "incoming" on my NAS, as a writable folder in Debian.
In other words, I have most of my torrents in Deluge downloading to /mnt/incoming which saves them to the incoming folder on my NAS and this all seems to work very well..

except for one kinda big problem.

If the NAS loses connection for any reason then the mount point entered in fstab is lost and Deluge sees the /mnt/incoming folder as a normal empty (local) folder and starts over my torrents at 0%, now downloading them into this folder locally.

So far this is the only thing holding me back from letting this thing run unattended 24/7, because I have to somewhat actively monitor whether the NAS is still mounted.

Is there a way to tell Deluge not to write to the folder if it is not mounted? Or to find some kind of key file stored on the NAS in the directory before writing, to show that the connection is established? Or am I going about this whole thing the wrong way in the first place? Mounting it like this seems to work great until there is a network problem and then it really messes the bed. I'd like Deluge to just stop transferring files to that folder until I notice the issue -- but open to other suggestions as well. Thank you!
foetus66
New User
New User
Posts: 5
Joined: Fri Sep 11, 2015 11:15 pm

Re: Help with maintaining mounted smb file location (Debian)

Post by foetus66 »

I should add that the worst part of this is that each time it happens, after I SSH in to mount the share again and restart the deluge daemon, it has to recheck all my completed torrents over smb. The network speed is totally adequate for saving and seeding torrents, but re-checking half of a TB of data takes basically all night before I'm back up and running again. So, I'm very motivated to find a solution before the next time.
Cas
Top Bloke
Top Bloke
Posts: 3679
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: Help with maintaining mounted smb file location (Debian)

Post by Cas »

It is usually only a problem when starting Deluge again. So you can modify the service or deluged startup routine to verify the mount exists.

There is a bug ticket for this issue: http://dev.deluge-torrent.org/ticket/1032
foetus66
New User
New User
Posts: 5
Joined: Fri Sep 11, 2015 11:15 pm

Re: Help with maintaining mounted smb file location (Debian)

Post by foetus66 »

Thanks for the response. Looks like that bug report has been up for 6 years so I won't hold my breath :)

I did find a solution though, which is to set the folder owner to root with chown. Setting the uid in the fstab line overrides this for the mount point. So, if the mount is not set then the folder is owned by root at the torrents will all error out until restarted because it can't write to the folder. If it is mounted, then the user 'deluge' owns the folder and it can write again. I was also pleased to see that it didn't need to recheck everything after I reset the mount point and restarted the daemon -- it came back up as normal.
Cas
Top Bloke
Top Bloke
Posts: 3679
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: Help with maintaining mounted smb file location (Debian)

Post by Cas »

That is a good tip, I did not realise they were not even erroring out.
Post Reply