The ever lasting story: hard disk partitioning

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

The ever lasting story: hard disk partitioning

RedShift
Ehlo

Usually I don't really care about hard disk partitioning, because most
of my computers are just workstations. One big /, a swap partition and
sometimes a small /boot partition. However, now I want to install a
server and I'm not quite sure my partition scheme is chosen wisely:

/boot        <- 25 mb
swap        <- 1 GB (server has 1 gb ram)
/        <- 2 GB
/usr/local    <- 500 MB
/home        <- The rest

Point of /usr/local is for all custom compiled software (not the
packages from the repositories). Now this all looks good, but there are
2 problems with this setup:

1) /var is on the root volume (/), which is 2 GB in size. Ofcourse, when
the system is under attack or some other reason /var fills up, my / is
full and this could lead to a dangerous situation (not being able to log
in anymore). Also the logs are on the same volume. Would it be wise to
create under /home for example /home/system/logs and let /var/log be a
symlink to that?

2) /tmp can fill up too. I would consider mounting /tmp with tmpfs, 512
MB in size, is that enough for server purposes? (Web/mail/general purpose)

Thanks for your advice.

Glenn



_______________________________________________
arch mailing list
[hidden email]
http://www.archlinux.org/mailman/listinfo/arch
Reply | Threaded
Open this post in threaded view
|

Re: The ever lasting story: hard disk partitioning

Aaron Griffin
On 11/1/06, RedShift <[hidden email]> wrote:
> /boot        <- 25 mb
> swap        <- 1 GB (server has 1 gb ram)
> /        <- 2 GB
> /usr/local    <- 500 MB
> /home        <- The rest

I know it's typical for people to separate / and /home, but the advice
I always give is this: are you going to be installing another distro
on here?  If not, then there is no real reason to separate the two.

_______________________________________________
arch mailing list
[hidden email]
http://www.archlinux.org/mailman/listinfo/arch
Reply | Threaded
Open this post in threaded view
|

Re: The ever lasting story: hard disk partitioning

Dale Blount
In reply to this post by RedShift
On Wed, 2006-11-01 at 22:05 +0100, RedShift wrote:
> Ehlo
>
> Usually I don't really care about hard disk partitioning, because most
> of my computers are just workstations. One big /, a swap partition and
> sometimes a small /boot partition. However, now I want to install a
> server and I'm not quite sure my partition scheme is chosen wisely:
>
> /boot        <- 25 mb

You can do without this on modern hardware.

> swap        <- 1 GB (server has 1 gb ram)
> /        <- 2 GB
> /usr/local    <- 500 MB
> /home        <- The rest
>
> Point of /usr/local is for all custom compiled software (not the
> packages from the repositories). Now this all looks good, but there are
> 2 problems with this setup:
>

I'll pretend I didn't notice you're not installing software via
packages.  Upgrading software is much easier if the files are managed
via pacman/rpm/deb, etc.


> 1) /var is on the root volume (/), which is 2 GB in size. Ofcourse, when
> the system is under attack or some other reason /var fills up, my / is
> full and this could lead to a dangerous situation (not being able to log
> in anymore). Also the logs are on the same volume. Would it be wise to
> create under /home for example /home/system/logs and let /var/log be a
> symlink to that?
>

Why not create a var partition?  If you're short on space, you could
mount /var/logs as type bind on /home/logs.

> 2) /tmp can fill up too. I would consider mounting /tmp with tmpfs, 512
> MB in size, is that enough for server purposes? (Web/mail/general purpose)
>

We don't use tmpfs by default anymore for that exact reason.  tmp would
fill up and error messages were not all that specific.  128Mb is
probably *plenty* on most servers, however.

Dale


_______________________________________________
arch mailing list
[hidden email]
http://www.archlinux.org/mailman/listinfo/arch
Reply | Threaded
Open this post in threaded view
|

Re: The ever lasting story: hard disk partitioning

Dale Blount
In reply to this post by Aaron Griffin
On Wed, 2006-11-01 at 15:23 -0600, Aaron Griffin wrote:

