The Linux Administration group is for the discussion of technical issues technical issues that arise during the administration of Linux systems, including maintaining the operating system and supporting end-user applications.

If you install 1 kernel
/boot usually 100Mb
For swap usually 2X of memory but if dont have DB maximum swap usually used 16G
For /export/home you must check any users need size on disk
For example you have 100 users and any user 100Mb =100*100Mb
You can 10-20% upper for /export/home

There are 2 partitions required for a Linux install.
They are '/' and 'swap'. You can have many more partitions depending on your needs but that is completely optional. Many admins partition along the following lines

/ Root containing /bin, /sbin, /dev, /root, /lib, and /etc.
should not need more than 200Mb

/usr Programmes and source code.
2-3Gb more or less depending on the software load. (office suites can be big)

swap 1.5 - 2.5 times the amount of RAM is quite fine. If you are comfortable with manual partitioning, try putting your swap partition as close to the middle of the physical drive as possible. You will see nice swap performance nice the heads usually won't have top travel as far.

/boot Boot kernels
Having this makes recovery MUCH easier. 20 Mb should be sufficient

I believe all you need is /boot, /, and swap. The default install for Red Hat is /boot /swap and /. / is a logical volume.

I believe /export/home is a Solaris home directory. Linux's local home directory is /home.
I normally have the following partitions. The size of the partitions depend on what you are going to store. When in doubt use LVM. I do not use LVM for boot or / The size of the partitions depends on what you are going to store. You could just have a 75MB boot partition, swap partition (size based on system documentation) and / to contain everything else. You will have to determine the storage space you are going to require based on what you are going to install and what your data requirements are.

As we all know, there are recommended disk layouts as mentioned up to now. What I want to say is that there can be only two partition containing "/" and swap. one partition is possible but it is not recommended. Because sometime you need to backup a partition for safety reasons. in such a case you have to backup all your root disk "/". So better to have multi partitions each one for a specific function like /usr, /, /home, /var, /tmp .

All you REALLY need is /. You can get by without swap as well as /boot.
It's not wise, On the other hand, if your machine starts swapping to
disk, I'd suggest you have other issues to deal with. Anymore, I never
create swap of more then 2g, period. I don't want to use swap. So, if
I'm swapping, then I either have a problem with an application or I need
more memory.

I believe the 'default' configuration for Fedora and Red Hat is / /boot
and swap, but I won't swear to that.

In general I usually create: / /boot swap and /home

When in doubt use LVM. I do not use LVM for boot or / The size of the partitions depends on what you are going to store. You could just have a 75MB boot partition, swap partition (size based on system documentation) and / to contain everything else. You will have to determine the storage space you are going to require based on what you are going to install and what your data requirements are.

I am afraid that I need to add my 2 cents worth to this discussion. Swap space is not only used for swapping processes to disk, and yes if this happens, there is a BIG memory issue, but it is also used for paging space. When the OS boots, it looks for the end of the filesystem and assumes that this is the start of PRIMARY SWAP and will use the space during the boot process. I think that a lot of people assume that all the swap can be located on a different disk or be moved away from the root directory. It cannot. After saying that, I have been retired for the last 5 years and that is a long time in the IT world, but I think that there is a requirement for primary swap directly after the / partition. There are too many physical restrictions in the boot process not to have a scratch area of disk available and the only way to find it is to use the space directly after the / partition as this is the only disk space to be identified in the initial bootstrap.

A lot of administrators utilise a number of swap partitions for performance reasons and this is understandable. Modern versions of *nix will use physical memory as part/all of the swap space which locks the amount of available memory to the system. This is a dangerous practice but if there is ample memory in the machine the usual 2X memory rule can be over egging the pudding, so to speak.

I believe you need to look at the documentation for the distribution you are using and figure out the most effective way to partition your disk, including configuring swap space. Different distributions may have different swap requirements and algorithms used for effective swap space. Research maximum swap partition sizes and swap priorities

Design your system on paper before building the system. Consider the hardware (including memory and storage) needed to support your applications, OS and load. When you consider storage requirements consider application, OS and application data requirements. Make sure you give yourself room to grow (again when in doubt LVM is a good choice)

