≪
≫

Quick installation

Making things easy foryourself FreeBSD on a disk with free space; FreeBSD shared with Microsoft; Configuring XFree86.

In Chapters 4 to 6 we'ft go into a lot of detail about how to install the system. Maybe this is too much detafl for you. If you're an experienced UNIX user, you should be able to get by with significandy less reading. This chapter presents checklists for some of the more usual kinds of installation. Each refers you to the corresponding detailed descriptions in Chapters 4 through 6.

On the following pages we'll look at the simplest installation, where FreeBSD is the only system on the disk. Starting on page 49 we'll look at sharing the disk with Microsoft, and on page 50 we'll look at how to install XFree86. You may find it convenient to photo copy these pages and to mark them up as you go along.

Making things easy for yourself

It is probably easier to install FreeBSD than any other PC operating system, including Microsoft products. Well, most of the time, anyway. Some people spend days trying to install FreeBSD, and finally give up. That happens with Microsoft's products as well, but unfortunately it happens more often with FreeBSD.

Now you're probably saying, "That doesn't make sense. First you say it's easier to install, then you say it's more likely to fail What's the real story?"

As you might expect, the real story is quite involved. In Chapter 2, Before you install, I went into some of the background. Before you start, let's look at what you can do to make the installation as easy as possible:

  • • Use known, established hardware. New hardware products frequently have undocumented problems. You can be sure that they work under Microsoft, because the manufacturer has tested them in that environment. In al] probability, he hasn’t tested them under any flavour of UNIX, let alone FreeBSD. Usually the problems aren't serious, and the FreeBSD team solves them pretty quickly, but if you get the hardware before the software is ready, you’re the guinea pig.
  • • At the other end of the scale, you can have more trouble with old hardware as well It's not as easy to configure, and old hardware is not as well supported as more recent hardware.
  • • Perform a standard installation. The easiest way to install FreeBSD is by booting from a CD-ROM and installing on an empty hard disk from the CD-ROM. If you proceed as discussed in Chapter 5, Installing FreeBSD, you shouldn't have any difficulty.
  • • If you need to share your hard disk with another operating system, it's easier to install both systems from scratch. If you do already have a Microsoft system on the disk, you can use FIPS (see page 52) to make space for it, but this requires more care.
  • • If you run into trouble, RTFM. I've gone to a lot of trouble to anticipate the problems you might encounter, and there's a good chance that you will find something here to help.
  • • If you do all this, and it still doesn't work, see page 17 for ways of getting external help.

FreeBSD on a disk with free space

This procedure applies if you can install FreeBSD without first having to make space on disk. Perform the following steps:

• Boot from CD-ROM. Most systems support booting from CD-ROM, but if yours doesn't:

î Create two boot floppies by copying the images /cdrom/fbppies/kem.ftp and /cdrom/fbppies/mfsroot.ftp to 3,5" diskettes. Refer to page 89 for more details.

î Insert the CD-ROM in the drive before booting.

° Boot from the kem.flp floppy. After loading, insert the mfcrootflp floppy when the system prompts you to do so, then press Enter.

If you have a larger floppy, such as 2.88 MB or LS-120, you can copythe image /cdrom/floppies/bootfp to it and boot from it. In this case you don't need to change disks.

  • • Select the Custom installation. Refer to page 60.
  • • What you do in the partition editor depends on whether you want to share the drive with another operating system or not:

î If you want to use the drive only for FreeBSD, delete any existing slices, and allocate a single FreeBSD slice that takes up the entire disk. On exiting from the partition editor, select the Standard MBR. Refer to page 66.

G. Lehey FreeBSD Operating System

