Obviously, the answer to this question varies tremendously based on your use of the system. However, these numbers can be used as a starting point:
(root) 60MB
/usr 420MB (no X) or 550MB (with X)
/var 25MB
/tmp 50MB
swap 32MB
Those are minimum suggested filesystem sizes for a full system install. The numbers include enough extra space to permit you to run a typical home system that is connected to the Internet, but not much else.
Keep the following facts in mind, however:
• These are minimum values. Disk space is relatively cheap now, trying to squeeze your system into the smallest possible disk is rarely worth the effort. For special purpose applications, the above numbers can be made smaller, but you will need to experiment with it.
• These numbers do NOT include the ports tree.
• If you plan to install a significant amount of third party software, make your /usr partition much larger. How large will depend on your applications, of course.
• For a system that handles lots of email or web pages (stored, respectively, in /var/mail and /var/www) you will want to make your /var partition significantly larger, or put them on separate partitions.
• For a multiuser system which may generate lots of logs, you will want to make your /var partition significantly larger still, or create a separate log partition (/var/log).
• If you plan to rebuild the kernel and system from source, you will want to make the /usr partition significantly larger, 4G is not a bad size.
• Compiling some ports from source can take huge amounts of space on your /usr and /tmp partitions. This is another reason we suggest using pre-compiled packages instead.
• The /tmp partition is used in the compiling of ports, among other things, so how big you make it depends on what you do with it. 50M may be plenty for most people, but some large applications may require 100M or more of /tmp space.
• The 'b' partition of your first drive automatically becomes your system swap partition -- we recommend a minimum of 32MB but if you have disk to spare make it at least 64MB. If you have lots of disk space to spare, make this 256MB, or even 512MB. On the other hand, if you are using a flash device for disk, you probably want no swap partition at all. 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. Use what is appropriate for your needs.
• Swap and /var spaces are used to store system core dumps on in the event of a crash(8). If this is a consideration for you, your swap space should be slightly larger than the amount of main memory you are likely to ever have in the system. Upon reboot, savecore(8) will attempt to save the contents of the swap partition to a file in /var/crash so again, if this is a priority for you, your /var partition must have enough free space to hold these dump files. Be realistic -- few developers will want to look at your 1GB dump file, so if you aren't planning on investigating a crash locally, this is probably not a concern.
There are several reasons for using separate filesystems, instead of shoving everything into one or two filesystems:
• Security: You can mark some filesystems as 'nosuid', 'nodev', 'noexec', 'readonly', etc. This is done by the install process, if you use the above described partitions.
• Stability: A user, or a misbehaved program, can fill a filesystem with garbage if they have write permissions for it. Your critical programs, which of course run on a different filesystem, do not get interrupted.
• Speed: A filesystem which gets written to frequently may get somewhat fragmented. (Luckily, the ffs filesystem that OpenBSD uses is not prone to heavy fragmentation.)
• Integrity: If one filesystem is corrupted for some reason then your other filesystems are still OK.
• Size: Many machines have limits on the area of a disk where the boot ROM can load the kernel from. In some cases, this limit may be very small (504M for an older 486), in other cases, a much larger limit (for example, 2G, 8G, or 128G on i386 systems). As the kernel can end up anywhere within the root partition, the entire root partition should be within this area. For more details, see this section. A good guideline might be to keep your / partition completely below 2G, unless you know your platform (and particular machine) can handle more (or less) than that.
Some additional thoughts on partitioning:
• For your first attempt at an experimentation system, one big / partition and swap may be easiest until you know how much space you need. By doing this you will be sacrificing some of the default security features of OpenBSD that require separate filesystems for /, /tmp, /var, /usr and /home. However, you probably should not be going into production with your first OpenBSD install.
• A system exposed to the Internet or other hostile forces should have a separate /var (and maybe even a separate /var/log) for logging.
• A /home partition can be nice. New version of the OS? Wipe and reload everything else, leave your /home partition untouched. Remember to save a copy of your configuration files, though!
• A separate partition for anything which may accumulate a large quantity of files that may need to be deleted can be faster to reformat and recreate than to delete. See the building by source FAQ for an example (/usr/obj).
• If you wish to rebuild your system from source for any reason, the source will be in /usr/src. If you don't make a separate partition for /usr/src, make sure /usr has sufficient space.
• A commonly forgotten fact: you do not have to allocate all space on a drive when you set the system up! Since you will now find it a challenge to buy a new drive smaller than 20G, it can make sense to leave a chunk of your drive unallocated. If you outgrow a partition, you can allocate a new partition from your unused space, duplicate your existing partition to the new partition, change /etc/fstab to point to the new partition, remount, you now have more space.
• If you make your partitions too close to the minimum size required, you will probably regret it later, when it is time to upgrade your system.
• If you make very large partitions, keep in mind that performing filesystem checks using fsck(8) requires about 1M of RAM per gigabyte of filesystem size, and may be very time-consuming or not even feasible on older, slower systems (please also refer to this section).
• If you permit users to write to /var/www (i.e., personal web pages), you might wish to put it on a separate partition, so you can use quotas to restrict the space they use, and if they fill the partition, no other parts of your system will be impacted.
| Depan | Profil | Galeri | Artikel | Tutorial | Humor | Berita Terkini | Info Lowongan Kerja | Cara Cari Uang |
-----------------------------------------------------------------
-----------------------------------------------------------------
"Tujuan yang besar memberikan hasil yang besar. Tidak ada tujuan tidak ada hasil apapun, atau menghasilkan tujuan orang lain" (Mark Victor Hansen)
Sep 2, 2008
Subscribe to:
Post Comments (Atom)


No comments:
Post a Comment