Operating System - HP-UX
1832489 Members
4384 Online
110043 Solutions
New Discussion

Re: Why use several logical volumes on the root disk?

 
SOLVED
Go to solution
Jose Rafael Leal_2
New Member

Why use several logical volumes on the root disk?

Hi guys,

I would like to know what are the advantages of partitioning the root disk into several logical volumes (/opt, /usr, /home, /tmp, /stand, /var, /), instead of using just two: / and /var

Thank you!
8 REPLIES 8
Jerome Baron
Respected Contributor

Re: Why use several logical volumes on the root disk?

Hi,

If a file system like / home is full with the partition / and / var, / was full. If you done a total partitionning a file system full (exept / or /var) give you the hand on the system to make place.

Regards,
Jerome
Ken Hubnik_2
Honored Contributor

Re: Why use several logical volumes on the root disk?

There are programs and software that expect to find all these seperate filesystems for install purposes. It's a way (standard) for a logical seperation of files.
Helen French
Honored Contributor
Solution

Re: Why use several logical volumes on the root disk?

Couple of reasons:
1) In case you need to extend any file system in future, you could do it easily without disturbing the root file system (which is a risky task)
2) The file systems like /opt, /home, /tmp, /usr will be growing continuously with the usage of the system (new appl. install, new users, new programs etc). If you keep this seperate, you will have the flexibility of changing the sizes.
3) You could avoid a root file system full state.
Life is a promise, fulfill it!
Rusty Sapper
Frequent Advisor

Re: Why use several logical volumes on the root disk?

Well,
There are many many reasons, depending on what kind of applications you are using. First of all you can use different types of filesystems and you have to have a /stand which will hold the kernel. /stand must be /hfs, but you can make the others vxfs or use online JFS which will allow you to increase decrease the size on the fly.
Also, it helps you keep static and dynamic filesystems seperate. /var is a dynamic filesystem but /usr is static. This also helps performance so the server isn't trying to write a bunch of data to the same volume that is trying to read data from or load libs from.
Another reason is if you are using NFS mounts in your environment, you wouldn't want to mount / on a remote server just to get access to your files that are under /home.

Those are just a few, I'm sure otheres will post more reasons for you.

-Rusty
Christopher Caldwell
Honored Contributor

Re: Why use several logical volumes on the root disk?

We use multiple partitions (lvols) for

1) system protection - filesystems like /tmp and /var are designed to grow without bound due to logging. If the filesystems are in the root partition unexpected growth will cause unexpected downtime (minimally an ungraceful reboot (TOC) to clear space).

2) different classes of service - for instance, normally everything on our root drive is _required_ to be mirrored (generally /, /var, /opt, /usr, etc.). On our main sw depot server, we separate /var/spool/sw, and we don't mirror it. It's large and static - there's not an issue with loss of data (it's taped and can be easily rebuilt). We do the same thing with some archive log partitions.

3) Performance - if you're running a big mail system for instance, I'd advise you to put /var/mail and /var/spool/mqueue, all on different spindles (different lvols, striped).

4) Expansion - let's say you've got a 9G internal drive (ok, so it's old) - you're on today's 11.x which wants nearly that size drive. I've had systems with /opt and /var on one disk, and /usr, / and /tmp on the boot drive - all set up due to expansion after the system was built.

Use of these techniques are system and situation specific. YMMV.
Christopher Caldwell
Honored Contributor

Re: Why use several logical volumes on the root disk?

A. Clay Stephenson
Acclaimed Contributor

Re: Why use several logical volumes on the root disk?

First of all, /stand must be an hfs filesystem so that it must be separate. You also need an LVOL for primary swap. You could then use the remainder of the disk for / as a vxfs filesystem.

However, splitting the filesystems up generally makes for a system that is easier to maintain. My typical way to install an OS is to make a very small primary swap (256-512MB); oversize /stand and / by about 50% and then make the reminder of the filesystems relatively small. I then use OnlineJFS to grow the filesystems as needed. Often, you don't know the disk space requirements beforehand.

It's very common for /var to be split into several filesystems itself (e.g. /var/tmp/, /var/spool, /var/mail because filling var will clobber a system.)

Generally, the idea is to keep VG00 fairly cleanly and only for OS related files. That makes recovery with Ignite easy.

Probably the best reason to not put essentially everything in / is that there is no need for / to grow hardly at all. Once a system has stabilized (i.e. patches loaded, spooler up and running, ... ), / should essentially remain fixed in size. If you see it growing, something is very wrong. However, if / contains a bunch of other directories that are typically filesystems, you won't see this problem until it's too late.
If it ain't broke, I can fix that.
Ceesjan van Hattum
Esteemed Contributor

Re: Why use several logical volumes on the root disk?

In case of serious problems you might need to boot in single user mode. In this mode, not all filesystems will be mounted to protect you from more evil.
If you boot in single user mode, vg00 will not be activated and so /var, /usr and /tmp will not be mounted.
So, no /usr/bin nor /usr/local/bin.
Also a 100% full /tmp will not bother you.
In the mode, you should mount these filesystems manually with great care.. because you have a reason/problem at such a moment.
Therefor it is not advisable to use only / and /var.

And besides, if you use only a / and /var, where did you leave the dump&swap space, do you have a /dev/vg00/lvol2 ?

Regards,
Ceesjan