• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 548
  • Last Modified:

change app directory in Linux


I just set up a new system where I have a dual boot of Win 7 along side Ubuntu 12.04.

My boot drive for both OS's is an SSD, and then I have mechanical shared storage (formated as NTFS).

In Ununtu, I need to install a few large applications including products from the Hadoop universe.  I don't want to put all these on the SSD, but rather on the mech drive.  

I managed to use Tweak to change the downloads directory, but can I somehow change the location where apps are installed to be on the mech drive so I save my SSD?
  • 4
  • 4
1 Solution
Yes, you can mount the mechanical disk anywhere you want.
Usually /usr/local is a prefix used to install "use"r provided/required applications.
If you are using packages, either get packages that are /usr/local or during install use a relocate option that will change a package designed for /usr to /usr/local

The difficulty I see deals with the mechanical drive having an existing NTFS partition.

You might want to consider an option that you can shrink the existing NTFS partition and then creating a new partition that will then mounted as suggested above.
ugebAuthor Commented:
Currently my hdd's (2 of them) are mounted under /media.  I didn't set that mount point, Ununtu did it automatically.  The drives are labelled WD1 and WD2.

Where are installed apps located (analgous to "Program Files" in Windows)? In my Home Folder, the major directories I see are Home, Desktop, Documents, Downloads, Filesystem and pictures etc.  When I go into my shell, I see that those are all subdirectories of my user.

I have no problem making another ext4 partition for Linux apps, just as long as I can share documents between the two OS's.  Windows can't do anything with Linux apps anyway, so it won't matter if it can't read that partition.

I'm unclear how /usr/local fits into the equation.  There already exists /usr/local with these subdirectories:

bin  etc  games  include  lib  man  sbin  share  src

Are you saying that I switch the mount point of WD1 (currently under /media) to be under /usr/local?  I'm fuzzy on all the details here.  How do I switch the mount point?  How do I tell Linux to use the new location for installed apps?  Is there a detailed  guide somewhere that can take me through that?

The place where you mount is up to you.  You can look at /opt.
You have the flexibility to mount the partition anywhere you want provided you take into account that where you mount the files does not interfere with the system's functionality.
A proven path to a career in data science

At Springboard, we know how to get you a job in data science. With Springboard’s Data Science Career Track, you’ll master data science  with a curriculum built by industry experts. You’ll work on real projects, and get 1-on-1 mentorship from a data scientist.

ugebAuthor Commented:
You're talking about sysadmin stuff, which I don't do.  Right now I can't use any info you've provided as it's too vague.

Can you give me explicit steps or direct me to one or more sites that will take me through this?
There is no specific way I can tell you to mount.
You can create a new location
mkdir /newlocation and mount the new partition here.

The difficulty is adding the /newlocation to the path,
ugebAuthor Commented:
I'm sorry, but this isn't helpful yet.  I don't know how to do what you're saying.
What level of access do you have on the system?

In general terms applications are in /usr/bin that is OS vendor provided
/usr/local/bin usually use required/needed application
/opt/bin is an optional location where applications can be installed.

Your SSD already has /usr/bin so overlaying mounting the new Harddrive there is not a viable option.
The same applies to /usr/local/bin
The remaining standard place is /opt

If all those locations are in use by existing application/software an option is to copy the data or create a brand new location where you would mount the extra partition from the hard drive.
Install what you need in this new location, then in order for you to be able to type the command and it be found, there is a variable set in Linux PATH that is used to search for command/application.

Hopefully, this clears things up for you.
ugebAuthor Commented:
I'm not going to have time to test this out right now, but thanks for the help.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now