maddy_in65
Posts: 14
Joined: Mon Aug 19, 2013 2:42 pm

Torrent downloading on external drive

Tue Aug 27, 2013 2:02 am

I got my rPI and installed raspbian on it. Also installed deluge for torrenting purpose. I attached external drive for downloading torrent on it. Whenever i add any torrent it gives me error that permission denied.
I have mounted external drive to /mnt with rw permission but still i am not able to download any torrent. Please help.

Code: Select all

$mount
/dev/sda1 on /mnt/myusb type ntfs (rw,relatime,uid=1000,gid=1000,fmask=0177,dmask=077,nls=utf8,errors=continue,mft_zone_multiplier=1)

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: Torrent downloading on external drive

Tue Aug 27, 2013 8:23 am

If this drive is going to be used exclusively on the Pi, I'd reformat it into ext4. It will give you a lot less headaches.
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

pichicken
Posts: 20
Joined: Fri Feb 22, 2013 3:38 pm

Re: Torrent downloading on external drive

Tue Aug 27, 2013 9:00 am

Hello,

I believe the problem is the interaction between the user/group under which deluge runs and the fmask and dmask parameters used to mount the volume, as shown by mount. Your masks are removing all permissions from the "group" and "others" portions of the permission bits, so unless deluge runs as the user with uid=1000 or has superuser privileges it won't be able to write to that drive.

You can always change the values of fmask and dmask to be less restrictive via mount options or fstab. A way is to create a new group and use it as the group of the mounted volume, granting it write access to the entire drive. Then add the users of all the services that need write access to that group. This way only processes you decide will be able to write.

Example:

Code: Select all

mount -t ntfs -o rw,fmask=0117,dmask=0007,gid=myusbgroup
That said, if you're going to share that drive among *nix installations only, do as SirLagz said, and use a native filesystem.

Hope this helps.

Bye.
The knowledge gained from a failure is more valuable than an immediate success.

maddy_in65
Posts: 14
Joined: Mon Aug 19, 2013 2:42 pm

Re: Torrent downloading on external drive

Tue Aug 27, 2013 12:28 pm

Thanks a lot pichicken, do you mean to create new user with root access. Sorry for the noob question.

pichicken
Posts: 20
Joined: Fri Feb 22, 2013 3:38 pm

Re: Torrent downloading on external drive

Tue Aug 27, 2013 3:04 pm

Hi,

this is how I would manage your situation:

an NTFS filesystem does not carry per-file owner and group information the way Linux expects, as native *nix filesystems does. So when you mount it the system must somehow concoct an owner and a group for every file on the volume. While the system can pick an appropriate default you can specify those values when mounting, via the uid=<username> and gid=<groupname> mount options. That way every file and directory on that volume will appear as if they were owned by <username> and had a group of <groupname>.

Now, a way you can grant write permission to selected processes only is:
1) create a brand new group on your system, such as usbvolusers;
2) when mounting the NTFS drive, specify that group via the gid option, that is gid=usbvolusers. Now every file and folder on the drive belongs to that group. Also don't forget to specify the options fmask=0117 and dmask=0007: those values prevents "others" from accessing the volume, even read-only, but members of the usbvolusers group will have read/write access to the whole contents.
3) Add each user that needs read/write access to the drive to the usbvolusers group. You should at least add the user the deluge process belongs to (start deluge and use ps to find out) and yourself.
4) Reboot, just to stay safe and start clean

At that point deluge should be able to write torrents there.

If not... :o we'll find a way!

Bye
The knowledge gained from a failure is more valuable than an immediate success.

maddy_in65
Posts: 14
Joined: Mon Aug 19, 2013 2:42 pm

Re: Torrent downloading on external drive

Fri Aug 30, 2013 1:15 pm

Thanks pichicken for the detailed explaination. Finally I am able to set deluge to download on external USB.
However i have small problem, I added 4GB torrent for downloading. The downloading starts normal but after 10-15 min download stops for a few min and it starts again. I have 2 mbps adsl connection but able to download 2GB only within 6 Hrs. Is it due to downloading on pen drive. The torrent have enough seeders for downloading, also tested with other torrents.

kalehrl
Posts: 350
Joined: Tue Jul 24, 2012 10:49 am

Re: Torrent downloading on external drive

Fri Aug 30, 2013 6:06 pm

I have the same problem on my eee pc when downloading to USB stick.
If I download to my sdcard, the downloading is smooth.
It must have something to do with USB stick.

dude221
Posts: 1
Joined: Fri Aug 30, 2013 6:21 pm

Re: Torrent downloading on external drive

Fri Aug 30, 2013 6:36 pm

I have recently setup deluge and ran into the same error.My external drive is currently ntfs.
If you run the following command in terminal deluge should access your external usb drive fine.

Code: Select all

sudo apt-get install ntfs-3g
You may have to either reboot or umount the drive / restart deluge.
I have used these tutorials for setting up the hard drive and deluge.
http://www.howtogeek.com/142044/how-to- ... rrent-box/
http://www.howtogeek.com/139433/how-to- ... ge-device/
(the samba section is optional)

maddy_in65
Posts: 14
Joined: Mon Aug 19, 2013 2:42 pm

Re: Torrent downloading on external drive

Fri Aug 30, 2013 8:17 pm

Thanks i Will try to download with HDD later. I have another issue with Deluge automation. I need to first SSH into the PI (as i dont have extra monitor), start the web UI manually from the terminal by typing 'deluge-web', then open the web UI in my browser and start the Daemon manually as well.

How can I make both the Web UI and Daemon start automatically at PI to start at 2 am exactly (Download is free after 2 am). I made few cron jobs to start deluge and deluge web to start at 2 am but don't find any way to start daemon automatically.
Please can somebody help me with this.

Return to “Beginners”