[Nottingham] How to partition a server for general home use?

Martin martin at ml1.co.uk
Thu May 10 21:36:25 UTC 2012


Inlined in haste:

On 10/05/12 22:01, Jason Irwin wrote:
> This should be easy, but all the documentation I can find seems to be
> pre-2007 and decidedly obtuse.
> 
> The situation:
> One HP Microserver
> 8GB RAM
> 2x2TB low power SATA HDDs
> Optional: 16GB bootable USB stick
> 
> Intended use:
> Bit of a back-up, bit of a file server (Samba is fine for my needs)
> Maybe a bit of a VM hosting at times (possible VBox, maybe something else)
> Might even run ownCloud (perhaps in a VM).
> So a general purpose dogsbody really.
> 
> The problem:
> How to partition the bugger?
> I'd like the drives to be in RAID1.  Fine, that's easy enough.

Fine. Do your md-raid on the ENTIRE DEVICE: /dev/sda /dev/sdb
Then partition or LVM on top of that.

> I'd also like to use LVM for at least /home so that if I add other
> drives later I have less grief.

In that case you may aswel LVM all of your md-raid. Ensure you use the
latest raid version so that the raid stuff is safely stuffed away up at
the end of the device. For such big drives, setting to use a bit-intent
map may be a good idea to avoid lengthy resyncs for any hiccups.

> But can /boot be on LVM?  What about /?  The docs I am finding say "no"
> to both.  And what about swap?

/boot best not to... Put that on your USB memory stick. Ideal for it!
Very easy to change your boot if you ever wish to.

swap on the raid is fine (used to be a problem in ancient times, long
since fixed). For the sake of it, go for the old standard x2 RAM (hence
16GBytes).


> So, near as I can figure, I need /boot and / as distinct, non-RAID,
> non-LVM partitions.

That depends upon your distro. Recent distros should be fine with / on
LVM on RAID.


> Then RAID the remaining space (losing the matching/boot and / space on
> the second drive)

Can do, but easier to RAID the lot. With the RAID details at the end,
you can have your partition table, then /boot, and then have LVM in one
partition for the remainder. So, three primary partitions. The RAID1
means you automatically get the partition table and /boot replicated and
your BIOS will blindly boot off either.

When one disk fails, its then a 50-50 chance as to which one you were
booting off! Hence use the memory stick for boot instead, and have a
backup copy memory stick of that.

Don't RAID memory sticks... They die very quickly from such abuse.



> LVM that and from /home in there
> That strikes me as being a bit wrong and overly complex.

Yes, indeed so ;-)


> I had originally though about have /boot and / on the USB stick, but
> then I got into a similar fankle with over /tmp and /var/log.

You can do, but you need to take some care to put /tmp /var/tmp /var/run
into tmpfs or onto your HDD. Or change your memory stick after a year or
few depending on usage (filesystem dependant).


> Does anyone know of an up-to-date reference on this?  I've nothing
> against command line-fu at all, but what I am running across assumes the
> reader is already an expert.  And is there some unwritten law about
> diagrams in Linux docs?  They appear to be forbidden.

Nope... Geeks all assume you are already geekie :-)

Beer helps!


> Normally I just do /, /home and swap and leave it at that.  I've also
> never used LVM before.
> 
> Sorry for the semi-rant, any help appreciated!

Good questions.


You could pioneer with btrfs and not bother with the RAID + LVM. I've
done that for one non-critical system and it's been fine for over a year
now. However, I do keep backups!

Otherwise, use the GPT partitioning rather than learn LVM for the sake
of gaining many 'partitions'.

Or use just the three primary partitions and LVM and learn something new
and fun!

Also, a good layout is to have /boot first, followed by swap, and then
any system stuff, then followed by any big stuff. HDDs are fastest on
the outer cylinders. Conversely, SSDs are completely don't care.

Having /boot first is just good old convention even though now largely
unnecessary. It may aswel be on a memory stick.


Hope that rattles a few thoughts :-)

Cheers,
Martin


-- 
- ------------------ - ----------------------------------------
-    Martin Lomas    - OpenPGP (GPG/PGP) Public Key: 0xCEE1D3B7
- martin @ ml1 co uk - Import from   hkp://subkeys.pgp.net   or
- ------------------ - http:// ml1 .co .uk/martin_ml1_co_uk.gpg



More information about the Nottingham mailing list