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.
It depends on your size of the drive. If you have a big enough drive you could have different partitions /, /boot, /var, /usr and all. But it all depends on your use as well.
I have installed server without different partitions and everything on / and just boot and swap as different.
If you will be using LVM or RAID, you want to have a separate partition for /boot. If you will be installing more than one distro, you can use the same /boot partition and edit the grub.conf file to boot each distro. Being small it is easy to create a image backup copy of your boot partition.
Having the /home directory on it's own partition will make it easy to change distro's or add another distro and not have to reformat it. IMHO, for laptop installs, fewer partitions are more common than on a desktop. You are usually more limited in disk space, and having system directories on the same partition is more flexible. For example you don't have to worry as much that /usr will fill up when you install more software.
A server will be more likely to have separate partitions. Having /tmp on it's own partition allows mounting it with mount options such as noexec, nodev and nosuid. A separate /var/ partition will prevent a server from crashing because someone fills up free space with logs. An installation won't touch /usr/local. This is where programs you compile yourself are likely to go. Mounting /usr/local on it's own partition would allow you to reinstall and keep these programs, if you opt not to format the partition.
My question is, it is always better to have /boot as separate partition,
No, it is not *always* better to have /boot on a separate partition. For laptops with only a small mount of disk space I usually put everything in one partition (+ swap), it just makes things easier when you are running low on space. However, for desktops and servers (where it is easy to replace/add disks) I always break it down into separate /var, /tmp, /boot, /usr, /home.
what are the other filesystems that need separate partition ?
None need it, except if you count virtual file systems like /dev, but the os looks after this for you: it does not use a physical partition.
You don't even need swap, so the original question could have been answered with a single character
There you go. A complete answer to the question that you asked. However, the question 'what partitions is it desirable to have? is more complex and depends on the circumstances. How about telling us something about the circumstances, so we cabn have a go at answering that one too, without writing a 100 page manual.
Need one partition for / and different swap partition.
you don't need a swap partition, if
you have enough ram and you are not hibernating
if you use a swap file instead of a swap partition
and where do you think that embedded Linux devices put their swap partition? Deeply embedded devices don't have anywhere useful to put a swap partition, so, given that they can't have one, they don't need the swap partition.
I wouldn't recommend running without a swap partition(for any OS) some applications use swap to store memory pages (for various reasons) no matter how much RAM you have.
That's useful to know. I have some desktop systems that run without swap, apparently without problem, so (at risk of stating the obvious) it does depend on which apps are being run. Is there any pattern to the types of apps that use swap? Perhaps database systems use swap as "scratch space" ... ? All the same, it would be quicker to use memory ... ? Now I'm intrigued -- what sort of reasons might an app use swap for?