hisholyhighness
Posts: 6
Joined: Fri Jul 13, 2012 2:50 pm

Installing software on external storage

Mon Mar 23, 2015 1:20 pm

Hello All!

I have attached a 16GB USB stick as external storage for a website I want to host from my Pi.
I have install the Flask web framework onto it too. I can imagine installing more Python
libraries in the future.

Considering the limited storage space on the Pi, is there a way to specify
a default 'installation' directory on the USB stick or any external storage so as not to clog up the Pi :?

Ideally I want to do a

Code: Select all

sudo apt-get install something
or a

Code: Select all

pip install something
and for any library or dependency to automatically be installed on the default folder I specify on the USB
stick.

Please advise :)

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

Re: Installing software on external storage

Mon Mar 23, 2015 2:07 pm

It doesn't work like that.

Software you install is variously stored in /bin /sbin /usr/bin /usr/sbin /usr/local/bin or /usr/local/sbin. Libraries you install are stored in /lib /usr/lib or /usr/local/lib.

To move stuff to a USB stick you'd need to move a whole filesystem. That could be / (root) /usr /lib /bin or /usr/local. Doing that for the root filesystem is well documented.
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.

cpc464
Posts: 239
Joined: Tue Jul 08, 2014 5:10 pm
Contact: Website

Re: Installing software on external storage

Mon Mar 23, 2015 5:42 pm

Also there should be plenty of space on the SD card for installing stuff. If you are running out, perhaps consider getting a bigger card, expanding your installation to fill the current card if that has not already been done, or moving application data onto alternative storage.

For example if you had a pi camera taking pictures and putting them in /var/www or whatever, change it to put them on a usb stick instead.
Unix engineer since 1989

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 5618
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: Installing software on external storage

Mon Mar 23, 2015 6:11 pm

Whilst @DougieLawson is correct w.r.t. software locations for "packaged" software installed via apt-get, pip etc. it's not necessarily the case for software built (re-compiled) from source. Where makefiles are in use, such may allow the install destination directory to be somewhere else than the "standard place". Whether one should do so is another matter.
cpc464 wrote:Also there should be plenty of space on the SD card for installing stuff. If you are running out, perhaps consider getting a bigger card, expanding your installation to fill the current card if that has not already been done, or moving application data onto alternative storage.
For example if you had a pi camera taking pictures and putting them in /var/www or whatever, change it to put them on a usb stick instead.
+1 especially for using the USB stick for data storage - this is more or less what I do with my original, B1, Pi on which I run a wiki, based on a USB stick, to generate and export the "Raspberry Pi parts" of my webpages.
Trev.
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B+, P3B, B+, and a A+) but Buster on the P4B's. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

hisholyhighness
Posts: 6
Joined: Fri Jul 13, 2012 2:50 pm

Re: Installing software on external storage

Mon Mar 23, 2015 9:21 pm

Thanks, understand the situation and limitations clearly now :)

Return to “Beginners”