Once you have discovered your needs determine the partitioning scheme based on the requirements of your application, and OS and backup strategies (snapshots).

The most important part of this process is to determine your requirements first and then design. Do your research first, layout everything on paper and then install.

wallacep via linuxadmin-l wrote:
> 0
>
> I am afraid that I need to add my 2 cents worth to this discussion.
> Swap space is not only used for swapping processes to disk, and yes
> if this happens, there is a BIG memory issue, but it is also used for
> paging space. When the OS boots, it looks for the end of the
> filesystem and assumes that this is the start of PRIMARY SWAP and
> will use the space during the boot process. I think that a lot of
> people assume that all the swap can be located on a different disk or
> be moved away from the root directory. It cannot. After saying that,
> I have been retired for the last 5 years and that is a long time in
> the IT world, but I think that there is a requirement for primary
> swap directly after the / partition.

I don't know that this was ever necessary, but it certainly is not at
this time. I've placed swap partitions on various locations of a drive
as well as different drives from the root partition.

There are too many physical
> restrictions in the boot process not to have a scratch area of disk
> available and the only way to find it is to use the space directly
> after the / partition as this is the only disk space to be identified
> in the initial bootstrap.

I assure you, I teach an intro Linux class and had many a student forget
to create a swap partition, and the OS boots just fine.

Just so you all know, when determining how much space to assign to swap: Swap isn't just used for paging or virtual memory management; swap is also used by power management for suspend-to-disk (hibernation). For this reason, swap needs to be at least as large as the amount of physical RAM you have. For example, if your computer has 6GB of physical memory, then your swap needs to be at least 6GB. For safety's sake, I always set swap to about 1GB greater than the amount of physical RAM I have.

Given how cheap hard drive space is these days, not setting swap, or setting insufficient swap, just seems a silly thing to do.

briandoe via linuxadmin-l wrote:
>
>
> Just so you all know, when determining how much space to assign to
> swap: Swap isn't just used for paging or virtual memory management;
> swap is also used by power management for suspend-to-disk
> (hibernation). For this reason, swap needs to be at least as large as
> the amount of physical RAM you have. For example, if your computer
> has 6GB of physical memory, then your swap needs to be at least 6GB.
> For safety's sake, I always set swap to about 1GB greater than the
> amount of physical RAM I have.

But this would apply, I would expect, to a laptop. I'm speaking from a
server environment. If you have 32GB, I don't think you need 32GB of swap.

>
> Given how cheap hard drive space is these days, not setting swap, or
> setting insufficient swap, just seems a silly thing to do.

Good point about server usage. Yes, 32GB of swap would be excessive. If you find yourself needing that much swap, then it's long past time to add physical memory to your server.

That said, I believe defining swap in a server should be mandatory. It would really suck for a server to roll over because of an unexpected spike in memory usage with no swap to handle it. This is one of those cases where it is better to have it and not need it, than to need it and not have it.

To summarize about what kind, if any, of swap space may be needed, we ought to make some generalizations - but not absolutes, about swap space. For laptop and desktop systems, generally carrying as much swap, and possibly as much as two times as much swap as memory is reasonable; the first to account for suspend and hibernation if needed, the second to account, if you are concerned about it, not only with suspend and hibernate, but also with system crash memory dumps. No hard and fast need for either, but if these are desirable, then sufficient space to cover for their possible need is a good idea.

It has been suggested that to have a 32 GB swap space on a server might be excessive; perhaps so, but what minimum, in that case, would be wise? Is a 10 GB swap space on a server that may have terabytes of disk farm space an unreasonable cost? I'd say not, unless disk space is so much at a premium that you have to make space trade offs, in which case I would also look at what data is redundant that should also be eliminated. For me, I'd rather have a stable system that is likely to stay up and work, but is also diagnostic-capable if and when it fails.

It probably was before we had LVM, bcoz of the case where we increase ram one had to increase swap accordingly. But now with LVM we can increase swap from any place, as long as within the LVM logical volumes.