partitioning
A couple of month ago we had a discussion about partitioning on the USENIX/Sage mailing list. Laziness tends to configure only 3 partitions today: /boot, swap and /. With LVM you can easily resize partitions and there are quite some advantages:
- mount partitions like /usr read-only if r/w isn’t needed.
- start /dev/sda1 (/boot) on sector 63 and end of a 64kb -1 sector. RHEL6 should take care of that.
- if var is on / and / is full files in /etc can get corrupted. Ending in a unbootable system.
- infrequent writes to core partitions like / usr are better during power failure.
Looking around on some of my systems i figured this one as a practical layout:
| mount point | partition type | size recommenation | mount options | comment |
|---|---|---|---|---|
| /boot | real partition | 200 MB | defaults,noatime,nosuid,nodev,noexec | |
| /var | lvm | 16 GB or more. | nosuid,nosgid,nodev | |
| /tmp | lvm | 4 GB | noatime,nodev,nosuid,nosgid | |
| /usr | lvm | 16 GB | noatime,nodev | |
| /usr/local | lvm | noatime,nodev | ||
| /home | lvm | 20 GB | noatime,nosuid,nosgid,nodev | on systems with users |
| ’/ | lvm | 1 GB | noatime |
| Available RAM | Swap space required |
|---|---|
| Between 1GB and 2GB | 1.5 times the size of RAM |
| Between 2GB and 8GB | Equal to the size of RAM |
| More than 8GB | .75 times the size of RAM |