RPi3 + USB = No Space?

Posted by MonCapitan 
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.
Now, this forum is in read-only mode. You find details Details hereContinue on /r/PirateBox
RPi3 + USB = No Space?
March 10, 2017 10:55PM
Good day to you all!

I have recently started messing around with PirateBox on the Raspberry Pi 3, and everything is going smoothly, except for one small thing.

When the Pi installs and boots, the default storage area for Shared is the SD card. When I log into Putty there are a few suggested commands, including a shell script command to move Shared and the Board to an attached USB drive. This command works flawlessly, but the Free Space indicator on the main page doesn't work.

It worked when the storage was on the SD card, but shows nothing when everything is moved to the USB. I am assuming there is a line in a config file somewhere that points the usage meter script to the correct path, but I can't seem to find it. Anyone have any suggestions?

Thanks in advance.
Re: RPi3 + USB = No Space?
March 12, 2017 07:15AM
Hi,
first of all, the storage indication is not generated immediately. It takes up to 5 minutes to be regenerated (timestamp based).

To verify if it is configured correctly, please post the output of

ls -l /opt/piratebox
ls -l /opt/piratebox/share
ls -l /opt/piratebox/www/
mount

Thank you,
best regards
Matthias



Edited 1 time(s). Last edit at 03/12/2017 04:47PM by Matthias.
Re: RPi3 + USB = No Space?
March 15, 2017 10:12PM
Hi,
assuming you setup everything correctly, I think I found an issue in the code about this.

Can you do me a favor and try two things if that solves the issue?

#1
Run the following commands
sudo sed -i -e 's|"/opt/piratebox/share/Shared"|"/opt/piratebox/share/Shared/"|' /opt/piratebox/python_lib/diskusage.py 
sudo touch -t 197001010101  /opt/piratebox/www/diskusage.html
After this check via the landing page, if the disk usage is displayed correctly.

If that does not work, try #2
Run the following commands
sudo mkdir  /opt/piratebox/share/Shared/folder 
sudo sed -i -e 's|"/opt/piratebox/share/Shared/"|"/opt/piratebox/share/Shared/folder"|' /opt/piratebox/python_lib/diskusage.py 
sudo touch -t 197001010101 /opt/piratebox/www/diskusage.html
After this check via the landing page, if the disk usage is displayed correctly.


I hope one of these helps. These are just some strange ideas, which came to my mind smiling smiley eye rolling smiley

best regards
Matthias
edit: Changed rm to touch with year 1970 to force recreation without 404



Edited 2 time(s). Last edit at 03/17/2017 05:33AM by Matthias.
Re: RPi3 + USB = No Space?
March 16, 2017 12:29AM
Having the same issue, the first command made it constantly refresh on my phone til a reboot. and the second command made it no longer work on my phone but work fine on computer still
Re: RPi3 + USB = No Space?
March 16, 2017 05:14AM
eye popping smiley ok strange.
I'll digg into that issue further. At the weekend, I might have time to run several tests

Thank you for the feedback.

best regards
Matthias
Re: RPi3 + USB = No Space?
March 16, 2017 08:34PM
Further testing as I get more familiar with this, first one no longer kills it but makes it pull the storage data from the SD partition again (giving about 67% full) and the second seems to have only broken til i restarted my box... hmmm



Edited 2 time(s). Last edit at 03/16/2017 08:41PM by Brunevde.
Re: RPi3 + USB = No Space?
March 17, 2017 05:34AM
I changed the commnands, that there won't be a 404 based redirect anymore.
But I am currently setting up a test box to analyze the issue..
Re: RPi3 + USB = No Space?
March 17, 2017 06:05AM
Hi,
well. I regenerated the RPi image today.

Following the howto here: RaspberryPi Mods, I get it working without any issues.
You might need to trigger a regeneration of the disk_usage with resetting the time of the html file:

sudo touch -t 197001010101 /opt/piratebox/www/diskusage.html

Remember, we also have a script which moves the /share folder over to the USB stick automatically. In this case, the disk usage should work, too.