° If you want to share the disk with other systems, delete any unwanted slices and use them for FreeBSD. On exiting from the partition editor, select the BootMgr MBR. Refer to page 66.

  • • In the disk label editor, delete any existing UNIX partitions. Create the file systems manually. If you don't have any favourite layout, create a root file system with 4 GB, a swap partition with at least 512 MB (make sure it's atleast 1 MB larger than the maximum memory you intend to install in your system). Allocate a /home file system as large as you like, as long as it can fit on a single tape when backed up. If you have any additional space, leave it empty unless you know what to use it for. See page 68 for the rationale of this approach, which is not what sysinstall recommends.
  • • Install the complete system, including X and the Ports Collection. This requires about 1 GB of disk space. Refer to page 75 if you want to limit it.
  • • Select CD-ROM as installation medium. Refer to page 76.
  • • Give final confirmation. The system will be installed. Refer to page 77.
  • • After installation, set up at least a user ID for yourself. Refer to page 144.

FreeBSD shared with Microsoft

If you have a disk with Microsoft installed on only part of the disk, and you don't want to change the partition layout, you can proceed as in the instructions above. This is pretty unusual, though: normally Microsoft takes the whole disk, and it's difficult to persuade it otherwise. To install FreeBSD on a disk that currently contains a single Microsoft partition taking up the entire disk, go through the following steps:

  • • Make a backup! There's every possibility of erasing your data, and there's absolutely no reason why you should take the risk.
  • • If you have an old machine with an IDE disk larger than 504 MB, you may run into problems. Refer to page 32 for further details.
  • • Boot Microsoft and repartition your disk with FIPS. Refer to page 52.
  • • Insert the CD-ROM in the drive before booting.
  • • Shut the machine down and reboot from the FreeBSD CD-ROM. If you have to boot from floppy, see page 48 for details.
  • • Select the Custom installation.
  • • In the partition editor, delete only the second primary Microsoft partition. The first primary Microsoft partition contains your Microsoft data, and if there is an extended Microsoft partition, it will also contain your Microsoft data.
  • • Create a FreeBSD slice in the space that has been freed. Refer to page 63.
  • • On exiting from the partition editor, select the BootMgr MBR. Refer to page 66.
  • • In the disk label editor, delete any existing UNIX partitions. Create the file systems manually. If you don't have any favourite layout, create a root file system with 4 GB, a swap partition with at least 512 MB (make sure it's at least 1 MB larger than the maximum memory you intend to install in your system). Allocate a /home file system as large as you like, as long as it can fit on a single tape when backed up. If you have any additional space, leave it empty unless you know what to use it for. See page 68 for the rationale oi this approach, which is not what sysinstall recommends.
  • • Before leaving the disk label editor, also select mount points for your DOS partitions if you intend to mount them under FreeBSD. Refer to page 74.
  • • Install the complete system, including X and the Ports Collection. This requires about 1 GB of disk space. Refer to page 75 if you want to limit it.
  • • Select CD-ROM as installation medium Refer to page 76.
  • • Give final confirmation. The system will be installed. Refer to page 77.
  • • After installation, set up at least a user ID for yourself. Refer to page 144.

Configuring XFree86

  • • You can configure XFree86 during installation or after reboot.
  • • Make sure your mouse is connected to the system at boot time. Depending on the hardware, if you connect it later, it may not be recognized.
  • • If you have already rebooted the machine, log in as root and restart sysinstall
  • • Select the sys install Configuration menu, XFree86 and then xf86cfg, and follow the instructions. See page 102 for further details.
  • • Select the Desktop menu and install the window manager of your choice. See page 108 for further discussion.

Separate disks; Sharing adisk; Sharing with Linux or another BSD; Repartitioning with FIPS.

In many cases, you won't want to install FreeBSD on the system by itself: you may need to use other operating systems as well In this chapter, we’ll look at what you need to do to prepare for such an installation. If you're only running FreeBSD on the machine, you don't need to read this chapter, and you can move onto Chapter 5, Installing FreeBSD.

Before you start the installation, read this chapter carefully. It's easy to make a mistake, and one of the most frequent results of mistakes is the total loss of all data on the hard disk.

Currently, only the ia32 (Intel) port of FreeBSD is capable of sharing with other operating systems. We'll concentrate on how to share your system with Microsoft, because that's both the most difficult and the most common, but most of this chapter applies to other operating systems as well You may want to refer to the discussion of Microsoft and FreeBSD disk layouts on page 34.

Separate disks

