Tux

...making Linux just a little more fun!

file system related question

ALOK ANAND [alokslayer at gmail.com]


Mon, 22 Jun 2009 12:32:53 +0530

please advice how much space needs to be allocated for each of the directory of an opensuse 11.1 operating system if you intend to install it by manually allocating space (i.e by not following the one proposed by yast2) .I'am looking for a detailed explanation of the following directories and the space needed (i have a 160 GB Hard Drive).also give me a general explanation of each of the following directories (example what do they store and the minimum space needed on a server class system)

/
/bin
/boot
/home
/usr
/var
/tmp
/opt
/sbin

An early reply will be greatly appriciated.

Thank you


Top    Back


Thomas Adam [thomas.adam22 at gmail.com]


Mon, 22 Jun 2009 08:35:08 +0100

2009/6/22 ALOK ANAND <alokslayer@gmail.com>:

> please advice how much space needs to be allocated for each of the directory
> of an opensuse 11.1 operating system if you intend to install it by manually

That's not how partitioning generally works. For what you've listed, only /home, /usr and /var are typically mounted on to their own partition. /boot used to be for older reasons where the first sector of the drive wasn't addressable, but that's rare -- so /boot just becomes mounted under "/".

> allocating space (i.e by not following the one proposed by yast2) .I'am
> looking for a detailed explanation of the following directories and the
> space needed (i have a 160 GB Hard Drive).also give me a general explanation

You typically want a small, "/" partition, a large "/usr" partition and what's left for "/home" -- perhaps the following:

5GB /
30 GB /usr
125 /home

Oh, usual disclaimer: should this not be what you want, don't hold me responsible when you're then having to get gparted out to resize your partitions.

-- 
Thomas Adam


Top    Back


Kapil Hari Paranjape [kapil at imsc.res.in]


Mon, 22 Jun 2009 19:14:12 +0530

Hello,

On Mon, 22 Jun 2009, Thomas Adam wrote:

> 2009/6/22 ALOK ANAND <alokslayer@gmail.com>:
> > please advice how much space needs to be allocated for each of the directory
> > of an opensuse 11.1 operating system if you intend to install it by manually
> 
> /boot used to be for older reasons where the first sector
> of the drive wasn't addressable, but that's rare -- so /boot just
> becomes mounted under "/".

That's not always the case.

For example, some systems default to partitioning the whole disk into two partitions, /boot and LVM. All the other partitions are under LVM and can be resized as and when required. The reason for /boot to be separate is that grub (as opposed to lilo or grub2) cannot boot from an LVM partition.

If one is not sure of how much space one wants in each partition, then LVM is quite a useful solution --- just keep at least 100 MB for /boot since linux is growing so fast!

Regards,

Kapil. --


Top    Back


Lew Pitcher [lew.pitcher at digitalfreehold.ca]


Mon, 22 Jun 2009 13:30:03 -0400

On June 22, 2009 09:44:12 Kapil Hari Paranjape wrote:

> Hello,
>
> On Mon, 22 Jun 2009, Thomas Adam wrote:
> > 2009/6/22 ALOK ANAND <alokslayer@gmail.com>:
> > > please advice how much space needs to be allocated for each of the
> > > directory of an opensuse 11.1 operating system if you intend to install
> > > it by manually
> >
> > /boot used to be for older reasons where the first sector
> > of the drive wasn't addressable, but that's rare

Actually, /boot was sometimes made a separate partition close to the start of the drive because the BIOS in older machines couldn't access the far end (past cyl 1024 or so) of large hard drives, and the boot loader (typically LILO) used BIOS read routines to load the kernel. Modern boot loaders on a modern BIOS don't have this limitation.

> > -- so /boot just=20
> > becomes mounted under "/".
>
> That's not always the case.

Agreed.

> For example, some systems default to partitioning the whole disk into
> two partitions, /boot and LVM.