> On 11/1/06, RedShift <[hidden email]> wrote:
> > /boot        <- 25 mb
> > swap        <- 1 GB (server has 1 gb ram)
> > /        <- 2 GB
> > /usr/local    <- 500 MB
> > /home        <- The rest
>
> I know it's typical for people to separate / and /home, but the advice
> I always give is this: are you going to be installing another distro
> on here?  If not, then there is no real reason to separate the two.

Well what if you'd like to re-install your distro, but keep your
settings in /home?  This is the main reason I keep them separate (not to
mention /home is in a raid for data integrity that I don't need on /).

Dale


_______________________________________________
arch mailing list
[hidden email]
http://www.archlinux.org/mailman/listinfo/arch
Reply | Threaded
Open this post in threaded view
|

Re: The ever lasting story: hard disk partitioning

Nicolas Dufour-3
In reply to this post by RedShift
I would say :

/boot 10-500Mo
swap ~ 1-2*ram (even if now the twice the ram becomes a bit ridiculeous)
/    5-10Go
/home what is left.

It's usually better to have a swap a bit bigger the ram. If you need the
suspend feature you will be set.

For the root, I used to have the traditionnal set : /, /var, /usr, /tmp
and so on. But is it really usefull ? not really.
For security reason, the separation of / and /usr can be usefull but
that's it. I'm using a 10G for the / and I'm comfy ;)

The separation of /var can be nice too. But be carefull to put the right
size ...

CapNemo

On Wed, 2006-11-01 at 22:05 +0100, RedShift wrote:

> Ehlo
>
> Usually I don't really care about hard disk partitioning, because most
> of my computers are just workstations. One big /, a swap partition and
> sometimes a small /boot partition. However, now I want to install a
> server and I'm not quite sure my partition scheme is chosen wisely:
>
> /boot        <- 25 mb
> swap        <- 1 GB (server has 1 gb ram)
> /        <- 2 GB
> /usr/local    <- 500 MB
> /home        <- The rest
>
> Point of /usr/local is for all custom compiled software (not the
> packages from the repositories). Now this all looks good, but there are
> 2 problems with this setup:
>
> 1) /var is on the root volume (/), which is 2 GB in size. Ofcourse, when
> the system is under attack or some other reason /var fills up, my / is
> full and this could lead to a dangerous situation (not being able to log
> in anymore). Also the logs are on the same volume. Would it be wise to
> create under /home for example /home/system/logs and let /var/log be a
> symlink to that?
>
> 2) /tmp can fill up too. I would consider mounting /tmp with tmpfs, 512
> MB in size, is that enough for server purposes? (Web/mail/general purpose)
>
> Thanks for your advice.
>
> Glenn
>
>
>
> _______________________________________________
> arch mailing list
> [hidden email]
> http://www.archlinux.org/mailman/listinfo/arch



_______________________________________________
arch mailing list
[hidden email]
http://www.archlinux.org/mailman/listinfo/arch
Reply | Threaded
Open this post in threaded view
|

Re: The ever lasting story: hard disk partitioning

Nicolas Dufour-3
In reply to this post by Aaron Griffin
On Wed, 2006-11-01 at 15:23 -0600, Aaron Griffin wrote:

> On 11/1/06, RedShift <[hidden email]> wrote:
> > /boot        <- 25 mb
> > swap        <- 1 GB (server has 1 gb ram)
> > /        <- 2 GB
> > /usr/local    <- 500 MB
> > /home        <- The rest
>
> I know it's typical for people to separate / and /home, but the advice
> I always give is this: are you going to be installing another distro
> on here?  If not, then there is no real reason to separate the two.

Hum, there is a major reason to separate / from /home : integrity of
your data !

If for some reasons my / is corrupted and I cant repair it, at least my
data are safe in another partition.

I never liked the C: windows organisation where everything are in the
same place. It applies for Windows *and* for Linux. Specially a server.

CapNemo


