Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Technically all you need is /, but having a swap is a good idea of course . Generally you don't need to split them off unless you really know why you are doing it. For some of the VPSs I manage, I generally I split off /, /tmp, /boot and a swap partition. I split of /tmp since mainly dealing with servers as a I do it's a very good idea to lock /tmp down as much as possible to help protect against rootkits (I have seen other people's servers get compromised by /tmp in the past). I keep /boot seperate for management over grub.
Really you can go right down into different mount points on the hard drive but you should know exactly why you are doing it, else wise just leave it as standard you won't really notice anything other then not having a SWAP.
For a desktop, with a single user, I would recommend having /, swap and /home. Having a separate /home partition will allow you to reinstall and by not reformatting /home, retain your old data. I'd recommend changing the name of your home directory (such as adding -old to the name). Then you can move documents from your old home directory to your new one.
Some distro's use a different UID number range so you may need to use "chown" to fix that if you go from Fedora to SuSE for example.
First, decide what the function of the computer is. If it is going to be a server (web, ftp etc) then I will weight partitions more toward /var at the expense of /home.
But you're probably talking desktop. So here's how I would do that drive:
5 GB / (root) this is where boot info, e.g. kernel live
1 GB swap ...more if you plan to suspend/hibernate
9 GB /usr where apps are installed. 9 GB is hard to fill...
5 GB /var on this drive, a server would get 100 GB from me...
the rest /home - 5 GB for a /tmp>
5 GB /tmp
on occasion I make a /var/www or /var/ftp separate, makes it easier when doing reinstalls or upgrades, you can choose not to format and save everything. (same with separate /home)
50 GB /
1 GB swap
190 GB /home
I prefer to separate partitions as above. I've found it makes maintenance, troubleshooting and pulling off miracles much easier.
My question to 'catworld' is why so much for '/' since you are allocating partitions for '/usr', '/tmp' and '/var' along with a '/home' partition? The space requirements for root would not be 5GB with the scheme you suggest but wasted space. That is unless this is intended to be a testbed with things in 'opt'. But even then 5GB is a lot of space for 'root'.
Yes, for options. Custom kernels, multiple systems (on other drives in e.g.)
Couple of months ago I had a 4 GB / and attempted to upgrade a Mandriva system to 2009 and the root was full, it was no go even after trying to remove whatever I could get away with. Had to repartition everything. Never again. (used to happen all the time in the 20 GB drive era...)
My '/tmp' is large because I do a lot of work with 'iso' and other large images. The cost per byte has really gone down. I'm spoiled with todays hdd systems. I can remember my first hdd that was 10MB and I thought I was in heaven. At that time floppies were great, much better that tape. But when I got my hands on that 10MB hdd things were fast as compared to floppy or tape. I'm spoiled!
The overall size of a Linux distribution is usually less than 4 Gig plus swap of about 1 Gig plus the size of your user data.
/boot is pretty small. Mine is about 16 Meg. In the days when I used a separate /boot I used 512 Meg.
/home is also fairly small when first installed. It can increase in size significantly if you have a lot of user data.
/usr takes about half of your system space. My /usr uses 1.6 Gig out of a 4 Gig partition.
/var holds log files and some package managers store downloaded packages in the /var cache. Right now without any downloaded packages my /var uses 175 Meg out of a 4 Gig partition. Servers will use a lot more log space and you will also use up more /var space when you are making major software upgrades.
/opt is not used by some distributions. If your distribution does not use /opt then a /opt partition is a waste of space. If your distribution uses /opt then it will put about 40% of /usr in /opt. So if you use /opt then make /opt about 1.5 Gig and /usr about 2.5 Gig.
I have a 1 Gig swap partition which is more than enough. If you start swapping a lot your system will slow down dramatically. You will either buy more RAM or cut down your RAM demand. The only time that swap size is significant is if you use the suspend to disk function. Then you need a swap size of about 1.5 times your RAM size.
You can use the du command to find out how much space a directory tree is using. The command to find out how much space /home is using is:
I know that only two partitions "/" and "swap" is sufficient to install
linux. I am doing the same.
I think that it is possible to separate usr,lib,share,local, and several
other directories in different directories. I'm confused is it possible?
If it is possible then what should be the minimum size of each partition?
I'm using 240 GB of Hard Disk?
Any directory entry can be a partition. Whether it's useful to split them out is a different story. For a home user, I'd put 20GB in "/" and the rest in a new "/data" partition. Commercial server admins generally know what they will need where, and have different needs from the home user, anyway.
Some find it useful to split out "/home", but I have my doubts, especially in a situation where you're multi-booting and decide to try to share that "/home" with all your Linux distros. I prefer to have all my data in one place and let each distro have it's own /home. If you decide you need to reload, it's simple enough to run "rsync -a /home /data/home" or something like that, in order to save your "/home" directory.