• Welcome to iHelpForum - the place to get help from knowledgeable techs in all areas of Tech, Home and Auto help. Consider checking out our Guides or Registering an account to post on our forums today.

Solved Raspbian Pi help, please

DCiAdmin

Always room to learn a bit more
Administrator
iHF Legend
WCG Team Member
Of all the places to find a post from me - here in the Linux forums :)

The Lego "temp bot" at the office is driven by a Raspberry Pi with Raspbian Linux installed on an 8 GB SDHC card. There is a 56 MB FAT boot partition, a 2.7 GB Ext4 partition (Raspbian installation and apps?) and 26.96 GB unallocated partition.

At boot, the Pi [warn] Root filesystem has insufficient free space; mounting tmpfs on /tmp ... (warning). I believe that's because the Ext4 partition is 94% in use. I have found this link with instruction to extend the Ext4 partition, but before I trial it, I want your opinions.

Good to know stuff: I have taken an image of the original 8 GB SDHC and have created a 32 GB SDHC copy that I will use as "guinea pig". A copy of the image is also on the work network.

Today's good find: Fix for Volume was not properly unmounted ... The post from ripat (Wed, Mar 12,2014) was my fix for that error. Unfortunately the updates generated from that fix are what likely filled what little free space I had in the Ext4 partition.
 

apemax

Linux user
Moderator
iHF Regular
Hey DCI,

So if I'm understanding right you want to increase the size of the Ext4 partition (Which is where Raspbian is installed) to fill all the unallocated space? The easiest way to do this would be to put the SD card into a PC (Or VM) running linux (As Windows to my knowledge can't read Ext4 partitions.) and use something like gparted to basically increase the size of the partition.

That link should also work although you would have to ignore the parts about the swap partition as Raspbian last time I checked doesn't use a swap partition.
 

DCiAdmin

Always room to learn a bit more
Administrator
iHF Legend
WCG Team Member
Peter,

Could I do this if I boot my Windows PC from a Linux Live CD?
 

DCiAdmin

Always room to learn a bit more
Administrator
iHF Legend
WCG Team Member
Woot, Woot! Got that accomplished. New question, if you don't mind.

The startup used to successfully run a Python script at start-up. Since repairing the filesystem yesterday, the script errs out with
python: can't open file '//www/AC/resetservo.py': [Errno2] No such file or directory.

I am able to open and run this after logging in using the following
cd ~/www/AC/
sudo python resetservo.py
Any ideas what might have changed and how I can repair the startup run functionality?

EDIT: Just found this. Either of the top two options looks perfect for my needs. Your thoughts, Peter?

EDIT_EDIT: I just tried placing the command in the crontab and that's a fail. Or an issue between user intelligence and keyboard :)

EDIT 2 Prior EDITs: The issue might be that the repair blew out the functionality of Apache to execute py commands. Trying this to resolve. Nope. The message after trying that is - leafpad: Cannot open display

btw, your help is GREATLY appreciated!
 
Last edited:

DCiAdmin

Always room to learn a bit more
Administrator
iHF Legend
WCG Team Member
The main thing that I'm trying to get working again is this -

At reboot, startup used to successfully run a Python script at start-up. Since repairing the filesystem yesterday, the script errs out with
python: can't open file '//www/AC/resetservo.py': [Errno2] No such file or directory.

I am able to open and run this after logging in using the following
cd ~/www/AC/
sudo python resetservo.py
Any ideas what might have changed and how I can repair the startup run functionality?
 

DCiAdmin

Always room to learn a bit more
Administrator
iHF Legend
WCG Team Member
-rw-r--r-- 1 root root

All python commands in that directory have the same permissions. Unfortunately, I have no idea what they were prior to repairing the filesystem (if that's what changed things) or why it would have changed....
 

apemax

Linux user
Moderator
iHF Regular
I think I just found your problem, It looks like they aren't set as executable any more. To set resetservo.py as executable run this command:

sudo chmod +x resetservo.py

If you want to set all .py files in the same directory executable at the same time run this command:

sudo chmod +x *.py

Where they owned by the normal user and not root before? ie, could you open and save them without using sudo?
 

DCiAdmin

Always room to learn a bit more
Administrator
iHF Legend
WCG Team Member
I wish I knew, Peter. Today is my 2nd day in this nifty little thing. I was wondering if that might be it. I'll let you know in minutes.
 

DCiAdmin

Always room to learn a bit more
Administrator
iHF Legend
WCG Team Member
Ugh - no change at reboot. Same error.
 

DCiAdmin

Always room to learn a bit more
Administrator
iHF Legend
WCG Team Member
doing an ls -l up one level, the AC folder shows the following permissions:

drwsrwxrwx 2 pi root
 

DCiAdmin

Always room to learn a bit more
Administrator
iHF Legend
WCG Team Member
Ok, I just realised it's probably happening because they are owned by root, Try changing the owner of them to the normal user you use by running this command in the directory with the python scripts in:

sudo chown username: *.py

Changing "username" to the username of the normal user you use.
but the error occurs before my user pi has logged on. Wouldn't that mean that it is root that runs the PY?
 

DCiAdmin

Always room to learn a bit more
Administrator
iHF Legend
WCG Team Member
I am wondering if the guy that programmed this used ~/www/AC/resetservo.py as the path and not whatever the ~ replaces. Perhaps he hasn't got the full path there and for some reason the filesystem repair fouled that access. I'll try to find the file that runs that python command.
 

apemax

Linux user
Moderator
iHF Regular
but the error occurs before my user pi has logged on. Wouldn't that mean that it is root that runs the PY?
Not necessarily, As technically root hasn't logged in either. If apache has been set up by the pi user then it won't have permission to access any root files, even if it is set to run a startup before any user logs on.

I am wondering if the guy that programmed this used ~/www/AC/resetservo.py as the path and not whatever the ~ replaces. Perhaps he hasn't got the full path there and for some reason the filesystem repair fouled that access. I'll try to find the file that runs that python command.
Well ~ is the currently logged in users home directory. So for the user pi that would be /home/pi. The full path then should be /home/pi/www/AC/resetservo.py.
 

DCiAdmin

Always room to learn a bit more
Administrator
iHF Legend
WCG Team Member
Well, foo! I've tried a reboot with both the sudo chmod +x *.py and sudo chown pi: *.py commands in place at the same time and no change. I still receive the error.

I'll look for the file next and see if it's a shortened path or the full path. Your help today, Peter, is GREATLY appreciated! I'll be leaving the office in about 15 minutes, so I won't be bothering you further tonight.
 

Highlander

The Immortal
iHF Master Craftsman
Advisor
WCG Team Member
apemax - been following this thread. You've been doing a great job at helping Terry. I always found Linux experts often assume you know what they are talking about. You however provide the command line needed to do what you are suggesting. That is a great way to ensure your point gets through. Again, well done.
 

DCiAdmin

Always room to learn a bit more
Administrator
iHF Legend
WCG Team Member
apemax - been following this thread. You've been doing a great job at helping Terry. I always found Linux experts often assume you know what they are talking about. You however provide the command line needed to do what you are suggesting. That is a great way to ensure your point gets through. Again, well done.
And for *that*, I am beyond grateful!
 
Top