What's the real reason to divide the file system in various partitions, like home, var, tmp?

Hi everybody.

I’m investigating a lit about this, and wanna check some opinions around, and well that is the question:

I always wonder what benefice could I get if when in a install I place the /home, /usr, /tmp, /var in different partitions like some installers around always recommend.

Just curious about. In my case I always do only two partitions, Swap and /.

Cheers!

Very simplistic answer has something to do with being able to reinstall/install/change/configure one partition while leaving another unchanged. So if you kept all your personal files in a seperate home partition when you did new installs/changes/etc to the / partition you would still have all the previous personal files preserved.

I also think some FS are better suited to particular types of tasks depending on the type of build you want. For instance /var and all its small log files etc. is supposedly better handled by ReiserFS which apparently handles lots of smaller files better.

Usually most people say users like me (newbs, non-power users) really only need Swap, /, and maybe /home to be on separate partitions.

For a better explanation than that you will have to wait for someone who really knows what they are talking about to respond. :wink:

IcarianHeights has given a pretty good summary.

Chopping up the installation into lots of partitions is usually only done by sysadmins who want to optimise the configuration for a particular workload. The risk of lots of partitions is the free space gets fragmented.

The 2 or 3 partition setup suffices for most users.

I agree with IcarianHeights. I recommend you change your policy here, and always do Swap, / and /home. You will find that by default, most Linux installers for various distributions will setup those 3 separate partitions by default.

Some users will put /boot on a separate partition because of different file systems in use (I think there is a file system, xfs ?? , that will not function well if selected for the /boot partition). Some users who have a server running in a business environment, will choose to put a specific /something (sorry I can’t remember what ‘something’ is) on a separate partition, … possibly /var … (I can’t recall).

But in general, as a regular desktop user who uses ext3 or ext4 file system, stick with swap, / and /home. Of course the obvious advantage of having /home separate, is one can do a complete CLEAN re-install (but keep /home) and when one restarts after the re-install, one has all of one’s data and configurations still present by the vary nature of keeping /home (for many desktop and application configuration files are stored on /home as hidden files/directories starting with a “.” (dot) ).

Here is one users view (which I don’t completely agree with): The importance of Linux partitions … but despite some disagreement on my part, what is interesting is their views on the reasons for various partitioning. In many respects, Linux is about choice (as an offshoot of being free per the free software foundation definition of free) and hence one has the choice to setup all sort of weird and wonderful configurations.

Sometimes it’s also for speed…if you put your swap on the outside of the HD if it’s needed it will read data faster because the the disk spins faster on the edge than it would nearer the center. On the other hand, if you have data that is acessed more frequently like /lib fr’instance it would be better if it were placed in a more centrally located portion of the disk where the read head spends most of it’s time…It’s all about seek time and read time…:wink:

Well this choice actually predates Linux and open source software. It was inherently possible with the Unix concept of mountpoints. As opposed to exposing “disk drives” to the user by you know which OS.

It’s possible with any OS. If you have a reasonable amount of control over the partitions…

Pay attention to the little things…they will add up

Like my Drill Sergeant told me…“Your bed can’t be perfect if you wrinkle the bottom sheet”…

Oh! Thank’s everyone for answering this post… I’m glad to see so many points of view.

I thought about using ReiserFS for the /var directory, but I have various scenarios.

First, my desktop its a lot of things, like Web server, Database Server, and Data Storage, for Backups and Everything, and I use that machine a lot for work, program, surf the web. I’m of those who think that only two or three partitions are enough, but now that I think about performance and get a rock solid system i have my doubts in that approach.

So I have:

First HDD , 1 partition for / and another for swap.
Sec HDD , 1 partition for data (video, music, backups)

My doubts began with some system crash that I’m having from time to time that I think are some fails in the HDD, so I was wondering if this could be avoided if I had my first HDD more split and better organized according the types of file system in all the partitions.

What do you think about?

Thanks again in advance for all your help :wink:

If you think the disk has problems there are ways of checking on this, e.g. with smartmontools. Data loss is data loss and there is no point trying to fiddle with your partitions to compensate for a hardware problem.

Just keep it simple: swap, / and /home on first disk and other data on second. Avoid reiserfs, there is less and less support for it going forwards. ext4 is fine as a general purpose filesystem. Don’t worry about the small improvements from complicated partition arrangements, for most people it’s not worth the hassle.

Recently, I got a problem with openSuse 11.1. I simply could not get in. Something was missing, error 15, and after striving to repair or recover my system the problems persisted.

I then did a new and fresh installation. As my personal data and work documents were on a separate /home partition, everything when OK.

From a final user, newbie, point of view this is a good reason to have these partitions. I have three /, /home, and /swap.

