MicroLPS


A personal website

Search

Site friends

Investworkflow.com 茶马股道 
PMP exam guilde referece 
PMI  IBM SAP

Catalog categories

Unix&Linux [5]
free OS CentOS BSD

Login form

Statistics


Total online: 1
Guests: 1
Users: 0

Our poll

Rate my site
Total of answers: 6
Sunday, 2024-12-22, 3:17 PM
Welcome Guest
Main | Registration | Login | RSS

Publisher

Main » Articles » OS » Unix&Linux

Linux 下的推荐分区方案




/boot (100MB)
 boot 分区用来存放 Linux 内核,100MB 足够了。
 
/ (5GB)
 root 分区用来存放系统主要文件、程序等。CentOS/RHEL 5 最小安装需要 3GB,全安装(安装所有包)需要 5GB,所以给 5GB 应该够了。
 
/var (5GB)
 var 分区通常包括一些日志、临时文件、运行时目录等,推荐 3GB 以上,5GB 应该够了。
 
/home
 home 分区包含所有用户的数据,需要最多的硬盘空间,剩下的空间都分给它。
 
swap
 上个世纪的时候,看过的几乎所有 Linux 系统管理的书上都推荐设置交换分区大小为内存的2倍。这些建议到了现在就是那么适用了,现在的服务器动不动就是 16GB/32GB 内存,难道相应的交换分区也要扩大到 32GB/64GB?根据 OpenBSD 的安装建议:
 

Many people follow an old rule of thumb that your swap partition should be twice the size of your main system RAM. This rule is nonsense. On a modern system, that’s a LOT of swap, most people prefer that their systems never swap. You don’t want your system to ever run out of RAM+swap, but you usually would rather have enough RAM in the system so it doesn’t need to swap. If you are using a flash device for disk, you probably want no swap partition at all. Use what is appropriate for your needs.
 
再看看 RHEL 5 推荐的 swap 分区大小:
 

Swap should equal 2x physical RAM for up to 2 GB of physical RAM, and then an additional 1x physical RAM for any amount above 2 GB, but never less than 32 MB. For systems with really large amounts of RAM (more than 32 GB) you can likely get away with a smaller swap partition (around 1x, or less, of physical RAM).
 
上面说的是一般情况,在安装系统的时候很难决定多大的交换空间,往往需要根据服务器实际负载、运行情况、以及未来可能应用来综合考虑 swap 分区的大小,所以这里参考推荐最小 swap 大小更实际一些:
 ■  4GB 或 4GB 以下内存的系统,最小需要 2GB 交换空间;
 ■  大于 4GB 而小于 16GB 内存的系统,最小需要 4GB 交换空间;
 ■  大于 16GB 而小于 64GB 内存的系统,最小需要 8GB 交换空间;
 ■  大于 64GB 而小于 256GB 内存的系统,最小需要 16GB 交换空间。

Source:
Category: Unix&Linux | Added by: peng (2013-04-02)
Views: 1389 | Rating: 0.0/0 |
Total comments: 0

Only registered users can add comments.
[ Registration | Login ]