Another reason to have /boot as a separate partition would be to protect the kernel from accidental damage. With /boot residing in the same fs as /, the /boot directory (and it's contents) are writable, protected only by Unix file mode bits and/or capabilities. With /boot on a separate partition, the whole partition can be mounted read-only, adding another layer of protection. Additionally, you can have more than one /boot partition this way, permitting a "recovery" boot if you feel it is necessary.

> If one is not sure of how much space one wants in each partition, then
> LVM is quite a useful solution --- just keep at least 100 MB for
> /boot since linux is growing so fast!

Agreed

-- 
Lew Pitcher
 
Master Codewright & JOAT-in-training | Registered Linux User #112576
https://pitcher.digitalfreehold.ca/   | GPG public key available by request
---------      Slackware - Because I know what I'm doing.          ------


Top    Back


Paul Sephton [paul at inet.co.za]


Mon, 22 Jun 2009 10:32:21 +0200

On Mon, 2009-06-22 at 12:32 +0530, ALOK ANAND wrote:

> please advice how much space needs to be allocated for each of the
> directory of an opensuse 11.1 operating system if you intend to
> install it by manually allocating space (i.e by not following the one
> proposed by yast2) .I'am looking for a detailed explanation of the
> following directories and the space needed (i have a 160 GB Hard
> Drive).also give me a general explanation of each of the following
> directories (example what do they store and the minimum space needed
> on a server class system)
> /
> /bin
> /boot
> /home
> /usr
> /var
> /tmp
> /opt
> /sbin
> An early reply will be greatly appriciated.

Size requirement is a particularly difficult question to answer, as it depends on so many factors. Primarily, the choice of file system and it's parameters for example cluster size, determines the minimum storage size per file. The eventual size requirement will further depend on the number and size of the files you decide to install.

I refer you to the LDP documentation on available file systems, to be found at https://tldp.org/HOWTO/Filesystems-HOWTO.html ...and further reading regarding directory structure at https://www.tuxfiles.org/linuxhelp/linuxdir.html

Generally, your partitioning would include a swap partition (nominally 2x physical RAM size), a partition for your boot volume, and a partition for the rest of the files. So three partitions altogether. There used to be a constraint that your kernel must reside in BIOS addressable space for the Lilo boot loader, but I am unsure whether this is still a restriction for GRUB. If this is no longer a constrant, I would simply use two partitions- a swap and a root partition. If the restriction remains, your boot partition would be constrained to BIOS-addressable partition size (varies).

Suggested configuration: Assuming a boot partition constraint of 32GB, a memory size of 2GB & IDE drives,

partition    size        mount
/dev/hda1    4GB         swap
/dev/hda2    4GB         /boot   (all your kernel images reside here)
/dev/hda3  152GB         /

I have not personally tried the above, but see no reason why it should not work.

Some people prefer mounting /usr and /home on their own partitions, but my experience has been that there is little to gain. Often /var and even /tmp can be quite a space gobbler. /var/mail in particular can be a problem if someone is not reading their mail, or in a spam storm, or when mail is misconfigured, and /var/log (or var/adm) stores system log files which can grow quite quickly when there are problems. I would rather have the space available when it is needed than try to second guess future needs.

Nevertheless, if you find the need to later add another drive, it is a simple matter to mount it on /home, and restore your previous /home to the new drive.

For reference, directories that change infrequently, and mostly at installation time, and accessed mostly for read are:

/usr, /opt, /boot, /bin, /lib, /sbin, /etc
and directories which change often are
/home, /var, /tmp
... it would therefore make sense to have the last three directories mounted on your fastest drive if you have more than one. Symbolic links are very useful to accomplish that.

Paul Sephton


Top    Back


Mulyadi Santosa [mulyadi.santosa at gmail.com]


Mon, 22 Jun 2009 16:25:22 +0700

Hi

On Mon, Jun 22, 2009 at 2:02 PM, ALOK ANAND<alokslayer@gmail.com> wrote:

> please advice how much space needs to be allocated for each of the directory
> of an opensuse 11.1 operating system if you intend to install it by manually
> allocating space (i.e by not following the one proposed by yast2) .

I assume you mean "partition size being mounted on such directory e.g /var and so on".

There's no such recommended rules of thumb. If you intend to install many applications via RPM, IMO you need quite big /usr since the binaries will be stored in that directory.

For typical database user e.g MySQL, /var needs to be big because it will hold the database by default (most of my mysql package is configured to store data in /var/mysql).

Definitely, you need adequate /home, let's say 20 GB or more. By having separate /home, upgrading your linux system won't be too difficult.

All in all, you need to consider using LVM these days, because it allows you to do flexible partition management.

regards,

Mulyadi.


Top    Back