On 2010-08-28 07:06, alexbariv wrote:
>
> Hi everybody.
>
> I’m investigating a lit about this, and wanna check some opinions
> around, and well that is the question:
>
> I always wonder what benefice could I get if when in a install I place
> the /home, /usr, /tmp, /var in different partitions like some installers
> around always recommend.
>
> Just curious about. In my case I always do only two partitions, Swap
> and /.

There are many reasons, and most have been already said in this thread.

A very old one is limitation of damage: if a program goes berseck and fills up all the space, for
example with a lot of files in /home or /tmp or /var, the system will crash - except perhaps if that
directory happens to be on a different partition, then / will not be filled up.

Or, if you have a filesystem crash which totally destroys a partition, well, it is only a partition,
not all of them.

Then, you can tune each partition for its uses. The article “oldcpu” mentioned is very interesting,
regarding the mount flags for /tmp or /home. There are anothers. The /var/mail (when maildir is
used) or /var/spool/news/ directories, I like with reiserfs - because they have zillions of small
files. I also like xfs for /home, ext3 for / , and ext2 for /boot. Compilation runs, I think, faster
on reiserfs, too.

Another reason is upgrades: like in windows you should have system C: and documents in D: (a
practice that even manufactures forget), in linux you should have /home separate (and probably
/usr/local), so that you can install a new fresh system and keep your data.

Another is backup dumps: you usually don’t need to backup the system every day, but you might do for
data.

The problem, is, of course, fragmentation. But then, you can use LVM.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” GM (Elessar))

Since I multiboot with different distros (testing) and versions of openSUSE from the same HD, I have / and /swap on separate partitions, but not /home. Instead I have my own data on a separate partition that I mount to each system’s /home. That way each system has its own settings but shares the data. This can avoid problems in a multibooting environment.

A separate /usr/local is nice for people who compile/install a lot of stuff themselves.
A separate /tmp sounds nice but … it leads to cross-linking problems when xkb attempts to recompile the keymap and should be avoided with NX/FreeNX servers and suches.
A separate /var is nice, provided it’s big enough (otherwise it’s very bad!)
Separate /var/spool and /var/log is safer and should be used for mail servers.
Some distros (Arch) still complain if you don’t have a separate /boot.
Of course, the swap, /, /home partition scheme is great for more desktop users.

I create distro specific directories under /home (/home/openSUSE, /home/Fedora, /home/Ubuntu, etc ) and change the system base default accordingly.

On 08/28/2010 11:36 AM, please try again wrote:
>
> I create distro specific directories under /home (/home/openSUSE,
> /home/Fedora, /home/Ubuntu, etc ) and change the system base default
> accordingly.

Yes, but that does not require separate mount points (or partitions).

Okay, so with all of this being said…

I have been setting up my “/” Partition, than "/Usr’ Partition than my swap. Is that bad?

I always thought that for multiple users, /usr would be goo becasue it can the route itself to the user’s individual /home.

Do I have the wrong idea here?

Thanks…

On 2010-08-28 17:36, consused wrote:
>
> Since I multiboot with different distros (testing) and versions of
> openSUSE from the same HD, I have / and /swap on separate partitions,
> but not /home.

Notice that you can share the same swap partition for different linux installs. It is a waste to
have a different swap for each.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” GM (Elessar))

Well i’m backing up my system to get a fresh install and arrange the things right.

So, my root partition now its of 58 GB Ext4, with a 2 GB SWAP for a 60 GB, and the “data” partition its almost 400 GB. Of course, the data partition its ok, because I put there Images, Music, Documents, Workspace for programming, Downloads (Torrents) and stuff like that.

In my home partition I normally work with Kdenlive for some video editing, compile software and the usual, save smaller downloads.

The Desktop as i say, its used as Web and Database server, and of course daily use.

The other HDD of 500GB its for backups and bigger data, like movies or videos. That have a 500GB Ext4 partition.

So a good layout could be, using Ext4 on all (except swap of course):

15 GB /
40 GB /home
03 GB /tmp
02 GB swap

60 GB Total

What do you think ?

subcook69420 wrote:

>
> I always thought that for multiple users, /usr would be goo becasue it
> can the route itself to the user’s individual /home.
>
> Do I have the wrong idea here?
>
usr has nothing to do with users. usr means “unix system resources” and
contains mainly binaries, include files and so on completely user
independent. It has no relationship with the home directories.


openSUSE 11.2 64 bit | Intel Core2 Quad Q8300@2.50GHz | Gnome 2.28 | GeForce
9600 GT | 4GB Ram
openSUSE 11.3 64 bit | Intel Core2 Duo T9300@2.50GHz | Gnome 2.30 | Quadro
FX 3600M | 4GB Ram