User Tools

Site Tools


unix:freebsd:system_builds:basic_freebsd_installation

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
unix:freebsd:system_builds:basic_freebsd_installation [2019/11/07 02:16] rodolicounix:freebsd:system_builds:basic_freebsd_installation [2019/12/03 15:35] (current) rodolico
Line 42: Line 42:
 where //username// is the username you want to add. where //username// is the username you want to add.
  
-===== Post Installation Partitions =====+===== Post Installation File System Modifications =====
  
 Note that /tmp is missing and there is no swap space. The first thing I want to do is set /tmp and /var/tmp to use the same ramdisk (aka tmpfs). Assuming I have sufficient RAM, I can allocate some space for tmp, which makes things faster and cleaner. Note that /tmp is missing and there is no swap space. The first thing I want to do is set /tmp and /var/tmp to use the same ramdisk (aka tmpfs). Assuming I have sufficient RAM, I can allocate some space for tmp, which makes things faster and cleaner.
  
 Additionally, I want to create a swap file to replace the partition. Swap is very nice to have, but rarely used, but I had one case where my swap partition was just too damned small and the server started acting squirrely whenever there was a lot of ZFS activity. Additionally, I want to create a swap file to replace the partition. Swap is very nice to have, but rarely used, but I had one case where my swap partition was just too damned small and the server started acting squirrely whenever there was a lot of ZFS activity.
 +
 +  - Make a backup copy of /etc/fstab
 +  - create a 4G file to be used for swap space. modify size as necessary
 +  - Create the entry in fstab for the swap space
 +  - turn on swap
 +  - create a tmpfs entry in fstab for /tmp
 +  - move /var/tmp to point to /tmp
 +  - activate /tmp. This could cause instability if something is being used, so reboot very soon
 +  - display mounts (prove we did what we expected to)
 +  - reboot to be on safe side
  
 <code bash> <code bash>
-# create a 4G file to be used for swap spacemodify size as necessary+cp /etc/fstab /etc/fstab.bak
 dd if=/dev/zero of=/swapfile bs=1G count=4 dd if=/dev/zero of=/swapfile bs=1G count=4
-# Create the entry in fstab 
 echo 'md99  none  swap  sw,file=/swapfile 0 0' >> /etc/fstab echo 'md99  none  swap  sw,file=/swapfile 0 0' >> /etc/fstab
-# create tmpfs entry in fstab for /tmp+swapon -a
 echo 'tmpfs  /tmp  tmpfs  rw,mode=01777 0 0' >> /etc/fstab echo 'tmpfs  /tmp  tmpfs  rw,mode=01777 0 0' >> /etc/fstab
-# move /var/tmp to point to /tmp 
 rm -fR /var/tmp rm -fR /var/tmp
 ln -s /tmp /var/tmp ln -s /tmp /var/tmp