The first question is: do you need to share a disk between FreeBSD and the other operating system? It's much easier if you don't have to. In this section, we'll look at what you need to do.

Many operating systems will only boot from the first disk identified by the BIOS, usually called the C: disk in deference to Microsoft. FreeBSD doesn't have this problem, so the easiest thing is to install FreeBSD on the entire second disk. BIOS restrictions usually make it difficult to boot from any but the first two disks.

In this case, you don't really need to do anything special, although it's always a good idea to back up your data first. Install FreeBSD on the second disk, and choose the Boot Manager option in the partition editor (page 64). This will then give you the choice of booting from the first or second disk. Note that you should not change the order of disks after such an installation; if you do, the system will not be able to find its file systems after boot.

If you intend to share a disk between FreeBSD and another operating system, the first question is: is there enough space on the disk for FreeBSD? How much you need depends on what you want to do with FreeBSD, of course, but for the sake of example we'll take 120 MB as an absolute minimum. In the following section, we'll consider what to do if you need to change your partitions. If you already have enough space for a FreeBSD partition (for example, if you have just installed Microsoft specifically for sharing with FreeBSD, and thus have not filled up the disk), continue reading on page 66.

Sharing with Linux or another BSD

Sharing with other free operating systems is relatively simple. You still need to have space for FreeBSD, of course, and unlike Microsoft, there are no tools for shrinking Linux or BSD file systems: you'll have to remove them or recreate them. You can find some information about sharing with Linux in the mini-Howto at ññûëêà: http y/wwwlinux.org/docs/ldp/howto/inini/Linux+F reeBS D.htmL

NetBSD and Open BSD file systems and slices are very similar to their FreeBSD counterparts. They're not identical, however, and you may find that one of the systems recognizes the partition of another system and complains about it because it's not quite right. For example, NetBSD has a d partition that can go outside the boundary of the slice. FreeBSD does not allow this, so you get a harmless error message.

Repartitioning with FIPS

Typically, if you've been running Microsoft on your machine, it will occupy the entire disk. If you need all this space, of course, there's no way to install another operating system as well Frequently, though, you'll find that you have enough free space in the partition. Unfortunately, that’s not where you want it: you want the space in a new partition. There are a number of ways to do so:

  • • You can reinstall the software. This approach is common in the Microsoft world, but FreeBSD users try to avoid it.
  • • You can use FIPS to shrink a Microsoft partition, leaving space for

G. Lehey FreeBSD Operating System

FreeBSD. FIPS is a public domain utility, and it is included on the FreeBSD CD-ROM.

• If you can't use FIPS, use a commercial utility like PartitionMagic.This is not included on the CD-ROMs, and we won't discuss it further.

In the rest of the section, we'll look at how to shrink a partition with FIPS. If you do it with PartitionMagic, the details are different, but the principles are the same. In particular:

Before repartitioning your disk, make a backup. You can shoot yourself in the foot with this method, and the result will almost invariably be loss of data.

If you've been running Microsoft on your system for any length of time, the data in the partition wffl be spread all around the partition. If you just truncate the partition, you'll lose a lot of data, so you first need to move all the data to the beginning of the partition. Do this with the Microsoft defragmentation utility. Before proceeding, consider a few gotchas:

  • • The new Microsoft partition needs to be big enough to hold not only the current data, but also anything you will want to put in it in the future. If you make it exactly the current size of the data, it will effectively be full, and you won't beable to write anything to it.
  • • The second partition is also a Microsoft partition. To install FreeBSD on it, you need to convert it into a FreeBSD partition.
  • • FIPS may result in configuration problems with your Microsoft machine. Since it adds a partition, any automatically assigned partitions that followwill have a different drive letter. In particular, this could mean that your CD-ROM drive wffl "move." After you delete the second Microsoft partition and change it into a FreeBSD partition, it wffl "move" back again.

For further information, read the FIPS documentation in /cdrom/tools/fips.doc. In particular, note these limitations:

  • • FIPS works only with Hard Disk BIOSes that use interrupt 0x13 for low-level hard disk access. This is generally not a problem
  • • FIPS does not split partitions with 12 bit FATs, which were used by older versions of Microsoft. These are less than 10 MB in size and thus too small to be worth splitting.
  • • FIPS splits only Microsoft partitions. The partition table and boot sector