_______________________________________________
arch mailing list
[hidden email]
http://www.archlinux.org/mailman/listinfo/arch
Reply | Threaded
Open this post in threaded view
|

Re: The ever lasting story: hard disk partitioning

Aaron Griffin
In reply to this post by Dale Blount
On 11/1/06, Dale Blount <[hidden email]> wrote:

> On Wed, 2006-11-01 at 15:23 -0600, Aaron Griffin wrote:
> > On 11/1/06, RedShift <[hidden email]> wrote:
> > > /boot        <- 25 mb
> > > swap        <- 1 GB (server has 1 gb ram)
> > > /        <- 2 GB
> > > /usr/local    <- 500 MB
> > > /home        <- The rest
> >
> > I know it's typical for people to separate / and /home, but the advice
> > I always give is this: are you going to be installing another distro
> > on here?  If not, then there is no real reason to separate the two.
>
> Well what if you'd like to re-install your distro, but keep your
> settings in /home?  This is the main reason I keep them separate (not to
> mention /home is in a raid for data integrity that I don't need on /).

Configuration I keep off-site in an svn repo.  That's easy, it's all
text.  As for data (movies, mp3s, things like that) I typically back
those up _anyway_ when doing a re-format or re-install in the
offchance that it all goes poof.  Anymore, my ~ is just a whole mess
of cvs/svn checkouts and some media I haven't yet watched-and-deleted.

_______________________________________________
arch mailing list
[hidden email]
http://www.archlinux.org/mailman/listinfo/arch
Reply | Threaded
Open this post in threaded view
|

Re: The ever lasting story: hard disk partitioning

Tate Johnson
In reply to this post by RedShift
RedShift wrote:

> Ehlo
>
> Usually I don't really care about hard disk partitioning, because most
> of my computers are just workstations. One big /, a swap partition and
> sometimes a small /boot partition. However, now I want to install a
> server and I'm not quite sure my partition scheme is chosen wisely:
>
> /boot        <- 25 mb
> swap        <- 1 GB (server has 1 gb ram)
> /        <- 2 GB
> /usr/local    <- 500 MB
> /home        <- The rest
>
> Point of /usr/local is for all custom compiled software (not the
> packages from the repositories). Now this all looks good, but there are
> 2 problems with this setup:
>
> 1) /var is on the root volume (/), which is 2 GB in size. Ofcourse, when
> the system is under attack or some other reason /var fills up, my / is
> full and this could lead to a dangerous situation (not being able to log
> in anymore). Also the logs are on the same volume. Would it be wise to
> create under /home for example /home/system/logs and let /var/log be a
> symlink to that?
>
> 2) /tmp can fill up too. I would consider mounting /tmp with tmpfs, 512
> MB in size, is that enough for server purposes? (Web/mail/general purpose)
>
> Thanks for your advice.
>
> Glenn
>
>
>
> _______________________________________________
> arch mailing list
> [hidden email]
> http://www.archlinux.org/mailman/listinfo/arch
>  
Have you considered using LVM2? It really *does* provide you with that
extra flexibility. You can shrink or grow partitions on the fly
(Provided your FS supports resizing) allowing you to adjust your
partitioning scheme whenever you feel it's necessary. There's a guide on
the wiki called "Installing software RAID or LVM" which could easily
start you off.

http://wiki.archlinux.org/index.php/Installing_with_Software_RAID_or_LVM

I'd recommend following something similar to this.

