lindum
Posts: 45
Joined: Wed Apr 15, 2015 2:01 pm
Location: UK

Memory shortage

Fri Aug 21, 2015 9:05 am

Although my Pi is running well, I'm slowly running out of memory. The micro sd card is filling up and I'm not sure what happens when it does.

I've got some spare USB sticks (16 & 32gb) that I can use, but I don't know how to get the Pi to use those instead of continuing to use the sd card.

Is there a way of making the USB stick the default when the Pi wants to save something in memory.

Thanks a lot.

Lindum.

My apologies if this doesn't come under the correct heading, but it seemed to me to be too technical to put in general.
Michael.

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Memory shortage

Fri Aug 21, 2015 9:13 am

Have you expanded the filesystem to fill the whole SDCard?

What's it filling up with? Logs? *.deb package files?

You can move the rootfs to a USB device but that won't stop the junk being collected.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
RaTTuS
Posts: 10559
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: Memory shortage

Fri Aug 21, 2015 9:51 am

does
df -h
show it being full

also
sudo du / | sort -n
may help
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

lindum
Posts: 45
Joined: Wed Apr 15, 2015 2:01 pm
Location: UK

Re: Memory shortage

Fri Aug 21, 2015 3:12 pm

For a moment there I thought Jason Statham was replying to my post. LOL

I bet you get that all the time, Dougie.

Well it seems I've still got 3gb left on the micro sd card which which I expanded when I first flashed the image, but sooner or later that's going to disappear and as I want to make the first Pi (B) into a server, I think its a good idea to make sure there's plenty of space should it become an internet sensation. (I'm getting a bit ahead of myself here)

As the 3 16gb USB sticks that are connected at the moment, haven't shown up yet, so I expect they need mounting, but I'm not sure how to do that.

Thank you both for replying.

Michael.
(Lindum)
Michael.

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Memory shortage

Fri Aug 21, 2015 3:41 pm

lindum wrote:For a moment there I thought Jason Statham was replying to my post. LOL
That's completely unlikely, since I haven't the first faintest clue who he might be.

If you mount stuff you'd have to decided in advance which part of the filesystem you're going to move on a directory by directory basis also that has to be done before you attempt to use it. It would then be on a one directory per partition and a monster pain in the tail.

One option is to move the whole root filesystem from the SDCard to a USB device, there's plenty of tutorials out there to do that.

The fastest and dirtiest way to get some space back is
sudo apt-get purge wolfram*
sudo rm -R /var/log/*gz
sudo rm /var/cache/apt/archives/*.deb

I think you'll get a surprise at how much space you win with that.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

InsideJob
Posts: 58
Joined: Sat Jul 04, 2015 3:00 pm

Re: Memory shortage

Fri Aug 21, 2015 4:44 pm

Instead of manually clearing out the cache of downloaded packages
apt-get clean
if you "man apt-get"
clean
clean clears out the local repository of retrieved package files. It removes everything but the lock file from
/var/cache/apt/archives/ and /var/cache/apt/archives/partial/.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26659
Joined: Sat Jul 30, 2011 7:41 pm

Re: Memory shortage

Sat Aug 22, 2015 9:01 am

DougieLawson wrote:
lindum wrote:For a moment there I thought Jason Statham was replying to my post. LOL
That's completely unlikely, since I haven't the first faintest clue who he might be.
He's an Eben Upton lookalike.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Memory shortage

Sat Aug 22, 2015 10:33 am

jamesh wrote:
DougieLawson wrote:
lindum wrote:For a moment there I thought Jason Statham was replying to my post. LOL
That's completely unlikely, since I haven't the first faintest clue who he might be.
He's an Eben Upton lookalike.
In that case does that make me into an Eben look-alike?
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

drgeoff
Posts: 10765
Joined: Wed Jan 25, 2012 6:39 pm

Re: Memory shortage

Sat Aug 22, 2015 11:23 am

I don't know which of the three to have the most sympathy for. :D

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Memory shortage

Sat Aug 22, 2015 11:37 am

drgeoff wrote:I don't know which of the three to have the most sympathy for. :D
I have the perfect face for radio, you should have seen my old passport/driving licence photo. That was seriously ugly.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Return to “Advanced users”