This document describes the installation of DragonFly BSD on a plain i386 machine. Besides upgrading a FreeBSD 4.* system to run DragonFly, another way is installing from a bootable CD.
This CD is available at one of the current mirrors, which distribute the images by various protocols. You can find the authorative list at the DragonFly BSD official download page.
People of the DragonFly development team are working on an automatic installation tool, which simplifies the partitioning and installation. Until this tool is in place, these things must be done manually.
Since rumors say that there are people who don't have an extra machine at hand for every new operating system, the proceeding for installing in a multiboot-environment is documented as well.
If you use an old machine (like me, where the BIOS-management-tool was somewhere on the disk once upon a time), you maybe don't have the option to boot from a CD. Use a bootmanager on a floppy in those cases. A pretty cool and lightweight one is the Smart Bootmanager.
Getting the disk ready for exclusive use with DFly is relatively simple:
Take your favourite partition-tool, which supports resizing partitions. I haven't heard of any fdisk version that supports that. I personally like GNU parted, a partitioner that works well with common filesystems and is pretty intuitive to handle. It can be found on the KNOPPIX-CD or on some bootdisks like the PAUD. The original bootimages from the GNU project's download sites aren't available at the moment.
Resize one of your old partitions and create a new primary one. Don't bother with formatting and stuff like that. If you're done, fire up your live CD and wait. Reading the README in the root-directory never hurts. It actually contains the major part of what you can read here.
You may need a DOS-formatted floppy-disk somewhere in the middle of the installation process. To save you the hassle in case you don't know how, here the proceeding:
Should you run Windows, you can use the Win NT/2000/XP bootmanager. I'm not a dedicated friend of Windows, but I think I found out how it works. It requires a bit of fiddling, though.
Done that, install Dragonfly regularly as follows in the next paragraphs. You also have to install the DragonFly loader as usual. When you've rebooted DFly for the first time and you're sure it boots the way you want it, back up the new MBR too as described above. Then restore your old MBR and copy the DragonFly MBR to a floppy/USB-stick or so.
Boot Windows and copy the file from disk into the C:\ folder. Now tell boot.ini what you want it to do.
Don't forget to increase the timeout, should it be on zero.
Users of Win98 better choose the DragonFly bootmanager; this works quite well.
If you want to use the DragonFly bootmanager, you can zero-out your MBR as shown above, else tell your LILO/GRUB/whatever about the partition when you're done.
It should be easy to find out which is the right one. If your partition or slice for DragonFly is for example the first, substitute the specified slice with ad0s1 in the next sections. Think twice before typing since you could destroy your other system(s).
Don't do this if you want to use the bootloader of another OS like on this machine!
boot0cfg boots from slice 1 by default; modify it with the -s SLICE option.
Substitute the slicenames depending on the one you want to use for DragonFly BSD. If the device-node of your specified slice does not exist, you have to create it before. The same holds for the partitions you might create. The only disk device-nodes created by default are ad0s1's.
Now set up the partition-table:
The next command will throw you into vi for editing the table to your needs. disklabel shows the offset from the beginning of the specified partition, so don't fear you might overwrite something important. An example disklabel can be found in /etc/disklabel.ad0s1, just to know the style.
A quite common configuration looks like this:
|ad0s2a||256m||This will be your /|
|ad0s2b||1024m||This will be the swap-partition|
|ad0s2c||leave alone||This enty represents the whole slice|
|ad0s2d||256m||This will be you /var|
|ad0s2e||256m||This will be your /tmp|
|ad0s2f||8192m||This will be /usr, should be at least 4096m|
|ad0s2g||*||All the rest goes into /home|
Get the fresh partitions into your system and copy the contents of the CD to disk.
Most of the installation-work is accomplished now, but there are still some things to be done.
If you made a /tmp-partition, it is reasonable to link /var/tmp to /tmp.
To mount the right filesystems, set up fstab to reflect your configuration. Best modify /mnt/fstab.example and move it to fstab then. You maybe want to mount your /tmp directory on MFS, so it is truly temporary.
Backing up your current disklabel is a good idea, should you ever need it again (e.g. corrupted disk, lost partition table).
Last there are some files only required by the CD which you got to remove to get your system started from the harddisk.
At this moment it should be possible to reboot and start off the disk. Don't just hit the reset-button, because you can't be sure that the disk is already sync'ed. Remove the CD before your machine boots anew.
If you encounter complications on booting from disk, try these things:
If your system works correctly from the harddisk, you should concern yourself with setting up a base configuration. This includes setting the hostname, choosing a keymap, configuring the network, setting up cron and so on.
Choose your favourite one, remember the name and place an additional line in /etc/rc.conf to load it at startup (e.g. echo 'keymap="german.iso.kbd"' >> /etc/rc.conf).
To set the hostname, proceed the same way and insert a line like hostname="elektra" into /etc/rc.conf. Having done this, tell /etc/hosts about.
Have an overall look at /etc/rc.conf to enable cron, usbd and the like.
It is a good idea to set your timezone, because some progs which do a time-related syscall would be unhappy with a result of Dec 1969. Just in case.
If you're a lazy bone like me and hate to pwd all the time to know where you are, modify the line set prompt 0 "'hostname -s'# " in .cshrc to set prompt = "'hostname -s':%/# ".
If you don't have a special affinity for vi, install an editor that is more simple to handle. I personally prefer nano, because it is small and simple. It will install into /usr/local/bin.
Should your network-interface(s) not work properly, try to load some modules from /modules via kldload.
To configure DHCP, place a line like ifconfig_ep0="DHCP" in /etc/rc.conf; if you need a fixed IP, something like ifconfig_ep0="inet 22.214.171.124 netmask 255.255.255.0" is what you want.
Since USB is not fully loaded when DragonFly is started from CD, you have to activate is after an HD-install. This is mainly because USB is still under development and could prevent the CD from booting cleanly.
If you run out of device-nodes because you hav a lot of USB-devices, you maybe have to create additional ones.
Don't forget to set usbd_enable to YES int /etc/rc.conf.
You can use CVSup to get the DragonFly repository, the FreeBSD ports-tree and anything else you find in any CVS-archive. CVSup is a port, but included on the CD. There are some examples provided in /usr/share/examples/cvsup; if you want to know more about it, try "man cvsup".
I will describe only how to obtain the DragonFly CVS-repository, the DragonFly supfile, the FreeBSD ports and the respective supfile, since this is what you really want. If you've done the initial setup and you are blessed with a permanent connection to the internet, you may want to create a cronjob to keep it up to date. But please do not run such an unattended job more than once a day.
Have a look at the supfiles first, since there's the additional option to use a 'checked out' copy of the source tree instead of syncing with the tree itself. This makes sense if you don't plan to do development work or are low on disk space. If you choose to do so, a cvsup SUPFILE suffices to get everything you need.
To rebuild the system from the files obtained by CVS, do a build- and installworld.
If kernel-compiling is what your heart yearns for, proceed like described below. Create your custom kernel-config in /usr/src/sys/i386/conf/<YOURKERNEL>. If you do so, remember to keep a working kernel in /. /kernel.old is overwritten when you make installkernel; /kernel.GENERIC or /kernel.bak is a good thing to have if something goes wrong.
In any case you should consult the /README file, since by now it's the most up-to-date documentation-file for setting up DragonFly BSD. Some things mentioned there are not part of this writeup. If changes occur, you will likely find it in the README.
If you find some ugly written English here and feel provocated, drop me a mail. English is not my mothertongue.
This document was generated using AFT v5.094 and aft-dfly-html.pm