/boot (25MB)
swap (1024MB)
LVM2 Volume (Rest of the disk)
/home (10GB - I'm not sure what you're planning to store here)
/var (5GB - it's a server, if you have the space, why not?)
/tmp (512MB)

Of course, you could easily add whatever other partition you wanted to
and observe how they start filling up. If they require more space, grow
them. In addition, don't feel like you "have" to partition the entire
disk initially, you can always grow partitions later. This adds to the
flexibility of LVM2. Even on my desktop I use LVM2, just so I never have
to worry about partition sizes again.

NOTE: If you do decide to take the LVM2 route, ensure that you have
"lvm2" in your /etc/mkinitcpio.conf, especially if the root partition is
on LVM2 (Such as in the partitioning scheme above). Furthermore, Ext3
and ReiserFS both support resizing. XFS only supports growing.

Cheers,
Tate

_______________________________________________
arch mailing list
[hidden email]
http://www.archlinux.org/mailman/listinfo/arch
Reply | Threaded
Open this post in threaded view
|

Re: The ever lasting story: hard disk partitioning

Kurt B Cox-4
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Tate Johnson wrote:

> RedShift wrote:
>> Ehlo
>>
>> Usually I don't really care about hard disk partitioning, because most
>> of my computers are just workstations. One big /, a swap partition and
>> sometimes a small /boot partition. However, now I want to install a
>> server and I'm not quite sure my partition scheme is chosen wisely:
>>
>> /boot        <- 25 mb
>> swap        <- 1 GB (server has 1 gb ram)
>> /        <- 2 GB
>> /usr/local    <- 500 MB
>> /home        <- The rest
>>
>> Point of /usr/local is for all custom compiled software (not the
>> packages from the repositories). Now this all looks good, but there are
>> 2 problems with this setup:
>>
>> 1) /var is on the root volume (/), which is 2 GB in size. Ofcourse, when
>> the system is under attack or some other reason /var fills up, my / is
>> full and this could lead to a dangerous situation (not being able to log
>> in anymore). Also the logs are on the same volume. Would it be wise to
>> create under /home for example /home/system/logs and let /var/log be a
>> symlink to that?
>>
>> 2) /tmp can fill up too. I would consider mounting /tmp with tmpfs, 512
>> MB in size, is that enough for server purposes? (Web/mail/general purpose)
>>
>> Thanks for your advice.
>>
>> Glenn
>>
>>
>>
>> _______________________________________________
>> arch mailing list
>> [hidden email]
>> http://www.archlinux.org/mailman/listinfo/arch
>>  
> Have you considered using LVM2? It really *does* provide you with that
> extra flexibility. You can shrink or grow partitions on the fly
> (Provided your FS supports resizing) allowing you to adjust your
> partitioning scheme whenever you feel it's necessary. There's a guide on
> the wiki called "Installing software RAID or LVM" which could easily
> start you off.
>
> http://wiki.archlinux.org/index.php/Installing_with_Software_RAID_or_LVM
>
> I'd recommend following something similar to this.
>
> /boot (25MB)
> swap (1024MB)
> LVM2 Volume (Rest of the disk)
> /home (10GB - I'm not sure what you're planning to store here)
> /var (5GB - it's a server, if you have the space, why not?)
> /tmp (512MB)
>
> Of course, you could easily add whatever other partition you wanted to
> and observe how they start filling up. If they require more space, grow
> them. In addition, don't feel like you "have" to partition the entire
> disk initially, you can always grow partitions later. This adds to the
> flexibility of LVM2. Even on my desktop I use LVM2, just so I never have
> to worry about partition sizes again.
>
> NOTE: If you do decide to take the LVM2 route, ensure that you have
> "lvm2" in your /etc/mkinitcpio.conf, especially if the root partition is
> on LVM2 (Such as in the partitioning scheme above). Furthermore, Ext3
> and ReiserFS both support resizing. XFS only supports growing.
>
> Cheers,
> Tate


I too have a server running with a LVM2 setup.

My advice is put a 2G / on a real partition not an LVM2 partition. It
makes maintenance and recovery much easier in case of trouble.

Everything else can go onto an LVM2 volume such as

/var
/user
/home
/tmp
/mnt/vmware
swap ( mostly because my server almost never has to swap )

I can then resize and reallocate space.

The file systems are all reiserfs. (I am unlucky when it comes to XFS
and ext3, but they should work too.) I am not sure if XFS has an online
resizer.

If you can, use evms as as an admin tool for your volumes. It has a very
user-friendly interface in "evmsn"

A couple of months down the road you can look at your diskspace
utilization and resize or shrink a few partitions. The only fixed
partitions would be / and maybe a separate /boot


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQEVAwUBRUmrxMvODX+91FTAAQLsCgf9EELhR7PfGGevMOnldi70TVsYNtPdmxQd
RTGpuBVgUqZuNXoRSIhBb3MgWIMglpSkOG7RCMrcGIHeHXlkogwF7RDIvX7Q3n/a
gjwRrRHUX+6DSeAaX627xt7PFcLu/hwLFfOh01czvaQy3sbTwj5lLkD7TBnvGfKm
ePKP0ACuCM/CNBApt0eQasb9X2wtJOHQ7oKnYqUZHpLi368vBOzVEE8JTV+gmiOL
RzmdqBJFCtoTP9WZJhMjq+CsOYAfOUUCLxoON+8JK0AJ5l2RUez+QXmVGNA7rWcq
2hSJ3MvOs8lc4C+KLtMfLNtNvKgAz8mrNc3GlRCM0HvfhA65aAg6ig==
=KCO5
-----END PGP SIGNATURE-----


_______________________________________________
arch mailing list
[hidden email]
http://www.archlinux.org/mailman/listinfo/arch
Reply | Threaded
Open this post in threaded view
|

Re: The ever lasting story: hard disk partitioning

Roman Kyrylych
Hi!

I don't know if it's fixed now, but when I was trying to partition my
system with separate /tmp partition I could'nt install Arch 0.7.2,
because of conflict. Don't remember bug report number now.
I simply repartitioned my HDD without /tmp because it was not critical
for me, but those who want to have separate /tmp partition keep in
mind that bug.

--
Roman Kyrylych (Роман Кирилич)
_______________________________________________
arch mailing list
[hidden email]
http://www.archlinux.org/mailman/listinfo/arch
Reply | Threaded
Open this post in threaded view
|

Re: The ever lasting story: hard disk partitioning

Jan de Groot
On Thu, 2006-11-02 at 11:27 +0200, Roman Kyrylych wrote:
> Hi!
>
> I don't know if it's fixed now, but when I was trying to partition my
> system with separate /tmp partition I could'nt install Arch 0.7.2,
> because of conflict. Don't remember bug report number now.
> I simply repartitioned my HDD without /tmp because it was not critical
> for me, but those who want to have separate /tmp partition keep in
> mind that bug.

The 0.7.2 setup mounts tmpfs on /tmp, so if you mount something else on
it you'll run into trouble. The workaround is to create a partition
to /tmp but don't mount it on setup, create a filesystem on it and then
add it to fstab after the setup.


_______________________________________________
arch mailing list
[hidden email]
http://www.archlinux.org/mailman/listinfo/arch
Reply | Threaded
Open this post in threaded view
|

Re: The ever lasting story: hard disk partitioning

Roman Kyrylych
2006/11/2, Jan de Groot <[hidden email]>:

> The 0.7.2 setup mounts tmpfs on /tmp, so if you mount something else on
> it you'll run into trouble. The workaround is to create a partition
> to /tmp but don't mount it on setup, create a filesystem on it and then
> add it to fstab after the setup.

Will this be fixed in 0.8? Or at least some notice about this problem displayed?


--
Roman Kyrylych (Роман Кирилич)
_______________________________________________
arch mailing list
[hidden email]
http://www.archlinux.org/mailman/listinfo/arch
Reply | Threaded
Open this post in threaded view
|

Re: The ever lasting story: hard disk partitioning

David Rosenstrauch
In reply to this post by Kurt B Cox-4
Kurt B Cox wrote:
> I too have a server running with a LVM2 setup.
>
> My advice is put a 2G / on a real partition not an LVM2 partition. It
> makes maintenance and recovery much easier in case of trouble.

I agree.  I use a similar setup, and it works quite nicely.  Only
correction I'd offer though is to not put the full /var tree onto a
logical volume (for the maintenance and recovery reasons you listed).
IIRC, there are elements of the system and/or certain daemons that
require /var to function.  So with /var on a regular partition, if
something gets messed up with LVM, you'll still be able to run your machine.

What I do instead is just put individual large sub-dirs (such as
/var/cache/pacman) onto their own LV's.

DR

_______________________________________________
arch mailing list
[hidden email]
http://www.archlinux.org/mailman/listinfo/arch
Reply | Threaded
Open this post in threaded view
|

Re: The ever lasting story: hard disk partitioning

Allen Franco
In reply to this post by Aaron Griffin
One time i compile kernel-beyond(Ahhhhhhh i know! i know!) in my athlon-xp, all my / is gone, ok no affect /home but for security reasons and personal organization i recommend to separeted both.

In your your squema i only change the /usr/local, no need in my view, so here i do this:

/boot - 2%
/swap - (ram thing)
/ - 60%
/home - rest

If i have another system i use the recommended/default where / have everything. I use porcentage because we never know the space of HDs.

Well... i use this configuration everytime and i am happy :-)

