~terry
Tue, Jun 12, 2001 (11:06)
seed
Time for a FreeBSD topic, since that's what we user. I'm building a FreeBSD box so I'll use this to document my steps to start our discussion.
6 new of
~terry
Tue, Jun 12, 2001 (11:07)
#1
Here's how you create the install floppies from the 4.3 CD:
For a normal CDROM or network installation, all you need to copy onto
actual floppies from this directory are the kern.flp and mfsroot.flp
images (for 1.44MB floppies).
Get two blank, freshly formatted floppies and image copy kern.flp
onto one and mfsroot.flp onto the other. These images are NOT DOS
files! You cannot simply copy them to a DOS or UFS floppy as
regular files, you need to "image" copy them to the floppy with
fdimage.exe under DOS (see the tools/ directory on your CDROM or
FreeBSD FTP mirror) or the `dd' command in UNIX.
For example:
To create the kern floppy image from DOS, you'd do something like
this:
C> fdimage kern.flp a:
or
d:\tools>fdimage -v -f 1.44M d:\floppies\mfsroot.flp a:
Assuming that you'd copied fdimage.exe and kern.flp into a directory
somewhere. You would do the same for mfsroot.flp, of course.
If you're creating the boot floppy from a UNIX machine, you may find
that one of the following:
dd if=floppies/kern.flp of=/dev/fd0
dd if=floppies/kern.flp of=/dev/rfd0
dd if=floppies/kern.flp of=/dev/floppy
work well, depending on your hardware and operating system environment
(different versions of UNIX have totally different names for the
floppy drive - neat, huh? :-).
Going to two installation boot floppies is a step we definitely
would have rather avoided but we simply no longer could due to
general code bloat and FreeBSD's many new device drivers in GENERIC.
One positive side-effect of this new organizational scheme, however,
is that it also allows one to easily make one's own kern or MFS
floppies should a need to customize some aspect of the installation
process or use a custom kernel for an otherwise unsupported piece of
hardware arise. As long as the kernel is compiled with
``options MFS'' and ``options MFS_ROOT'', it will properly look for
and boot an mfsroot.flp image in memory when run (see how the
/boot/loader.rc file in kern.flp does its thing). The mfsroot.flp
image is also just a gzip'd filesystem image which is used as root,
something which can be made rather easily using vnconfig(8).
If none of that makes any sense to you then don't worry about it -
just use the kern.flp and mfsroot.flp images as described above.
FDIMAGE - Write disk image to floppy disk
Version 1.5 Copyright (c) 1996-7 Robert Nordier
Usage: fdimage [-dqsv] [-f size] [-r count] file drive
-d Debug mode
-f size Specify the floppy disk format by capacity, eg:
160K, 180K, 320K, 360K, 720K, 1.2M, 1.44M, 2.88M
-q Quick mode: don't format the disk
-r count Retry count for format/write operations
-s Single-sector I/O
-v Verbose
~terry
Sun, Dec 23, 2001 (13:13)
#2
quick and dirty way that works on the FreeBSD boxes i have access to :
ascending : ls -alt | sort +4
descending: ls -alt | sort +4 -r
~terry
Tue, Sep 10, 2002 (21:42)
#3
*** Install FreeBSD on Promise FastTrak ***
1. Dump the image file "kern.flp" to a floppy disk. Mark this disk as "A".
e.g. dd if=kern.flp of=/dev/rfd0
2. Dump the image file "mfsroot.flp" to a floppy disk. Mark this disk as "B".
e.g. dd if=mfsroot.flp of=/dev/rfd0
3. Insert disk "A" in to floppy drive, insert FreeBSD CD into CDROM drive.
Boot machine. Please make sure that floppy disk boot first.
4. When system prompt "Please insert MFS root floppy and press Enter", insert
disk "B" and press "Enter".
5. When the machine beep and prompt "Boot [kernel] in X seconds...", press
any key (except "Enter").
6. Type "load ft.ko" to load the module.
Type "boot" to go on booting.
7. Start to install FreeBSD. The system may give a warning that the version
of FreeBSD CD does not match the version of floppy and ask if you want to
retry any way, doesn't matter, press "Enter" to go on installation.
8. When the installation finished, DO NOT reboot the machine. Press Alt-F4
switch to console mode.
9. Copy the file "ft.ko" from disk "B" to "/modules" (please mount first).
Change directory to the directory which "kp" resides (on floppy B) and
type "./kp" to patch the kernel files.
10. Unmount disk "B", insert disk "A", then mount it. Copy "kernel.gz" from
disk "A" to "/". Type "gunzip kernel.gz" to unzip the kernel. Unmount
disk "A".
11. Reboot system.
12. Recompile the FreeBSD kernel.
13. Reboot. DONE!
~terry
Fri, Sep 13, 2002 (12:33)
#4
Sounds great, but it didn't work!
~terry
Fri, Nov 1, 2002 (20:21)
#5
Adding a disk with FreeBSD:
12.3.2 Using Command Line Utilities
12.3.2.1 Using Slices
This setup will allow your disk to work correctly with other operating systems that might be installed on your computer and will not confuse other operating systems' fdisk utilities. It is recommended to use this method for new disk installs. Only use dedicated mode if you have a good reason to do so!
# dd if=/dev/zero of=/dev/rda1 bs=1k count=1
# fdisk -BI da1 #Initialize your new disk
# disklabel -B -w -r da1s1 auto #Label it.
# disklabel -e da1s1 # Edit the disklabel just created and add any partitions.
# mkdir -p /1
# newfs /dev/da1s1e # Repeat this for every partition you created.
# mount -t ufs /dev/da1s1e /1 # Mount the partition(s)
# vi /etc/fstab # Add the appropriate entry/entries to your /etc/fstab.
If you have an IDE disk, substitute ad for da. On pre-4.X systems use wd.
12.3.2.2 Dedicated
Adding A Disk to FreeBSD
This bit documents the process of adding a new disk to a FreeBSD system. Let's say, for example, that we have a server which has one system disk that contains some four partitions. However, the /usr directory is nearly full, so we have decided offload /usr/home onto a new disk.
The current disk is on primary/master on the first IDE chain. It's device id is /dev/ad0. We are adding a drive to the slave possition of that same chain. It is /dev/ad1. Make sure you have the right device before you issue these commands. Don't want to be wrong!
fdisk -BI ad1
disklabel -w -B ad1s1 auto
disklabel -e ad1s1
newfs /dev/ad1s1c
Now we mount the new disk under a temp directory to copy the data over.
mount /dev/sd1s1c /mnt
cp -Rpv /usr/home /mnt
When it's done, check the data, make sure you got everything and that there were no errors. Then unmount the drive from it's temporary place (/mnt). And clear out /usr/home to get the space back on that device.
umount /mnt
rm -rf /usr/home/
mkdir /usr/home
Now simply edit /etc/fstab and put/in or edit the entry for /usr/home. Then 'mount /usr/home' and you are done.
~terry
Sun, Aug 24, 2003 (08:31)
#6
David Chaplin-Loebell (dloebell)
Your post inspired me to write out a list of my hard-won FreeBSD
knowledge. I'm no expert, but I've had FreeBSD servers for almost three
years now and I've learned a few things. Hopefully they're useful for
others:
FreeBSD (and the ports collection) use the /usr/local tree more
consistently than other Unixes I've dealt with. For example:
- Config files for locally-installed software live in subdirectories of
/usr/local/etc/ -- there's one subdirectory for each package.
- Similarly, startup files for locally-installed daemons live in
/usr/local/etc/rc.d -- note that many ports will install a ".sample" file
in this directory; only files ending in ".sh" are actually run at
startup.
- Docs for locally installed packages go in /usr/local/share/doc
The nice thing about all this is you rarely have to mess with /etc, and
that's good because /etc files are routinely replaced in system upgrades.
(There's a tool called mergemaster that helps deal with this, but it's a
pain to use, and it's better to simply minimize modifications of files in
/etc).
I know I mentioned cvsup and portupgrade earlier, but I'll reiterate:
every FreeBSD system needs these two tools. There's a good article on
portupgrade here:
http://www.onlamp.com/pub/a/bsd/2001/11/29/Big_Scary_Daemons.html
CVSUP is a bit harder to find a good explanation for. It's easy once you
build a proper config file, but figuring out what to put in that config
file the first time can be a bit confusing. I suggest:
*default host=cvsup2.FreeBSD.org
*default base=/usr
*default prefix=/usr
*default release=cvs
*default tag=RELENG_4_8
*default delete use-rel-suffix
src-all
ports-all tag=.
This says: get the latest sources in the 4.8-RELEASE tag, and the latest
ports. I prefer to track 4.x-RELEASE on my machines (I'll move to
5.x-RELEASE when the FreeBSD team declares it "production" ready.) Some
admins seem to prefer tracking FreeBSD 4-STABLE, but in my mind this
changes too often to use on production servers. If you prefer to track
-STABLE, simply replace RELENG_4_8 with RELENG_4.
Subscribe to the FreeBSD security alerts mailing list at
http://lists.freebsd.org/mailman/listinfo/freebsd-security-notifications
so you know when you need to upgrade your system.
If you read only one section of the FreeBSD manual, read about how to do
system upgrades. Basically, you cvsup your sources, do a make
buildworld,
make buildkernel, make installkernel, reboot, make installworld,
mergemaster. But of course there are details, and if you're running an
internet server you should know how to do this.
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html
FreeBSD has many useful options that can be controlled by editing
/etc/rc.conf. In particular, this file is used for enabling and
disabling
built-in subsystems like Sendmail, sshd, nfs, etc.
If you deal with perl, do yourself a favor and install the
/usr/ports/lang/perl5, then type use.perl port. This means that you will
use the version of perl installed from ports, not the version that is
part
of the FreeBSD system. The version installed with the system is
5.005_03,
very outdated, and not easy to upgrade. Do this BEFORE you install any
Perl modules from CPAN.
When possible, install everything from ports. Don't install things by
any
other method unless the port doesn't work or is unavailable. (In
particular, installing perl modules using the CPAN module seems to get me
in trouble whenever I do it. I almost always discover that the module I
needed was available in the FreeBSD ports collection after all).
On a server, I generally want only the command-line version of a tool,
not the X11 version. For example, if you go into the emacs port
directory
and type "make install", it will, by default, build X11 before it builds
emacs, and build an emacs binary with lots of X11 stuff in it that you
don't need. In most ports, you can disable this behavior by typing
make install WITHOUT_X11=1