Best disk partition for normal users
I have a new clean HDD in my laptop on which I want to install Ubuntu 11.10. So, as I have very less (in fact nothing) knowledge on Linux File System hierarchy, I thought some would be helping me to choose the best one.
Here is what I briefly do on Ubuntu.
- Learn programming (should maintain my project files) # I am a student. (Sometimes, I had to install few external packages too. Though they never were more than 200 MB each)
- I use software's like Matlab, Netbeans, Eclipse etc.
- Store lots of music, movies, photos
- I have a good set of ebooks, office documents (includes documentations of packages).
- Download many files..
This is what a normal user would probably do.
What I am actually searching for is that, how do I maintain all those file if I have created only 2 partitions "/" and "/home". Of course, all of these would come under "/home". Wouldn't they look messy??
I windows, I could create 4 partitions, each of them I use for different purposes.
Actually, I have gone through Ubuntu Linux File System hierarchy and got to know that each directory has some special significance. Thus each directory should be used for their respective purposes (as recommended).
So, I want to know how should I partition my HDD and what directories should I mount them to those partitions and what kind of files should I place in them.
Solution 1:
The good thing about Ubuntu is you really don't need to worry about disk partitions. If you are a normal user, and from your description, you are, you can go with the defaults quite happily, unless you have a burning desire to mess around, or if you have something which could increase in size in such a way as to fill up a partition (eg logging very verbose logs into /home could end up filling it and causing you problems, so doing that is generally not recommended)
Filesystems under unixes are not messy once you understand the structure - it is actually much more straightforward than Windows, for example.
You can of course move any part of your filesystem wherever you want - I tend to have my main music store (an external terabyte disk) mounted at /home/music but I could have put it anywhere.
Default under Ubuntu: Two partitions
- /
- swap
Common alternative: Three partitions
- /
- /home
- swap
Solution 2:
The data you will do with could be defined such useful way:
- OS files come from installation
- Various settings defined on per user basis - .bashrc, .vimrc, and most of those hidden sub direcories in users home directories
- optional packages you'll want to install later in /opt, /usr/local
- A lot of media files: movies, music, photos, ebooks, etc.
- Backup data. In case you don't have a separate drive (internal or external) you may find useful to have backup partition to save your data from deletion by mistake or from accidental damage of origin partition.
It is convenient to separate these sorts of data. The obvious division is sorting out media files to separate partition. It is convenient to keep your home clean and small,e.g. to speed up grep-ing and find-ing in it. Also to simplify archiving and backing up. There are other reasons for data partitioning.
I partitioned my 1Tb disk such way:
Filesystems Size Used Avail Used% mounted
/dev/sda3 1008M 408M 550M 43% /
none 493M 292K 493M 1% /dev
/dev/sda7 5,0G 196M 4,5G 5% /tmp
/dev/sda5 97M 52M 41M 56% /boot
/dev/sda10 35G 4G 31G 11% /home
/dev/sda6 15G 6,6G 7,5G 48% /usr
/dev/sda8 9,9G 1,3G 8,1G 14% /var
/dev/sda9 693G 62G 596G 10% /data
/dev/sda11 158G 15G 135G 10% /backup
I use my ubuntu about 2 years and data fit given limits with significant reserve. But now I find that putting /boot, /var, /tmp and /usr to separate partitions is redundant, and if I need I divide my disk a bit different way:
4G swap of doubled RAM size
30G /
16G /home which will contain users application settings and documents and specific software like RVM (ruby version manager)
750G /data with large and numerous media files
200G /backup
Also I find useful to make ~/Downloads, /opt, ~/Music soft links to /data subfolders I also use backuppc which automates backing up to backup partition.