hugs
Allen

2006/11/1, Aaron Griffin <[hidden email]>:
On 11/1/06, RedShift <[hidden email] > wrote:
> /boot        <- 25 mb
> swap        <- 1 GB (server has 1 gb ram)
> /        <- 2 GB
> /usr/local    <- 500 MB
> /home        <- The rest

I know it's typical for people to separate / and /home, but the advice
I always give is this: are you going to be installing another distro
on here?  If not, then there is no real reason to separate the two.

_______________________________________________
arch mailing list
[hidden email]
http://www.archlinux.org/mailman/listinfo/arch



--
Abraços,

Allen S. Franco
MSN: [hidden email]
Jabber: [hidden email]
_______________________________________________
arch mailing list
[hidden email]
http://www.archlinux.org/mailman/listinfo/arch
Reply | Threaded
Open this post in threaded view
|

Re: The ever lasting story: hard disk partitioning

Kurt B Cox-4
In reply to this post by David Rosenstrauch
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

David Rosenstrauch wrote:

> Kurt B Cox wrote:
>> I too have a server running with a LVM2 setup.
>>
>> My advice is put a 2G / on a real partition not an LVM2 partition. It
>> makes maintenance and recovery much easier in case of trouble.
>
> I agree.  I use a similar setup, and it works quite nicely.  Only
> correction I'd offer though is to not put the full /var tree onto a
> logical volume (for the maintenance and recovery reasons you listed).
> IIRC, there are elements of the system and/or certain daemons that
> require /var to function.  So with /var on a regular partition, if
> something gets messed up with LVM, you'll still be able to run your machine.
>
> What I do instead is just put individual large sub-dirs (such as
> /var/cache/pacman) onto their own LV's.
>
> DR