G. Lehey FreeBSD Operating System

must conform to the MS-DOS 3.0+ or Windows 95 conventions. This is marked by the system indicator byte in the partition table, which must have the value 4 (16 bit sector number) or 6 (32 bit sector number). In particular, it will not split Linux or Windows 2000 and later partitions.

  • • FIPS does not yet work on extended Microsoft partitions.
  • • FIPS needs a free partition entry. It will not work if you already have four partitions.
  • • FIPS will not reduce the original partition to a size of less than 4085 clusters, because this would involve rewriting the 16 bit FAT to a 12 bit FAT.

Repartitioning—an example

In this section, we'll go through the mechanics of repartitioning a disk. We'll start with a disk containing a single, complete Microsoft system.

First, run the Microsoft error check utility on the partition you want to split. Make sure no "dead" clusters remain on the disk.

Next, prepare a bootable floppy. When you start FIPS, you will be given the opportunity to write backup copies of your root and boot sector to a file on drive A:. These will be called ROOTBOOT.OOx, where x represents a digit from 0 to 9. If anything goes wrong while using FIPS, you can restore the original configuration by booting from the floppy and running RESTORRB.

If you use FIPS more than once (this is normally not necessary, but it might happen), your floppy will contain more than one ROOTBOOT file. RESTORRB lets you choose which configuration file to restore. The file RESTORRB.OOO contains your original configuration. Try not to confuse the versions.

Before starting FIPS you must defragment your disk to ensure that the space to be used for the new partition is free. If you're using programs like IMAGE or MIRROR, note that they store a hidden system file with a pointer to your mirror files in the last sector of the hard disk. You must delete this file before using FIPS. It will be recreated the next time you run MIRROR. To delete it, in the root directory enter:

C:> attrib -r -s -h image.idx for IMAGE

C:> attrib -r -s -h mirorsav.fil for MIRROR

G. Lehey

Then delete the file.

If FIPS does not offer as much disk space for creation of the new partition as you expect, this may mean that:

  • • You still have too much data in the remaining partition. Consider making the new partition smaller or deleting some of the data. If you delete data, you must defragment and run FIPS again.
  • • There are hidden files in the space of the new partition that have not been moved by the defragmentation program Make sure which program they belong to. If a file is a swap file of some program (for example NDOS) it is possible that it can be safely deleted (and will be recreated automatically later when the need arises). See your manual for details.
  • • If the file belongs to some sort of copy protection, you must uninstall the program to which it belongs and reinstall it after repartitioning.

If you are running early versions of MS-DOS (before 5.0), or another operating system, such as OS/2, or you are using programs like Stacker, SuperStor, or Doublespace, read the FIPS documentation for other possible problems.

Running FIPS

After defragmenting your Microsoft partition, you can run FIPS:

C:> D: changetoCD-ROM

D:> cd ools Make sure you're in the tools directory

D: ools> fips and start the FIPS program

... a lot of copyright information omitted

Press any key do what the computer says

Which Drive (1=0x80/2=0x81)?

The message Which Drive may seem confusing. It refers to BIOS internal numbering. Don't worry about it: if you want to partition the first physical drive inthe system, (C:), enter 1, otherwise enter 2. Like the BIOS, FIPS handles only two hard disks.

If you start FIPS under Windows, it will complain and tell you to boot from a floppy disk. It won't stop you from continuing, but it is a Bad Idea to do so.

G. Lehey FreeBSD Operating System

Next, FIPS reads the root sector of the hard disk and displays the partition table:

Òàáëèöà.

Start

End

Part.

bootable

Head

Cyl

Sector

System Head

Cyl

Sector

Start Sector

Number of Sectors

1

yes

1

0

1

Och

239

2047

63

63

40083057

19

2

no

0

0

0

OOh

0

0

0

0

0

0

3

no

0

0

0

OOh

0

0

0

0

0

0

4

no

0

0

0

OOh