best regards
Matthias
Re: RPi3 + USB = No Space?
March 17, 2017 07:29PM
Strange.... even after the hard refresh still no dice on showing it. Not sure what I am doing wrong. Everything else works great
Re: RPi3 + USB = No Space?
March 17, 2017 09:29PM
How did you configure the USB port?
Can you give the output of the commands listed here [forum.piratebox.cc] ?
Re: RPi3 + USB = No Space?
March 18, 2017 06:31AM
[alarm@alarmpi ~]$ ls -l /opt/piratebox
total 36
drwxr-xr-x 3 alarm alarm 4096 Mar 6 2016 bin
drwxr-xr-x 3 alarm alarm 4096 Mar 17 19:13 conf
drwxr-xr-x 2 alarm alarm 4096 Mar 6 2016 init.d
drwxr-xr-x 2 alarm alarm 4096 Mar 17 19:31 python_lib
drwxr-xr-x 5 alarm alarm 4096 Mar 6 2016 rpi
lrwxrwxrwx 1 root root 19 Mar 17 19:09 share -> /mnt/usbshare/share
drwxr-xr-x 2 alarm alarm 4096 Mar 6 2016 src
drwxrwxr-x 3 nobody nogroup 4096 Mar 17 19:13 tmp
-rw-r--r-- 1 alarm alarm 19 Mar 6 2016 version
drwxr-xr-x 4 nobody nogroup 4096 Mar 6 2016 www
[alarm@alarmpi ~]$ ls -l /opt/piratebox/share
lrwxrwxrwx 1 root root 19 Mar 17 19:09 /opt/piratebox/share -> /mnt/usbshare/share
[alarm@alarmpi ~]$ [alarm@alarmpi ~]$
-bash: [alarm@alarmpi: command not found
[alarm@alarmpi ~]$ ls -l /opt/piratebox/www/
total 220
lrwxrwxrwx 1 nobody nogroup 27 Mar 6 2016 Shared -> /opt/piratebox/share/Shared
lrwxrwxrwx 1 nobody nogroup 26 Mar 6 2016 board -> /opt/piratebox/share/board
drwxr-xr-x 2 nobody nogroup 4096 Mar 6 2016 cgi-bin
-rw-rw-r-- 1 nobody nogroup 289 Mar 17 19:25 chat_content.html
-rw-rw-r-- 1 nobody nogroup 346 Mar 17 19:33 diskusage.html
-rwxr-xr-x 1 nobody nogroup 1406 Mar 6 2016 favicon.ico
-rw-r--r-- 1 nobody nogroup 97 Mar 6 2016 generate_204
-rw-r--r-- 1 nobody nogroup 4407 Mar 6 2016 index.html
-rw-r--r-- 1 nobody nogroup 16268 Mar 6 2016 jquery-ui.min.css
-rw-r--r-- 1 nobody nogroup 22082 Mar 6 2016 jquery-ui.min.js
-rwxr-xr-x 1 nobody nogroup 94840 Mar 6 2016 jquery.min.js
drwxr-xr-x 3 nobody nogroup 4096 Mar 6 2016 library
-rw-r--r-- 1 nobody nogroup 2992 Mar 6 2016 menu.png
-rw-r--r-- 1 nobody nogroup 15 Mar 6 2016 ncsi.txt
-rw-r--r-- 1 nobody nogroup 6607 Mar 6 2016 piratebox-logo-horizontal-white.png
-rwxr-xr-x 1 nobody nogroup 12637 Mar 6 2016 piratebox-logo-small.png
-rwxr-xr-x 1 nobody nogroup 320 Mar 6 2016 redirect.html
-rwxr-xr-x 1 nobody nogroup 4770 Mar 6 2016 scripts.js
-rw-r--r-- 1 nobody nogroup 0 Mar 6 2016 station_cnt.txt
-rw-r--r-- 1 nobody nogroup 5609 Mar 6 2016 style.css
[alarm@alarmpi ~]$ mount
/dev/mmcblk0p2 on / type ext4 (rw,relatime,data=ordered)
devtmpfs on /dev type devtmpfs (rw,relatime,size=468104k,nr_inodes=117026,mode=755)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/bfqio type cgroup (rw,nosuid,nodev,noexec,relatime,bfqio)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
tmpfs on /tmp type tmpfs (rw)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=31,pgrp=1,timeout=0,minproto=5,maxproto=5,direct)
mqueue on /dev/mqueue type mqueue (rw,relatime)
/dev/mmcblk0p1 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
/dev/sda1 on /mnt/usbshare type vfat (rw,nosuid,nodev,noexec,noatime,uid=99,gid=1002,fmask=0000,dmask=0000,allow_utime=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro,user)
configfs on /sys/kernel/config type configfs (rw,relatime)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=94484k,mode=700,uid=1000,gid=1000)
[alarm@alarmpi ~]$
Re: RPi3 + USB = No Space?
March 18, 2017 10:17AM
ok, that looks like the official usb mount script.
I will test this, too.

best regards
Matthias
Re: RPi3 + USB = No Space?
March 18, 2017 11:34AM
I am sorry, but on my RPi3 that does work.

I did the following steps

sudo /opt/piratebox/rpi/bin/usb_share.sh
sudo touch -t 197001010101 /opt/piratebox/www/diskusage.html  
wget [127.0.0.1] -q -O -

With triggering it by hand:

Quote

sudo touch -t 197001010101 /opt/piratebox/www/diskusage.html && wget [127.0.0.1] -q -O -

OK. File last modified 633 minutes ago. Updating now...
<html><body>ok</body></html>

[alarm@alarmpi ~]$ cat /opt/piratebox/www/diskusage.html
<html><head><meta http-equiv='cache-control' content='no-cache'><meta name='GENERATOR' content='disk usage'><title>DiskUsage Data</title><body><div class='progress'><div class='progress-bar' role='progressbar' aria-valuenow='36' aria-valuemin='0' aria-valuemax='100' style='width: 36%'><span class='sr-only'>36% Full</span></div></div></body></html>[alarm@alarmpi ~]$ df
Filesystem 1K-blocks Used Available Use% Mounted on
dev 464456 0 464456 0% /dev
run 471116 312 470804 1% /run
/dev/mmcblk0p2 1929616 1412004 401544 78% /
tmpfs 471116 0 471116 0% /dev/shm
tmpfs 471116 0 471116 0% /sys/fs/cgroup
tmpfs 471116 0 471116 0% /tmp
tmpfs 94220 0 94220 0% /run/user/1000
/dev/sda1 7612888 2745304 4867584 37% /mnt/usbshare

Works.



Edited 1 time(s). Last edit at 03/18/2017 11:35AM by Matthias.
Re: RPi3 + USB = No Space?
March 18, 2017 01:26PM
What I can verify is, that pressing the "refresh" button does not trigger the reload of the bar.
But with F5 , that worked...
Re: RPi3 + USB = No Space?
March 18, 2017 06:15PM
How strange I will attempt to re-flash it again after work today, thanks for all the research!
Re: RPi3 + USB = No Space?
March 18, 2017 06:57PM
I found the issue and there is already a beta image available for testing (ask IRC).
This fixes the diskusage issue including some similar issues with the shoutbox.

best regards
Matthias
Re: RPi3 + USB = No Space?
March 19, 2017 07:31AM
[imgur.com] here is the screenshot of the bar