2012-01-14. Since FreeBSD's latest (9.0-RELEASE) seems to have troubles (unfinished mirrors? strange network behaviour?) so that the new friendly installer is unintelligible, it seems necessary to learn the direct way of setting it up without dependence on a TUI installer. Manual pages for relevant commands can be found at e.g. http://www.freebsd.org/cgi/man.cgi?query=$CMD&sektion=8 where $CMD is e.g. newfs # fdisk: PC-"slice" (DOS partition-table) utility # one could just as well use "linux" fdisk if the idea is simply to provide a single BSD partition # -- examples: fdisk /dev/ad0 # list partition table of primary disk fdisk -t -v -f conffile /dev/ad0 # test-run of setting partitions from a config file fdisk -BI /dev/ad0 # initialise (wipe!) partition table, and make new one dedicated to freebsd # bsdlabel: labelling of a BSD (dos-id=0xA5 (165)) slice (or dedicated disk) into bsd partitions # also can install boot-code into the BSD slice bsdlabel /dev/ad0 # list current labelling bsdlabel -A -m amd64 /dev/ad0 # list (as above) including "historical" parts of the label and explicit machine-type -n switch: "pretend" (test-run: no modification) -f switch: operate on file, not block-device bsdlabel /dev/ad0 >saved-label # save details bsdlabel -R /dev/ad1 saved-label # restore saved details (to other disk, in this example) bsdlabel -w /dev/ad0 # set default labelling (single "c" 'overlap' partition, with "a" using all its space) bsdlabel -e /dev/ad0 # interactive edit of current label, followed by write format of file edited during "-e" option of bsdlabel: letter: size offset fstype [fsize bsize bps/cpg] where: letter is c for the overlap (whole slice), others are a--h (as solaris etc), size -- default sectors, else K,M,G prefixes, or % (percent free), or * (remainder) offset is start of partition, or * for automatic (previousend+1) fstype is "unused" "swap" "4.2BSD" (for ufs) or "vinum" (vol-man) others can be used for 4.2BSD partitions, but aren't needed (see "newfs" options for fragment-size, block-size, cyls-per-group) bsdlabel -B /dev/ad0 # install boot code from default /boot/boot bsdlabel -B -b myboot /dev/ad0 # install boot code from file "myboot" # gpart: disk-partitioning "GEOM" class... purpose: partitioning, in particular when a partition is to be >2TB (limit of bsdlabel method) # gmirror: mirrored devices (raid1, only) gmirror list gmirror status ... many more # newfs: basically, mkfs.ufs newfs /dev/ad0s1a # new filesystem on 1st bsd-partition of second dos-slice newfs -L USR -O 2 -U /dev/ad0s1a # ufs2(default) with soft-updates, labelled 'USR' newfs -m 5 -r 256 -o time -g 1024 -b 8192 -E -p a /dev/ad0s1 # 5% free, reserve 256 sectors at end, expect 1K mean filesize, set 8K blocks, erase partition, # and use partition 'a' (-p a /dev/ad0s1 is same as /dev/ad0s1a, useful if the latter not shown in /dev) # from: http://www.freebsd.org/doc/en/articles/remote-install/installation.html # an example of using these commands for a mirrored pair of disks fdisk -BI /dev/ad0 fdisk -BI /dev/ad1 bsdlabel -wB /dev/ad0s1 bsdlabel -wB /dev/ad1s1 bsdlabel -e /dev/ad0s1 bsdlabel /dev/ad0s1 > /tmp/bsdlabel.txt bsdlabel -R /dev/ad1s1 /tmp/bsdlabel.txt gmirror label root /dev/ad[01]s1a gmirror label var /dev/ad[01]s1d gmirror label usr /dev/ad[01]s1e gmirror label -F swap /dev/ad[01]s1b newfs /dev/mirror/root newfs /dev/mirror/var newfs /dev/mirror/usr # so a basic recipe is: boot from removal medium (USB, CD, ....) (fdisk, if not already done from another system to make bsd slice) bsdlabel -wB newfs [OPTS] (likewise other partitions) mount /mnt mkdir /mnt/usr && mount /mnt/usr (likewise /tmp etc) cd /mnt/ for f in /usr/freebsd-dist/*.txz; do xz -d <$f | tar -x -v -f - ; done (consider the following for an old system -- as of 9.0 there's already a /boot/kernel) cp -Rp /boot/GENERIC/* /boot/kernel/ (might like to take latest boot-code? cp /mnt/boot/boot /tmp/b, then after unmounting all the partitions can run bsdlabel -B -b /tmp/b ; this can't run if the slice is in use) Edit /etc/rc.conf, /etc/resolv.conf, /etc/fstab (see live-cd/usb system's fstab, and etc/defaults/rc.conf Can use chroot /mnt to avoid mistakes of editing wrong /etc ! Might care to set root password and users. (Note: root pw in new system conveniently defaults to empty.) Then unmount all, and reboot!