CCP14
Methods, Problems and Solutions
BSD UNIX Information for Crystallography
Installing FreeBSD 3.3 min (high security server minimum install) and Win95 Dual Boot System via Network/FTP
The CCP14 Homepage is at http://www.ccp14.ac.uk
Note: As of December 2000, FreeBSD 4.2 has been released. There has been no time to update
the tutorials but it is not that different to what is described here. Just translate
over the numbering system. It is recommended you use the latest FreeBSD distribution.
Disclaimer
Note: Because of variations in install, multiple toolsets, (never knowing whether
a previous install might have affected the next one); some/all(?) of the following information
might be wrong; and there are probably better methods for doing the following. Keep this in
mind and feel free to think a bit before blindly following the instructions.
The following install leaves the system with no open scannable ports for maximum security.
It is assumed that users will enable the servers they require at a later date.
(If you do install Xwindows at a later date, use of port 6000 by X can be disabled by adding
the flag '-nolisten tcp' to the X server command line.)
Why bother with FreeBSD
As explained in other pages, FreeBSD makes for a very solid, secure high capacity server and can
also be used with relative ease as a firewall computer. It of course can be used as a client
system but Linux has the advantage here due to ready to use Binaries for Crystallographic applications
being available.
Also refer: "Installing FreeBSD" at http://www.freebsd.org/handbook/install.html |
http://www2.uk.freebsd.org/handbook/install.html
Also refer: "Kernel configuration" at http://www.freebsd.org/handbook/kernelconfig.html
Backup your old stuff
The following method does the dual boot installation of FreeBSD and Win95 from scratch using
an unpartitioned disk. It is possible to install FreeBSD on an existing Windows system
without destroying the Windows area using FIPS or other similar non-destructive reformatting
software (e.g., Partition Magic). However implementing that is possibly part of a "future" X
hour hacking session; so we are doing "clean the disk - then install" method here.
"FIPS is a program for non-destructive splitting of harddisk partitions" -
FIPs Webpage at: http://www.igd.fhg.de/~aschaefe/fips/
If new to UNIX/BSD/LINUX, Expect to Initially Waste a Lot of Time
Like Austen Powers(?), "It's UNIX Baby Yeahhhh!"
Also refer Unix-haters handbook -
http://catalog.com/hopkins/unix-haters/handbook.html
Noting down the PC System Information
Note down all the information on your system including chip-sets, monitor refresh rates, etc.
If BSD makes a wrong choice, or prompts for a decision, you have to give it the
correct information. If you have Win95/Win98 or WinNT installed, you can
gain this information quite easily from the control panel (assuming the PC is
setup with the correct drivers). This also includes all the network information;
IP address, name, domain, gateway/router, NetMask, etc. Too much information
does not hurt, only too little. For network cards and the like, you may have to
go into Win95 or Win98 and get the memory addresses and the IRQs used. You tend to
find out what extra information you need the hard way.
In this case:
- Viglan 300 MHZ Intel Pentium with 128 Meg RAM
- 3COMFast Etherlink XL 10/100 Mb TX Ethernet NIC (3C 905B-TX) on IRQ 9
- ATI Xpert@Work Video Card (ATI 3D RAGE PRO - DirectX) (MACH64 Drivers based for XFree86 Xwindows)
- iiyama 17" MT-9017T video monitor that can do (Frequency: 50/60Hz):
- 1024x768 at 75Hz VESA; 60.02kHz HorizontalFrequency; 75.0kHz Vertical Frequency
- 1280x1024 at 75Hz VESA; 79.98kHz HorizontalFrequency; 75.0kHz Vertical Frequency
- Generic Floppy Disk
- In board SYMBIOS Logic 875XSID (NCR53c8xx) (Hardcopy Manual: SYM8751SP) PCI Ultra SCSI Host adapter (no devices connected)
- SCSI Fujitsu Hard Disk drive with ~8 Gig IDE Hard-disk
- Yamaha OPL3-Sax Sound System
- Atapi CD-ROM: TEAC CD-532E
Deciding now on the partitions
The following PC is configured to have 3 operating systems, Windows, Linux and FreeBSD.
In principle, if you set up a dual boot system, then a multiple boot system is a piece
of cake. The main limitation being that for PCs, each hard-disk can only have 4 primary
bootable partitions.
- 4 Gig for Win95
- 2 Gig for Linux
- 150 Meg for Linux Swap Area
- 2.4 Gig for FreeBSD (single BSD Slice)
- BSD partitioning (with the BSD Slice)
- BSD has a very nifty autoconfig to create the paritions within the Slice but it has a habit of
making some things a bit small (such as /var). While using
links between file systems can help with this, setting decent sized, best to size these partitions
in a decent way during installation. FreeBSD has a relatively friendly program for creating and sizing
partitions. Suggested sizes to fill a 2 Gig area:
- 40 meg for /
- ~200 meg for SWAP
- 100 meg for /tmp
- 100 meg for /var
- 1000 meg for /usr
- rest (~1GIG) for /home (user/data space)
Obtain the Ranish Partition Manager for DOS and create a Win95 Boot disk
After mucking around with a few utilities, the freeware Ranish Partition Manager for DOS
is a work of genius for managing partitions and boot managing.
Menu driven, it is a breeze to create and delete partitions,
multiple primary partitions, configure the MBR area. It easily will fit on a Windows/DOS
boot floppy with the rest of your boot utilities.
Now before you consider deleting Windows, create a boot disk (format a: /u/s) and copy
over the required utility software.
- Copy over the following to the floppy disk:
- Ranish Partition Manager
- format.com
- fdisk.exe
- edit.com
- sys.com
- xcopy.exe
- xcopy32.exe
- himem.sys
- scandisk.exe
- CD-ROM driver and MSCDEX.EXE
- Anything else you fancy and that will fit.
- Configure the config.sys and autoexec.bat on the floppy so that it
will enable the CD-ROM on bootup; plus himem.sys and any country
specific drivers. Set MSCDEX to use D: drive for the CD-ROM. (We will
be formatting the DOS partition of the hard-disk as C: drive.)
In the case of this Toshiba Laptop:
- Note: Having a loaded CD-ROM pointing to C: drive can possibly
stuff up the partitioning process later on; though Ranish Partition
Manager will probably warn you that something is going wrong.
If in doubt, remove the CD-ROM booting from the config.sys and autoexec.bat.
Creating the FreeBSD Boot Images on Floppy Disk
These are generally in the floppies directory of the media you intend
to install from. There are two images to be burn onto floppy disks: 1) kern.flp and
2) mfsroot.klp.
Choose the closest FreeBSD mirrors via:
Use fdimage.exe for DOS from the tools directory to write/burn the images onto floppy disks.
Standard "copy" command will not work. Just type fdimage filename.flp a: for the kern.flp and mfsroot.flp.
Buying or Creating the CD-ROM from Files off the Internet
You have a variety of options to install the FreeBSD. If you have good internet links, FTP
based install is very convenient otherwise buying/burning up a CD-ROM is a very convenient
and speedy install option and this is the method we will be going through here.
One very nice feature about the FreeBSD install is that it has a canned list of regional FTP
download sites. So there is no need to write down the FTP mirror you wish to use unless there
is a non-listed one you wish to download from.
Also, if you wish to use a user specified mirror by putting in the address, the trick is to
insert only up to "i386" in the address:
e.g., ftp://ftp2.uk.FreeBSD.org/pub/FreeBSD/releases/i386/ or
ftp://ftp.mirror.ac.uk/sites/ftp.freebsd.org/pub/FreeBSD/releases/i386/ or
ftp://freebsd.ccp14.ac.uk/pub/FreeBSD/releases/i386/
However, for multiple, routine installation, the CD-ROM is good use - but you still need the install/boot images
on floppy disk. Creating a CD-ROM is a good and not too difficult option if you
have a CDR/CD-Writer. The trick is working out what the root area has to be for the CD-ROM and this is
given below:
Creating a FreeBSD CD-ROM from downloaded files of FTP
- Directories under: ftp://ftp4.uk.FreeBSD.org/pub/FreeBSD/3.3-RELEASE/
- Thus will appear as root directories on the CD-ROM
- /XF86333
- /bin
- /catpages
- /compat1x
- /compat20
- /compat21
- /compat22
- /dict
- /doc
- /floppies
- /games
- /info
- /manpages
- /packages
- /ports
- /proflibs
- /tools
If you are doing a minimum install, all you require are the files in the /bin
directory. However, it can be healthy to have a more comprehensive FreeBSD CD-ROM
just in case. Do what is best in your circumstancse.
It is not possible to install all the "packages" area onto the CD-ROM due to lack of space.
In the FreeBSD install manager, you can change the source of the install for packages missing
from the CD.
Whatever you do, if you use the internet to initially download all the files for the
CD-ROM, choose the closest mirror.
Booting from Your DOS/Windows Floppy Boot Disk, Deleting Existing Partitions and Editing Master Boot Manager (MBR) Options
Boot from your DOS/Windows Floppy Boot Disk and run the menu driven Ranish Partition Manager.
- Delete the existing partitions.
- Highlight the MBR (Master Boot Record) and:
- Set the MBR Executable to "Boot Manager"
- Boot Interface type to "Compact"
- Check for Viruses "No" (otherwise you may not be allowed to save to the MBR)
- Boot prompt timeout = "6" is nice?
- Default Boot Choice of "Prompt User"
- Save (F2), then out of habit from using DOS, reboot to the floppy again. This may or
may not be optional.
Booting from Your DOS/Windows Floppy Boot Disk and Creating Partitions
Note: There are many possible permutations and combinations but the following
seems to work for me. Despite the literature, setting active partitions and
boot managers can be quite quirky due to limitations/nuances in PC hardware and the
various pieces of software.
Boot from your DOS/Windows Floppy Boot Disk and run the menu driven Ranish Partition Manager.
- (If you want a nice graphical boot manager, select Text 25x80
under the MBR config, then add a "small" "Boot Manager" Partition (4 Meg) as the first Primary partition
using the INS key (which gives a menu list of the possible file systems that can be added)) and
set this as the Bootable Partition . Then, taking into account the above, continue on with the following.
- In the first "Primary" Partition, create a 4 Gig Windows FAT-32 Partition (when promped, save
but DO NOT format as results may not be predictable. We use the Windows format.com program later.)
Set this as your default Boot area using the B key. (Don't be too worried at this point if Ranish is
unhappy about not letting it format the partition and says the DOS/Windows Boot Sector does not have valid information.
Once it is formatted using the format.com program, it should have valid information).
- In the second primary partition, you may wish to create a 2 Gig Linux Parition
- In the third primary partition, creating a Linux Swap Parition (150 Meg)
- (This leaves empty space ready for the FreeBSD slice/partition)
- Save (F2) and (again) reboot the computer to the floppy again (possibly optional though I find DOS/Windows
format.com is happier after the reboot).
Formatting the C: Drive - Windows FAT-32
Boot from your DOS/Windows Floppy Boot Disk and run the menu driven Ranish Partition Manager.
- From the floppy disk, type format c: /s and when prompted:
Y - you want to proceed. (/s puts the boot files on the hard-disk)
- Give it a volume name of DOS
- If you want to, you can now install Win95; but I would wait until after getting BSD
happily installed in case some partition nuances (didn't allocate enough space to an
important partition) come to haunt you.
- Take the floppy disk out of the disk drive (to check the boot manager is happy).
- Reboot the PC and you should be given a prompt of HD/1. If you have a Compact boot manager
menu, entering 1 should take you into a command line based Win95/DOS prompt. You
can install more elaborate boot manager menus described in this text (Text
25x80 menu system on startup) if you want to but I was in a "minimalist" mood on this particular occassion.
But now the Text 25x80 menu system is my favourite.
FreeBSD Minimum CD-ROM based Install
- Making sure the FreeBSD CD-ROM is inserted and you have all the relevant information
specified above, insert the FreeBSD boot/install (kern.flp) floppy disk and reboot.
- FreeBSD will hopefully start booting up, detect the keyboard, floppy drive and
hard-disk; then start loading the boostrap loader. It will then prompt for the
MFS Root floopy
- Insert the MFS root flppy and press enter. FreeBSD will crunch away then boot up
into the Kernel Configuration Menu.
- Enter "Start kernal configuration in full-screen visual mode". FreeBSD will
probably tell you via the Kernel configuration screen that you have lots of conflicts.
Do not worry at this point. Press the [ENTER] key on Storage to expand
it up.
The first thing you may notice is that it does not have a specific driver for the SCSI
device on this particular PC. In practise, you can delete all these drivers and
FreeBSD will detect the card.
You will also notice that the CD-ROM driver for this particular type of CD-ROM is not
present. Just delete them all and it will detect the one that is present.
(How did I know this? - Trial and Error Installations!)
Press the [DEL] key to delete the SCSI
drivers and CDROM drivers. You will note Only keep the "Floppy disk controller"
and the IDE/ESDI/MFM disk controller drivers.
Now go down to the Network drivers area, and press [ENTER] to expand.
You do not see the 3COM driver in this list and may feel the desire to panic.
This is not necessary at this point. Delete all the CARDS using the [DEL]
key as FreeBSD will automatically detect this type of 3COM card.
(Again how did I know this? - Lots of Trial and Error Installations! - it presently
only takes me around ~10 minutes to do a minimum install of BSD from CD-ROM on this
particular PC)
- Now Q to quit and confirm to save. It may take a while to detect what devices are
on the hard-disk controllers. Be patient, all is well! At this point, ignore any errors that go
drifting by the screen and do not cause a kernal panic (i.e., can't map network card
ports). (In the spirit of "Toy Story", by installing FreeBSD, you have been
"chosen" to go through the cosmic portal on your journey to
Nivarna. Yes I do know that particular "Toy" got eaten by a dog in the movie and it is not
unlikely that by using UNIX, analogous things could occur.)
- You should now be at a colourfull (4 colour) /stand/sysinstall Main Menu. Do not be
intimidated at this point. FreeBSD has an excellent (though finicky (in a friendly
sort of way) in some places) install manager that can also be called after installation
of the operation system if you want to add or fix things up.
- Select NOVICE "Begin a Novice Installation (for beginners). This option asks the
questions that needs to be asked. FreeBSD install will give a message that you are about to
enter FDISK. Do not be worried at this point and continue.
- The FreeBSD fdisk program is one of the more friendlier varieties. If you wish to delete
a partition, just highlight it and press the [DEL] key. Assuming you are a free
area for the FreeBSD FDISK partition, highlight this unused partition and type C
to create a FreeBSD Slice (FDISK partition) with this is area. If FreeBSD cannot use the entire
area, it could be a BIOS limitation in action. You have the option of specifying the
number of Megabytes for this area or can go with the default - which is the entire unused area.
When prompted, confirm that you wish to have a type 165 FreeBSD partition. Then select
Q to quit the creation Slice/Partition area.
(you can use the A command to have FreeBSD use the entire disk if you wish to have
FreeBSD as the exclusive operating system on this disk).
You will next be prompted where you wish to put a boot manager. As we are using Ranish Partition
manager, select NONE (by down-arrow to NONE, then press [SPACE-BAR] (selecting the NONE option)
then [ENTER] to continue on.
- Now FreeBSD gives you a message that it will now want to Create FreeBSD partitions inside the
FreeBSD-FDISK paritition you just created. Press [ENTER] to continue on to the "FreeBSD Disklabel Editor".
- FreeBSD has a mega wonderful feature that will do "Auto Defaults for All". However, later on you may
find these defaults were not that crash hot for you. The following is based on doing crystallographic
and web-serving work using FreeBSD but you may have to custom size the Partitions for your particular
applications - and you may only find out the best partition spaces to use the hard way.
- When it the FreeBSD Disklabel Editor, select A to do an Auto Partition. On this 2 Gig partition
is tends to give the following:
- 40 meg for /
- 261 meg for SWAP
- 20 meg for /var
- 2526 meg for /usr
- Generally, to be able to compile up things like Platon (not really applicable for a minimal
install server); have space for applications and data, the following was found to be good.
- 40 meg for /
- ~200 meg for SWAP
- 100 meg for /var
- 100 meg for /tmp
- 1000 meg for /usr
- 1000 meg for /home
- To make this a happening thing, highlight the /var and D delete this. Then
highlight the /usr partition and D delete this. Do not panic at this point!
As mentioned above, the FreeBSD FDISK and Label Editor is quite civilised and easy to use.
- Creating a new 100 Meg /var partition:
- To add new partitions, you have to highlight the top Disk Definition line then use the
C Create command and create (in this case) a 100Meg /var partition. (The M at the end of the
number means Meg). Thus when prompted, type 100M and press [ENTER]. When prompted for the partition
type, select FS "A file system" and OK. Then when prompted for a mount point,
type /var and [OK]. Done!
- Creating a new 100 Meg /tmp partition:
- To add new partitions, you have to highlight the top Disk Definition line then use the
C Create command and create (in this case) a 100Meg /tmp partition. (The M at the end of the
number means Meg). Thus when prompted, type 100M and press [ENTER]. When prompted for the partition
type, select FS "A file system" and OK. Then when prompted for a mount point,
type /tmp and [OK]. Done!
- Creating a new ~1000 Meg /home partition (user and web data):
- To add new partitions, you have to highlight the top Disk Definition line then use the
C Create command and create (in this case) an ~1000Meg /home partition. (The M at the end of the
number means Meg). Thus when prompted, type the remaining space (in this case)
1446M and press [ENTER]. When prompted for the partition
type, select FS "A file system" and OK. Then when prompted for a mount point,
type /home and [OK]. Done!
- Select Q to finish on the partitioning.
- This should then lead to the Choose Distributions screen where "canned"
distribution sets can be selected. In this case, we will do a Minimal
(the smallest configuration possible) install that can serve as a
base for a Web, Internet and File Server. Thus go to the Minimal
using the arrow keys, press [SPACE KEY] to select then [ENTER] to proceed.
- This should lead to Choose Installation Media. In this case, we are
going to do a CD-ROM install. Highlight CDROM and press [ENTER] to
continue.
- User Confirmation Requested. FreeBSD will give a warning before uploading
the files onto your PC. Assuming you have made backups of anything important on the
computer, confirm and proceed. FreeBSD will then start formatting the FreeBSD partitions on the
hard-disk (this may take a while - minutes not seconds); then start a HOLOGRPAHIC shell
and start download the FreeBSD operating system files off the CD-ROM which should take a
minute or so. When finished it will then say it is remaking devices
and a few other things, followed by a Congratulations messages. Press
OK to continue.
- When prompted if you want to enable Linux binary compatibility, we will do NO in
this case purely as this is a minimum install athough this type of thing is up to you. For
a server situation you would normally want to have optimised FreeBSD executables.
- FreeBSD will now ask you various questions and you should answer appropriately depending on
what you intend to do with the server.
- When prompted whether we should be installing any Ethernet or SLIP/PPP network devices
select YES
- On the list of devices, the 3COM ethernet card should be visible. Highlight this
and select it. (If it is not visible, then the card has either not been detector and/or
some kernel configurations may be required for it to be correctly recognised)
- When prompted whether you want to try using DHCP configuration of the interface, in this case
(static IP addresses) select NO
- Now when prompted for the network configuration, insert the network information.
Use the [ENTER] button to accept the inputted information. If the network does not work, either
the network(cable) is not working or you have put in the incorrect information and should double
check everything.
- When prompted whether you wish to bring up the ethernet interface now, select Yes.
- For default internet services, we are going to close off all Internet
services so we can set them up as we need them later.
- When prompted if the computer will be an IP Gateway (firewall), select NO
- When prompted if want an Anonymous FTP server on this PC, select NO
- When prompted if want the PC configued as an NFS server, select NO
- When prompted if want the PC configued as an NFS client (NFS Sucks - try Samba
instead if you require LAN based file sharing), select NO
- When prompted whether you want to customise your console settings, select YES
- Now that you are in the System Console Configuration, you use the [SPACE KEY]
to go into an menu option and [ENTER] to continue out of this option. This can be
confusing if you are not used to this behaviour. for the UK, go into Font and select
an English Font (again [SPACE KEY] to select the option, [ENTER] to accept the
selections and get out). In Keymap, select U.K. CP850. In Save, I quite like
the Deamon ASCII screen saver. Then [ENTER] to accept this and continue.
- You may as well set the time zone so select YES and set the timezone
(Europe, UK).
- If you have a mouse, you can configure the driver at this point if you wish though
it may be superfluous for this Minimal install.
- FreeBSD will now prompt you if you want to install a Packages collection.
In a non-Minimal install, you probably would, and this gives a nice interface for
installing a range of programs including web-browsers, etc. But in this case
select NO.
- It is a good idea to add a non-root user account. If you wish this user to
be compatible with accounts on other network systems, make sure you match
the UID and GIDs. (you may have to add this group in first)
- YOU should now be prompted to insert the "Root" adminstrator's password.
Use a secure non-dictionary word with numbers in it. At least 8 characters.
- You are now prompted to go to the general configuration to see if there is anything
else you would like to install. You can do this if you want as it can be useful
to see what is available. (this program can be run at any time (/stand/sysinstall)
when you are working on the system - so don't be afraid if you exit this - you can easily get back in
to do more configuration).
For instance, you can use 4 Media - Change the installation media type to select a new
Media if you are lacking files (FTP or CD-ROM being the most obvious)
Once happy browsing around, go to the bottom menu EXIT
option and press OK. You should now be back in the main /stand/sysinstall menu. Highlight
Exit Install and press [ENTER] to accept this to reboot the system. FreeBSD is now
installed. FreeBSD will prompt you to remove any floppy disks (such as the install disk).
- The PC will now reboot. In the boot manager, select FreeBSD as there is some minor
configuration that could be worth doing to get rid of un-used services and by default
not having any scannable ports on this machine.
- The standard BSD literature suggests you do not do the following in the following way. There is
probably a good reason for the above advice, one is given, but the following seems to get the job
done effectively.
- Log in as root and go into the /etc/defaults directory.
- Edit the /etc/defaults/rc.conf directory (vi is the default editor available with UNIX. (If you
do not like this editor, install a decent easy to use editor like pico or joe which
is available via the FreeBSD distribution). In theory, you should be doing all of this in the /etc/rc.conf
file but it can be quicker to do it in the /etc/defaults/rc.conf file. Make the following changes to the
/etc/defaults/rc.conf file:
- Set "inetd_enable" to NO. (this will stop all the inetd based services that are normally
enabled in /etc/inetd.conf)
- Set "rpc_statd_enable" to NO
- Set "portmap_enable" to NO
- Set "sendmail_enable" to NO
- Set "check_quotas" to NO
- There is no doubt a command to reinitiase all of the above but the wimps/DOS Centric way is to do a reboot.
So to enable these changes, type reboot to restart FreeBSD. On reboot, it is recommended to do a scan
from another computer with a program such as nmap. Nmap should find no open ports.
Prior to doing this config, a scan would show
Port State Protocol Service
21 open tcp ftp
23 open tcp telnet
25 open tcp smtp
79 open tcp finger
111 open tcp sunrpc
513 open tcp login
514 open tcp shell
- Edit the /etc/aliases file and put your E-mail address as the alias for root. FreeBSD does
a regular routine security check on itself and this will get you the results rather than it hanging
around in the local root mail box.
- To be able to log in remotely and do secure copying to the FreeBSD machine, install SecureShell.
- "Aloha dude! You have successfully installed FreeBSD"
Things to do Now that Basic FreeBSD has been Installed
- If you did not disable INETD and the PORTMAPPER:
- Disable unnecessary deamons in the portmapper, inetd.conf
(pretty much everything you don't need; ftpd, telnetd, fingerd, etc)
This means edit the /etc/inetd.conf file and remove everything you don't like the
look of. If you have installed SecureShell, you can pretty much REM out everything.
Then type killall -HUP inetd to restart inetd deamon.
Mounting DOS File Systems
Date: Tue, 05 Oct 1999 10:32:08 +0100
From: Richard Smith [[email protected]]
Reply-To: [email protected]
Ben Cuthbert wrote:
>
> Does anyone know
> what is the command that lets you connect
> to the MS-dos partition of you HDD from FreeBSD
>
> ------ FreeBSD UK User's Group - Mailing List ------
> http://listserver.uk.freebsd.org/mailman/listinfo/freebsd-users
Any of the following:
1) mount -t msdos /dev/... /mntpt
2) mount_msdos /dev/... /mntpt
3) place an msdos filesystem record into /etc/fstab and get it
automounted at boot time.
4) as 3) but manually mount using: mount /mntpt
Richard.
|