I've recently just installed ubuntu 14.04 and i'm still very new to linux/ubuntu. I've got a laptop in which i have installed an 120GB SSD and a 750GB HDD. Currently, i have ubuntu installed on the SSD and mounted the HDD through fstab to /mnt/var. Now the thing is i want to have programs installed on the HDD and keep the SSD clean for ubuntu. As far as i understand programs are installed in the /var directory, and so i have been trying to copy the current data from /var to /mnt/var and then editing fstab to mount the HDD to /var. But whenever i reboot i get alot of different issues. First it said it couldn find drivers etc. Than after another try doing it a bit different it just plainly couldn't find /var. So my question here is, and i'm sorry if this has been asked before but i followed a bunch of different guides and none worked for me, how do i properly set it up they way i want?
That's a bad idea. If you put the installed applications on the SSD you'll get a more stable operating system and better performance. You've got a 120GB SSD, so you should not hesitate to use it for your installed applications.
Your 750GB hard drive is certainly not there for nothing. Here is my suggestion for how to use the 750GB hard drive optimally. Install Ubuntu on your SSD, including your /home directory, EVERYTHING goes on your SSD. Then use your 750GB hard drive as a data drive to store your personal files. No matter what happens to your operating system, your personal files will be protected and accessible on the 750GB hard drive. Even if your operating system becomes completely unusable or if you do a fresh install of Ubuntu, all of your personal files will still be there intact on the 750GB hard drive.
You don't need to worry about your 120GB SSD being too small. A 120GB SSD has more than enough space to install Ubuntu in this way. In fact even a 60GB has more than enough space for Ubuntu and a lot of installed applications.
On my Ubuntu there are a few files that I use regularly. In order to improve performance and open these files fast, I keep these files on my SSD too in my /home directory. I don't have many of these files, so my /home directory is quite small.
Ok, first, the answers I have seen do not address the 2 most important issues.
First, although I applaud your diving in and trying something, the reason you have run into problems is due to an incomplete understanding of the linux directory structure. Please confirm what follows before blindly following my advice as I am not a regular user of the *buntu flavors of linux, but...
Applications are not (in my experience) generally found in /var, (there are exceptions), most applications are found below the /usr directory, /var is (in ubuntu) used for server related files, logs and caches. also things which would be lost on reboot if stored in /tmp.
There is a tradeoff to be made. /var on a fast drive (such as an ssd) will improve system performance, but due to specifics of ssd drives, may reduce (somewhat) the life of the drive due to more frequent writes.
Nutshell, faster performance, /var on ssd, longer drive life, /var on your 750GB drive.
For reference, all of my system files (openSUSE 13.1) and the whole system directory structure (including /var) exist on a single 64GB ssd.
Karel's information about your data is a little misleading (I believe), in that your data and /home directory are closely tied. My suggestion, mount /home on a partition on the 750GB Drive. This will simplify file management in the long run.
My data and website are the only things not on the ssd, my data (/home, /srv/http are kept on separate drives to ease upgrades or moving to other distributions. (I have files in my /home directory that were created in 1998)
I will answer how to move /var in a post that follows
Me again, BTW I do agree w/ Karel that doing your base install to the ssd is the best option. I also recommend reading a few other tutorials before following my directions.
NOTE: it is much easier to configure your system during a fresh install,
Now if you do wish to create a new mount point for /var there are numerous things to consider.
Some directories will be harder to move because files may be in use, /var is one of these problem children. Anytime your system is active it is likely that data is being written to /var
Another consideration is maintaining the correct file attributes, copy will not do this without the proper flags.
these links could help get you started,
NOTE: I prefer using tar over cp, it is faster and I know it will preserve my file attributes, something like the following (a quick example, some steps have been left out for simplicity)
DO NOT FOLLOW THESE DIRECTIONS WITHOUT UNDERSTANDING WHAT IS BEING DONE
(replace sdxx with the 50 GB partition you created for your new /var, for example /dev/sdb1)
mount your ssd as /mnt/oldroot
(here /dev/sdxx is the / partition on your ssd, probably /dev/sda1 or similar) You should be able to navigate your old filesystem now, starting at /mnt/oldroot
now you will copy the files from the old /var directory to the new one
when the copying finishes, compare the 2 directories, if everything looks good rename the old /var directory
All that is left is to edit /mnt/oldroot/etc/fstab to add the new partition as the mountpoint for /var (I will leave this to your imagination)
If all went well, when you reboot the new partition should be mounted as /var