Page 1 of 2
Setting download folder to a USB mount on Raspberry Pi
Posted: December 4th, 2012, 8:09 am
by feoZA
Hi there
I have sabnzbd and Sickbeard running great on a Raspberry Pi.
Problem is that the SD card on the Pi is only 8GB so I wanna mount a 16GB USB at the location of the normal sab downloads (in my case, /var/sabnzbd/Downloads).
I mount the folder using something like this:
sudo mount -t ntfs -o uid=sabnzbd,gid=sabnzbd,fmask=000,dmask=000 /dev/sda1 /var/sabnzbd/Downloads
It mounts fine and the web interface shows 15GB available but if I try to manually load up an nzb the log file says it can't create folder /var/sabnzbd/Downloads/incomplete.
BTW. I manually created the folders 'complete' and 'incomplete' before I mounted it.
Basically what I wanna know is what's the easiest way to mount a USB drive (to the default download location) on a Raspberry Pi so that sabnzbd can put all downloads on the USB instead of the SD card.
Re: Setting download folder to a USB mount on Raspberry Pi
Posted: December 4th, 2012, 12:56 pm
by sander
feoZA wrote:
sudo mount -t ntfs -o uid=sabnzbd,gid=sabnzbd,fmask=000,dmask=000 /dev/sda1 /var/sabnzbd/Downloads
It mounts fine and the web interface shows 15GB available but if I try to manually load up an nzb the log file says it can't create folder /var/sabnzbd/Downloads/incomplete.
BTW. I manually created the folders 'complete' and 'incomplete' before I mounted it.
@BTW: If so, you created those folders on the local file system, not on the drive you mounted afterwards.
So: mount the external drive, and then:
Code: Select all
df -h
touch /var/sabnzbd/Downloads/hello.txt
sudo touch /var/sabnzbd/Downloads/hello2.txt
and post the output here.
Re: Setting download folder to a USB mount on Raspberry Pi
Posted: December 4th, 2012, 1:54 pm
by feoZA
I'm a complete beginner so please have patience with me if I did this wrong.
Code: Select all
pi@raspberrypi /var/sabnzbd/Downloads $ df -h
Filesystem Size Used Avail Use% Mounted on
rootfs 7.3G 3.7G 3.3G 53% /
/dev/root 7.3G 3.7G 3.3G 53% /
devtmpfs 93M 0 93M 0% /dev
tmpfs 19M 212K 19M 2% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 37M 0 37M 0% /run/shm
/dev/mmcblk0p1 56M 17M 40M 30% /boot
//192.168.0.102/TV Shows 1.8T 1.5T 318G 83% /media/NAS
/dev/sda5 15G 87M 15G 1% /var/sabnzbd/Downloads
pi@raspberrypi /var/sabnzbd/Downloads $ touch /var/sabnzbd/Downloads/hello.txt
pi@raspberrypi /var/sabnzbd/Downloads $ sudo touch /var/sabnzbd/Downloads/hello2.txt
pi@raspberrypi /var/sabnzbd/Downloads $
Re: Setting download folder to a USB mount on Raspberry Pi
Posted: December 4th, 2012, 2:07 pm
by sander
That looks good. What is the output of:
ls -al /var/sabnzbd/Downloads
whoami
Re: Setting download folder to a USB mount on Raspberry Pi
Posted: December 4th, 2012, 2:11 pm
by feoZA
sander wrote:That looks good. What is the output of:
ls -al /var/sabnzbd/Downloads
whoami
Code: Select all
pi@raspberrypi ~ $ ls -al /var/sabnzbd/Downloads
total 16
drwxr-xr-x 4 sabnzbd sabnzbd 4096 Nov 24 09:41 .
drwxr-xr-x 5 sabnzbd nzb 4096 Nov 17 14:43 ..
drwxrwxrwx 5 sabnzbd sabnzbd 4096 Dec 3 04:50 complete
drwxr-xr-x 2 sabnzbd sabnzbd 4096 Dec 3 04:51 incomplete
Re: Setting download folder to a USB mount on Raspberry Pi
Posted: December 4th, 2012, 2:21 pm
by sander
A user 'sabnzbd'? How did you do that? And why?
Anyway: does this work:
sudo chmod 777 /var/sabnzbd/Downloads/*
ls -al /var/sabnzbd/Downloads
Re: Setting download folder to a USB mount on Raspberry Pi
Posted: December 4th, 2012, 2:21 pm
by sander
A user 'sabnzbd'? How did you do that? And why?
Anyway: does this work:
sudo chmod 777 /var/sabnzbd/Downloads/*
ls -al /var/sabnzbd/Downloads
Re: Setting download folder to a USB mount on Raspberry Pi
Posted: December 4th, 2012, 2:29 pm
by feoZA
sander wrote:A user 'sabnzbd'? How did you do that? And why?
Anyway: does this work:
sudo chmod 777 /var/sabnzbd/Downloads/*
ls -al /var/sabnzbd/Downloads
I followed the tutorial here:
http://www.cylindric.net/blog/raspberrypi-setup/
Code: Select all
pi@raspberrypi ~ $ sudo chmod 777 /var/sabnzbd/Downloads/
pi@raspberrypi ~ $ ls -al /var/sabnzbd/Downloads
total 8
drwxrwxrwx 1 sabnzbd sabnzbd 4096 Dec 4 19:25 .
drwxr-xr-x 5 sabnzbd nzb 4096 Nov 17 14:43 ..
Re: Setting download folder to a USB mount on Raspberry Pi
Posted: December 4th, 2012, 2:39 pm
by sander
He, what happened? The subdirectories in /var/sabnzbd/Downloads/ are gone. Did you reboot, or disconnect the drive?
What is the output of
df -h
Re: Setting download folder to a USB mount on Raspberry Pi
Posted: December 4th, 2012, 2:52 pm
by feoZA
sander wrote:He, what happened? The subdirectories in /var/sabnzbd/Downloads/ are gone. Did you reboot, or disconnect the drive?
What is the output of
df -h
The Pi wasn't picking up the USB so I formatted in windows quickly and connected it back to the Pi.
I'm so confused right now.
All I want is to have the /var/sabnzbd/Downloads folder point to the USB instead of the SD card.
I've given up for the night will post back here tomorrow.
BTW. df -h will shows that the USB (sda5) is mounted at /var/sabnzbd/Downloads like the first time you asked.
Re: Setting download folder to a USB mount on Raspberry Pi
Posted: December 4th, 2012, 2:59 pm
by sander
I understand, but why all the work for a 16GB USB stick? That will fill up quite quickly. Can't you use a 500GB+ USB harddisk?
When you disconnect and then connect the USB-stick (or reboot the Raspi), you have to manually "sudo mount ..." the stick again. Very annoying. The solution is to add an entry to the /etc/fstab.
Re: Setting download folder to a USB mount on Raspberry Pi
Posted: December 4th, 2012, 3:08 pm
by feoZA
sander wrote:I understand, but why all the work for a 16GB USB stick? That will fill up quite quickly. Can't you use a 500GB+ USB harddisk?
When you disconnect and then connect the USB-stick (or reboot the Raspi), you have to manually "sudo mount ..." the stick again. Very annoying. The solution is to add an entry to the /etc/fstab.
I've added the line to fstab to automount it.
That's not the problem.
The problem is that when sabnzbd tries to download when the USB is mounted, there's something not right, I THINK it's permission issues.
Also, 16GB is plenty considering that the files are deleted off the USB as soon as Sickbeard post processes them. I only have 5GB left on the SD card after the OS and stuff so that's definitely not enough.
Re: Setting download folder to a USB mount on Raspberry Pi
Posted: December 4th, 2012, 3:15 pm
by sander
If you've added it to fstab to automount it, but it does not automount, I would say there is something wrong with the fstab entry.
Yes, I think it's permission too. Therefore the "chmod ..." thing. However, the directories where gone, so something else is going too. Maybe the not-working fstab entry?
Re: Setting download folder to a USB mount on Raspberry Pi
Posted: December 5th, 2012, 5:01 am
by feoZA
OK let's forget the automount thing for now.
If I manually mount the USB to /var/sabnzbd/Downloads then all I expect should happen is that sabnzbd will show 15GB free in my Download folder and not 5GB free, which it does.
Problem is when I upload an nzb to test if it works like usual, it doesn't. sabnzbd just freezes up and I can't figure out why.
Re: Setting download folder to a USB mount on Raspberry Pi
Posted: December 5th, 2012, 5:08 am
by sander
feoZA wrote:O
If I manually mount the USB to /var/sabnzbd/Downloads then all I expect should happen is that sabnzbd will show 15GB free in my Download folder and not 5GB free, which it does.
If you mount it, and it is visible in "df -h", and then you start SABnzbd, and SAB points to /var/sabnzbd/Download for incomplete and complete, and it is writable for the user under which SABnzbd is running ... yes, then it should work like you want.
So: an external drive is not an easy thing.
So let's do first things first: does SAB work for a file of 100 MB, just downloading to the SD-card in the Raspi? (No external drive in use)