# tip ciscoThis connects you to the serial line labelled as 'cisco' in
/etc/remote. To get out of
[Enter] [~] [.]Configure
/etc/remotewith the serial port you wish to use: /dev/cuaa0 is "COM1" and /dev/cuaa1 is "COM2"
# bash bash-2.03#
# vi <filename> -- edit a file i .... [ESC] -- insert text before cursor position A .... [ESC] -- append text to end of current line x -- delete character under cursor dd -- delete whole line :wq -- save and exit :q! -- exit without saving h j k l -- left|down|up|right (preferred)
The FreeBSD slice is then divided into "partitions". Example:
/dev/ad0 -- first ATA/ATAPI (IDE) hard drive /dev/ad0s1 -- first slice (MSDOS "partition") on first IDE hard drive /dev/ad0s1a -- first partition in this FreeBSD slice /dev/ad0s1b -- second partition in this FreeBSD slice /dev/ad0s1e -- third (usable) partitionFor historical reasons, partitions c and d are not used. We strongly recommend you configure your partitions as:
a: root filesystem (/) b: swap space e,f...: other filesystemsAll "large" parts of the filesystem should be separate from the root, so that the root itself remains small (less likely to get corrupted). This means at least /usr and /var, and possibly also /home if you have user accounts. The convention we have used is to put all remaining disk space in a partition called /u, and put home directories under that (/u/home/name)
Insert boot floppy, change to root floppy when prompted Skip kernel config Express install Delete any existing partitions, then select "Entire disk" Say Yes to standard partition entry Select BootMgr Create partition; ctrl-U to delete number presented, enter "100m" instead FS / Create partition; ctrl-U; 100m Swap Create partition; ctrl-U; 400m FS /var Create partition; ctrl-U; 400m FS /usr Create partition; hit enter to accept number given (i.e. rest of disk) FS /u X-User (must hit SPACEBAR, not Enter, to select it) No crypto Not US resident Yes install ports collection Default answers to remaining questions (i.e. just hit Enter) WAIT for install to complete No extra options after install Exit install Reboot (remember to remove floppy and CD) Login as root halt Label machine as being successfully installed
# /stand/sysinstallHowever, you may find that some of this is quicker to do from the command line, some of which is explained below.
/etc/rc.conf. This file is edited by /stand/sysinstall, but it's perfectly OK to edit this by hand. It is in this file that you configure the hostname, IP address for each interface, and so on. Changes you make in here won't take effect until you reboot.
ifconfig_ed0="inet 18.104.22.168 netmask 255.255.255.248" defaultrouter="22.214.171.124" hostname="pc1.t2.ws.afnog.org" # On hosts where you don't want sendmail to accept incoming port 25 # (but you still want daemons to be able to send outgoing mail): sendmail_flags="-q30m"The full list of options, and their default values, can be found in /etc/defaults/rc.conf - but don't edit this file, edit /etc/rc.conf instead. This makes it easier to upgrade your system to a later version of FreeBSD.
vipwto edit the password file. This actually edits /etc/master.passwd and automatically generates all the other files from this (/etc/passwd, pwd.db, spwd.db)
All this third-party software installs under
You can use
/stand/sysinstall to add packages, but it is
quicker to use 'pkg_add' from the command line. For example, to add 'bash'
# cd /cdrom/packages/All # ls # pkg_add bash-2.03.tgz # pkg_add less-352.tgzNote that the configuration files for third-party software are in
/usr/local/etc, and scripts to start daemons are installed under
You can also compile packages directly from the source code, if you have the "ports" distribution installed. The ports system automatically fetches the source file via FTP or anonCVS, applies any FreeBSD-specific patches, and compiles and installs the code. A "package" is really just a "port" which has been compiled.
# cd /usr/ports/shells/bash # make # make install # make cleanSometimes you will find that a "port" exists, but no corresponding binary "package". This is usually because of licencing or export restrictions. The "port" is always distributable because it does not include any software, only instructions on how to fetch and compile the software from somewhere else.
You can query installed packages, or package .tgz files, using pkg_info.
# pkg_info -aI -- list all installed packages (one line per package) # pkg_info bash-2.03 -- description of package # pkg_info -L bash-2.03 -- list all files in package # man pkg_info -- read this more for details
Linux: eth0 = first ethernet device (of any type) FreeBSD: ed0 = first NE2000 device, ep0 = first 3Com 3c509, etc. Linux: COM1 serial port = /dev/ttyS0 FreeBSD: COM1 serial port = /dev/cuaa0 (call out) or /dev/ttyd0 (call in) Linux: /etc/inittab configures incoming serial connections FreeBSD: /etc/ttys configures incoming serial connectionsSee the FreeBSD handbook and FAQ for more information, at http://www.freebsd.org/