0

0

0

0

0

0

This shows that only the first partition is occupied, that it is bootable, and that it occupies the whole disk (19571 MB, from Cylinder 0, Head 1, Sector 1 to Cylinder 2047, Head 238, Sector 63). It also claims that this makes 40083057 sectors. It doesn't: the cylinder number has been truncated, and FIPS complains about a partition table inconsistency, which it fixes. After this, we have:

Òàáëèöà.

Start

End

Part.

bootable

Head

Cyl Sector

System Head

Cyl

Sector

Start Sector

Number of Sectors

1

yes

1

0

1

Och

239

2650

63

63

40083057

19

2

no

0

0

0

OOh

0

0

0

0

0

0

3

no

0

0

0

OOh

0

0

0

0

0

0

4

no

0

0

0

OOh

0

0

0

0

0

0

Don't worry about the ’bootable" flag here—we'll deal with that in the FreeBSD installation. First, FIPS does some error checking and then reads and displays the boot sector of the partition:

Checking boot sector... OK

Press any Key do what it says

Bytes per sector: 512

Sectors per cluster: 32

Reserved sectors: 32

Number of FATs: 2

G. Lehey FreeBSD Operating System

Number of rootdirectoiy entries: 0

Number of sectors (short): 0

Media descriptor byte: fBh

Sectors per FAT: 9784

Sectors per track: 63

Drive heads: 240

Hidden sectors: 63

Number of sectors (long): 40083057

Physical drive number: 80h

Signature: 29h

After further checking, FIPS asks you if you want to make a backup floppy. Enter your formatted floppy in drive A: and makethe backup. Next, you see:

Enter start cylinder for new partition (35 - 2650):

Use the cursor keys to choose the cylinder, to continue

Old partition Cylinder New Partition

258.4 MB 35 19313.4 MB

Use the Cursor Left and Cursor Right keys to adjust the cylinder number at which the new partition starts. You can also use the keys Cursor Up and Cursor Down to change in steps of ten cylinders. FIPS updates the bottom line of the display to show the new values selected. Initially, FIPS chooses the smallest possible Microsoft partition, so initially you can only increase the size of the old partition (with the Cursor Right key). When you're happy with the sizes, press Enter to move on to the next step.

Be very sure you're happy before you continue. If you make the first partition too small, there is no way to make it larger again. On the other hand, if you make it too large, you can split it again and then use fdisk or MS-DOS FDISK to remove the superfluous partitions.

In this example, we choose equal-sized partitions:

G. Lehey

FreeBSD Operating System

Old partition

Cylinder

New Partition

251.5 MB

511

251.5 MB

  • (pressed Enter?
  • 1 .. 1

Start

1 1 .

I Start (Number of|

Part.

|bootable

(Head Cy]

.. Sector 1

(System

(Head Cyl.

Sector

| Sector

(Sectors

MB

1

yes

0

0

1

06h

15

511

63

0

515088

251

2

no

0

512

1

06h

15

1023

63

0

515088

251

3

no

0

0

0

OOh

0

0

0

0

0

0

4

no

0

0

0

OOh

0

0

0

0

0

0

Do you want to continue or reedit

the partition table

(ñ/r)? c

Ðèñ. 4.1.

To ensure that the partition is recognized, reboot immediately. Make sure to disable all programs that write to your disk in CONFIG.SYS and AUTOEXEC.BAT before rebooting. It might be easier to to rename the files or to boot from floppy. Be particularly careful to disable programs like MIRROR and IMAGE, which might get confused if the partitioning is not to their liking. After rebooting, use CHKDS Ê or Norton Disk Doctor to make sure the first partition is OK. If you don't find any errors, you may now reboot with your normal CONFIG.SYS and AUTOEXEC.BAT. Start some programs and make sure you can still read your data.

After that, you have two valid Microsoft partitions on your disk. We'll look at what to do with them in the next chapter. The specific differences from a dedicated install are on page 66, but you'll need to start from the beginning of the chapter to do the install

G. Lehey FreeBSD Operating System

 
Ïîñìîòðåòü îðèãèíàë