I agree. I almost forgot that I had run into problems with sshd, LVM and
sudo. but an easy work-around is to use an "empty" /var located on the /
partition. I only has the /var folder structure but not the contents,
then mount the real /var on an LVM2 partition over it....

or as you put it, migrate sub-folders of /var to LVM if they grow too big...

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQEVAwUBRUr8msvODX+91FTAAQIhlAf9G8u4yXh1iDl+rRCXu3AFINk0FKv8vuZl
YBoOFJwBeQWzCDPd+C+ahDwjWPzCLZCWDg1YfGKcdCGdv7Pu+qZuCOYsOJ1EyDTz
QSqDoPZ6DnErXMu+HEYQPIFsGftbVxn5BXlxHu57t3dTOeaJZ6IJi36bpGEj7vNL
+wngGBcYSEQTFDFZDQkhmjN7j4u/H+T200+eUhlwxoEbbEhDBwbZmcWuxNqzIMtu
7rMgNPkALE2sheL0vCn5diE1wsBVjxdRCfTU06jmYK6aySQo2nI/HqgNlbIi7jvr
CP7djbB36heG9f0y9noBKtVyzfVYszeqwBvHKp+jULgXpn/t9AFIuA==
=txz2
-----END PGP SIGNATURE-----


_______________________________________________
arch mailing list
[hidden email]
http://www.archlinux.org/mailman/listinfo/arch