-# activate /tmp. This could cause instability 
 rm -fR /tmp/* rm -fR /tmp/*
 mount /tmp mount /tmp
-# Just to be on the safe side, reboot +mount
-# might as well plug the rest of the drives in +
-# if you removed them as we normally do, then+
 reboot reboot
 </code> </code>
Line 69: Line 74:
 ===== Install some basic packages ===== ===== Install some basic packages =====
  
-I generally like some things that are not installed by default for FreeBSD (or Debian Linux, or Microsoft Windows, or Apple OSX, for that matter). For instance, I accept the larger size of bash for the extra functionality, and I'm lost without the //joe// editor. Some people are just more comfortable with a web UI than the standard CLI, so they might consider installing webmin ([[https://webmin.com]]). We will install +I generally like some things that are not installed by default for FreeBSD (or Linux, or Microsoft Windows, or Apple OSX, for that matter). For instance, I accept the larger size of bash for the extra functionality, and I'm lost without the //joe// editor. Some people are just more comfortable with a web UI than the standard CLI, so they might consider installing webmin ([[https://webmin.com]]). We will install 
-  * joe (because its my favorite editor)+  * joe (because it'my favorite editor)
   * postfix (because I hate sendmail)   * postfix (because I hate sendmail)
   * bash (a lot more robust than sh)   * bash (a lot more robust than sh)
Line 80: Line 85:
   * ipmitool (if this is a server with ipmi enabled functions)   * ipmitool (if this is a server with ipmi enabled functions)
   * pbzip2 and xz (good compression technologies)   * pbzip2 and xz (good compression technologies)
 +  * smartmontools (monitors your hard drive health)
  
-I'll label the steps as "webmin only" or "bash only" so you can easily not use them.+I've label the steps as to indicate what the code is setting up so you can easily not use some packages.
  
   - Install the packages - Answer 'Y' when asked if you want to enable postfix<code bash>   - Install the packages - Answer 'Y' when asked if you want to enable postfix<code bash>
-pkg install joe perl5 pv pbzip2 xz sudo screen webmin ipmitool postfix bash+pkg install joe perl5 pv pbzip2 sudo screen webmin ipmitool postfix bash smartmontools
 </code> </code>
   - Set up postfix and disable sendmail<code bash>service sendmail stop   - Set up postfix and disable sendmail<code bash>service sendmail stop
Line 91: Line 97:
 mv /etc/mail/mailer.conf /etc/mail/mailer.conf.old mv /etc/mail/mailer.conf /etc/mail/mailer.conf.old
 install -m 0644 /usr/local/share/postfix/mailer.conf.postfix /etc/mail/mailer.conf install -m 0644 /usr/local/share/postfix/mailer.conf.postfix /etc/mail/mailer.conf
-# clean up some leftover sendmail stuff 
 echo 'daily_clean_hoststat_enable="NO"' >> /etc/periodic.conf echo 'daily_clean_hoststat_enable="NO"' >> /etc/periodic.conf
 echo 'daily_status_mail_rejects_enable="NO"' >> /etc/periodic.conf echo 'daily_status_mail_rejects_enable="NO"' >> /etc/periodic.conf
 echo 'Daily_status_include_submit_mailq="NO"' >> /etc/periodic.conf echo 'Daily_status_include_submit_mailq="NO"' >> /etc/periodic.conf
 echo 'daily_submit_queuerun="NO"' >> /etc/periodic.conf echo 'daily_submit_queuerun="NO"' >> /etc/periodic.conf
-# add postfix user to mail group so it has access to sasl 
 pw group mod mail -m postfix pw group mod mail -m postfix
-# start postfix mail server 
 service postfix start service postfix start
 </code> </code>
Line 105: Line 108:
 echo '# enable bash' >> /etc/fstab echo '# enable bash' >> /etc/fstab
 echo 'fdesc  /dev/fd  fdescfs  rw     0' >> /etc/fstab echo 'fdesc  /dev/fd  fdescfs  rw     0' >> /etc/fstab
-# you an now set the shell for any user with 
 chsh -s bash username chsh -s bash username
 </code> </code>
Line 113: Line 115:
   - Set up ipmitool<code bash>kldload ipmi   - Set up ipmitool<code bash>kldload ipmi
 echo 'ipmi_load="YES"' >> /boot/loader.conf</code> echo 'ipmi_load="YES"' >> /boot/loader.conf</code>
 +  - Set up smartmontools to monitor your drives<code bash># edit the next file for your system after you copy it
 +cp /usr/local/etc/smartd.conf.sample  /usr/local/etc/smartd.conf
 +echo 'daily_status_smart_devices="/dev/ad0 /dev/da0"' >>/etc/periodic/daily/850.smartmontool
 +chmod 755 /etc/periodic/daily/850.smartmontool
 +echo 'smartd_enable="YES"' >> /etc/rc.conf
 +service smartd start
 +</code>
  
 ===== References ===== ===== References =====
unix/freebsd/system_builds/basic_freebsd_installation.1573114593.txt.gz · Last modified: 2019/11/07 02:16 by rodolico