Partitions necessary in RHEL 6

I had a query as to what are the partitions that should be necessary in RHEL 6. My knowledge says that

1)	/
2)	/home
3)	Swap
4)	/boot

should be sufficient. But, I am seeing in my production environment which is RHEL 5 that there are partitions also for

1)	/var
2)	/tmp
3)	/usr

Are there any advantages of having separate partitions for /var, /tmp & /usr?

I hope my query is clear that are the partitions of /var, tmp & /usr necessary.

Please revert with the reply to my query.

Regards

Hello,

You always need the / + swap + boot partitions. The difference may be between your rhel 5 and 6 is that the filesystems like /var, /tmp, /usr are on separate partitions.

If you partition with / + /boot + swap, you also have /var, /tmp, /usr but they reside in the / partition.

Don't know if I am explaining this right.

Hi,

As theboogymaster said. You always need the / + swap + boot partitions.

Having a different partition of /var , /usr, /tmp and etc. is usefull in case of re-installation and if you have LVM, so you can easily manage to use LVM options as requirement.

I suppose that you set up what you think is right for you. Whilst there is nothing officially wrong in just having /, /boot & swap there may be a problem over usage, contention and what happens if something goes wild. Assuming that you will always have /boot and swap, the other filesystems in the base volume group and indeed and other volume groups are up to you.

Consider each volume group as a room in your house. You have one room for total disk space in a volume group (say the kitchen) which you could configure as one large filesystem for the whole room. On the door you hang a clipboard to list what you have, expiry dates and free space information etc. You can just load everything randomly into this one big allocation and keep a note of where it is. You then know that to access any item, you have to read through the notes on the clipboard.

Alternatively, if you separate the room into several cupboards with their own clipboards, you can set up areas for different type of objects, e.g. temporary storage for perishables or frequently created files that are clean up at the end; tinned food for long term storage that you need to know are there but rarely used (reference database perhaps); books area for reference material such as manual pages; appliances/software resources to use etc. etc.

In the second case, you know vaguely what you're after or what is the item you have to store, so you have a clipboard on each of the cupboards. To refer to anything or to update the list is now a smaller job than reading/writing the entire catalogue. If you left the tap running and filled the sink, the tap would fail and turn off.

Back on Unix, if we have log files in /var being part of one big root filesystem then they will continue to grow until the whole of the root filesystem is full and that could be a severe headache. The alternate of having /var as a separate filesystem means that whilst logging might go badly wrong, the operating system as a whole should be protected.

Has that just confused things? :o

Overall I would always prefer to split the disks and work out what was critical to allow the system to boot. Keep this in the root filesystem and base volume group. Have everything else in separate filesystems from separate volume groups. Again, it's up to you what you choose for names and function of each, but I would always recommend creating the following as a minimum:-

  • /var
  • /usr
  • /opt
  • /home
  • /tmp

You might consider somewhere to store software install media, be that yum CD media copies or whatever.

If you have a disaster recovery plan, then this can help you to backup and restore just what you need to get the base OS running and then have a working system to restore all you company data and applications.

I hope that this is a useful and that I haven't just confused everyone.

Robin
Liverpool/Blackburn
UK

I agree with above two answers. Another main reason if for upgrade. Keep user data separate so it wont affect the upgrade.

Thanks everyone for the answers. I hope, the answers would help.

Do what makes sense for your usage pattern. For a desktop or workstation, I make a single / mount point and that's it. No need to segregate /opt or /var or anything else onto its own filesystem.

A server is a different matter, and it depends on what you're doing with the server and how much disk space you have to play with, and whether you're using LVM, and what sort of partition table you're using on the disks.

FWIW - Only / and /boot are required for a bootable RHEL. Even though swap is optional it's really risky to have a system without it - many programs will crash or won't even load, the system may have memory leaks here and there, you'll often have OOM crashes, etc.

So yeah, use the / + /boot + swap combo unless you really REALLY have a good reason not to have a swap partition.

I'd at least segregate /home. It can make the difference between needing to fsck one optional partition, and needing to reformat -- the filesystem which changes the most often is the one that'll get corrupted on power loss, and a corrupted root partition can't fsck itself.