MonkeyBrains.net/~rudy/example Random examples

  Partitioning your BSD box!  
Here is a brief explanation of what the partitions hold.
  • /
    size: 256M - 512MB
    Has this stuff /bin /sbin /boot /root and needs to have room for a couple of kernels. 256MB - 512MB is what we usually do. This partition should RARELY be written to. If you were real paranoid, you could set this partition to ReadOnly on a stable, production box.
  • swap
    size: double your the RAM installed
    If you have 1GB installed, but you plan on upgrading to 2GB in a couple of months, go ahead and set your swap to 4GB.
  • /var
    size: 6GB - 8GB
    With disks so big, I usually make this anywhere from 2 to 8GB. It sucks when someone turns on logging and the partition fills up. Also, mail queues and mysql (without configuring to use another partition) uses /var.
  • /tmp
    size: 512MB - 1GB
    Temp! Make this NOEXEC in your /etc/fstab. If you have troubles with installworld, you may need to make the partition EXEC. I usually make this 512MB to 1 or 2 GB depending on whether or not users are trained to use /tmp. Most people just through things in their home directory (or worse /root). Recommendation if you are using the noexec flag on /tmp in your fstab file:
    mv /var/tmp /tmp/var-tmp; cd /var && ln -s /tmp/var-tmp tmp
  • /usr
    size: 6GB - 8GB
    More executables (/usr/bin), 3rd party software (in /usr/local), config files for 3rd party stuff.
  • /data
    size: The Rest Of the Disk
    Really, this can be called anything. /data /mysql /mail /home /www, depending on what you use the box for. Often, we call it /data and then symlink things to it, like "ln -s /data/www /www". /data is where stuff developers and designers put stuff.
    > df -m disks with da
    Filesystem  1M-blocks   Used  Avail Capacity  Mounted on
    /dev/da0s1a       247     94    133    41%    /
    /dev/da0s1d       989     13    896     2%    /var
    /dev/da0s1e       989      1    908     0%    /tmp
    /dev/da0s1f      7931   1807   5489    25%    /usr
    /dev/da0s1g    281387 146651 112224    57%    /data
    
    For that same machine, here is the BSDLABEL output.
    > bsdlabel da0s1
    # /dev/da0s1:
    8 partitions:
    #        size   offset    fstype   [fsize bsize bps/cpg]
      a:   524288       16    4.2BSD     2048 16384 32776 
      b:  8388608   524304      swap                    
      c: 624944502        0    unused        0     0         # "raw" part, don't edit
      d:  2097152  8912912    4.2BSD     2048 16384 28552 
      e:  2097152 11010064    4.2BSD     2048 16384 28552 
      f: 16777216 13107216    4.2BSD     2048 16384 28552 
      g: 595000000 29884432    4.2BSD     2048 16384 2855
    
    And here is the /etc/fstab
    > cat /etc/fstab 
    # See the fstab(5) manual page for important information on automatic mounts
    # of network filesystems before modifying this file.
    #
    # Device                Mountpoint      FStype  Options         Dump    Pass#
    /dev/da0s1b             none            swap    sw              0       0
    /dev/da0s1a             /               ufs     rw              1       1
    /dev/da0s1e             /tmp            ufs     rw,noexec       2       2
    /dev/da0s1f             /usr            ufs     rw              2       2
    /dev/da0s1d             /var            ufs     rw              2       2
    /dev/da0s1g             /data           ufs     rw              2       2
    /dev/cd0                /cdrom          cd9660  ro,noauto       0       0
    proc                    /proc           procfs  rw              0       0
    
More resources
  • fdisk
  • bsdlabel
  • This data is completely accurate.