WARNING LONG POST DUE TO IN-DEPTH JUSTIFICATION:

I was just curious if anyone knows, without starting a flame war please,
why Ubuntu went with the default partitioning scheme they did?

It seems to me, that especially with the demographic that Ubuntu
professes to be targeting, a more sophisticated default partitioning
layout would have made sense.  I realize that everyone has their idea of
the "perfect partitioning scheme", but the one partition and a swap
seems poorly designed for the demographic targeted.

As a consultant, when dealing with non-Linux savvy clients, I try to
follow a pattern to find areas of potential runaway growth, and isolate
them for the end users own good.  For reference, here is my decision
tree:

My first partition is Windows if it will be installed on the system.
This way, no matter what I do with partitions in Linux, the Windows C:
remains fixed.

Next, I set up a swap partition equal to 4X memory.  I know that 2X is
traditional, but rarely have I ever had a machine that did not end up
with more memory at the end if its life, than it started with.  Plan for
growth, and don't be surprised by it, I always say.

Next, I set up a boot sector.  Traditionally I used to set these up at
256MB, and that is still fine, but with the larger kernel and hard
drives of today, I usually set this up at 512MB.  I set up the /boot
completely as a CYA move, and it is not mounted by default on Debian and
Red Hat/Suse systems, but are on Ubuntu systems (Ubuntu does kernel
upgrades in its package management systems, while most systems configure
these to not automatically update).  Bottom line, if anything bad
happens, an expert (such as myself) has a jumping in point to fix any
problems.

Next I set up my root partition.  Based upon the type of system, I
configure a percentage and fixed max.  For Ubuntu is 20% of the drive or
20GB, whichever is smaller (RH/Suse have so much junk, this is doubled
for those systems).  This partition is so critical, it can not fill up,
period.  And, for the most part, does not grow much.

Now comes my highly volatile areas.

I like to keep logs on a separate partition.  I have seen these fill
with stupid stuff, both done by the end user, and done by hacking
attempts.  Again, a percentage and fixed max system is used.  Generally
5% of the drive or 5GB, whichever is smaller.

If I have more than 2GB of RAM, I will mount my /tmp directory as tmpfs.

If this account uses system login users (i.e. a desktop, SSH server to
supply shell accounts, file server, etc) where the user accounts are
obtainable from an OS level service such as /etc/passwd or LDAP, I set
up a /home partition.  You haven't lived until you go out to rescue a
machine where the end user ran out of hard drive because they have 4
different full system backups of their old Windows system stored there.
End users do silly things.  They fill their hard drives with You-Tube
videos, and music despite being against corporate policy.  They store 18
versions of the same powerpoint file, etc.  When /home fills two things
can happen... if it is on its own partition, the user is told they can
not save any files.  If /home is part of the root partition, it bricks
your system.

Some systems either have unnamed users (anonymous FTP; http; printer
queues), or users without system accounts (Cyrus IMAP; Database; CRM)
where no /home directory is appropriate.  This data should be stored
in /srv.  Again, all the above gottchas apply as with /home.

Generally a system will have a need for either /home or /srv.  In some
cases both (A web developer may have is own web server, database, etc to
run tests of code before committing to the corporate wide resource).
This is much harder to do in a script, so my examples below assume
Ubuntu server means /srv is needed for its primary user, and Ubuntu
Desktop means /home is needed for its primary use.  As an additional
safety catch I subtract 10% or 10GB from the entire disk, whichever is
greater, that I leave unallocated.  I then allocate 10% or 10GB for the
lesser use above, and the remainder of the drive for the majority use
above.

Examples:
Mail server with Postfix, Courier IMAP, Centralized accounts, no local
login accounts, no Windows, 4GB Ram and 500GB of drive space.

sda1 -> SWAP -> 16GB (remainder 484GB)
sda2 -> /boot -> 512MB (remainder 483.5GB)
sda3 -> / -> 20GB (20%=100GB, remainder 463.5GB)
dsa5 -> /var/log -> 5GB (5% = 25GB, remainder 458.5GB)
sda6 -> /home -> 10GB (secondary use, remainder 448.5GB)
sda7 -> /srv -> 398.5GB (primary use, remainder 50GB)
/tmp configured as tmpfs

Desktop user, local logins, no windows, 2GB Ram and 180GB hard drive.

sda1 -> SWAP -> 8GB (remainder 172GB)
sda2 -> /boot -> 512MB (remainder 171.5GB)
sda3 -> / -> 20GB (20%=36GB, remainder 151.5GB)
sda5 -> /var/log -> 5GB (5%=9GB, remainder 146.5GB)
sda6 -> /home -> 118.5GB(primary use, remainder 28GB)
sda7 -> /srv -> 10GB (secondary use, remainder 18GB)

As a non-Linux user interacts with the system, all the area that can
cause problems are isolated from areas that can make the system to be
unbootable.  Especially with noobs, this layout seems to make more sense
to me.  It has self preservation built in.

While I realize some may think my layout is overkill, and that is not
the point.  I give this as an example of a layout that is easily
calculated, protects the end users data, and important settings, and
provides hooks to allow real propeller heads like myself to come in and
rescue in case of real disaster.  If you use partition labels, Ubuntu
should even be able to identify a /home and /srv partition from an early
install, and attempt to protect data across a complete reinstall!

I guess after this long explanation is... is there a reason that Ubuntu,
given its target on noobs, did not adopt a more protective partitioning
scheme like this?  And more importantly, should we?

-- 
Kevin Fries
Senior Linux Engineer
Computer and Communications Technology, Inc
A Division of Japan Communications Inc.

-- 
Ubuntu-devel-discuss mailing list
Ubuntu-devel-discuss@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel-discuss

Reply via email to