mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-15 10:17:20 +00:00
De-Danish this. Add a lot more chatty commentary in my own inimitable style.
This commit is contained in:
parent
73ba88d5d1
commit
de0ad7f292
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=4152
@ -1,46 +1,66 @@
|
||||
How to assign disk-space to FreeBSD.
|
||||
How to assign disk space to FreeBSD.
|
||||
|
||||
1. What is all this about
|
||||
--------------------------
|
||||
After a general introduction, you will find explanations on what you need
|
||||
to do to assign space for FreeBSD on your disk(s). The program documented
|
||||
herein is the "sysinstall" program which lives on the install-disks.
|
||||
|
||||
1.1 What is the problem
|
||||
------------------------
|
||||
The problem is that disks are big. So big that people don't want to use them
|
||||
in one piece. With the latest disks being in the 9.0 Gbyte range (which for
|
||||
comparision is some six thousand floppydisks of the 1.4 Mb type) you cannot
|
||||
blame them. It has always been this way, and most computers have some way
|
||||
of "slicing" the disks into more manageble chunks.
|
||||
|
||||
1.2 A history-lesson
|
||||
1.0 Getting started.
|
||||
---------------------
|
||||
MS-DOS, when hard-disk support was slammed on back in the late eighties,
|
||||
didn't have this. What it had was a way to install Xenix and MS-DOS
|
||||
on the same disk (MicroSoft were in the UNIX-business once, remember ?).
|
||||
In the first sector on the disk, was a piece of "boot-code" and a table
|
||||
with four entries. Each of those entries pointed at a slice of the disk,
|
||||
and one of them was marked "active". The machine would boot by reading
|
||||
the first sector into RAM, and jump to it. The small piece of boot-code
|
||||
would look at the table and decide which OS was to be booted by looking
|
||||
for the "active" flag, load the first sector of that slice of the disk
|
||||
and jump to it.
|
||||
|
||||
Later of course, they realized that disks could be bigger than the 32Mb
|
||||
the FAT-12 "filesystem" could handle, so they added a kludge: They had
|
||||
two MSDOS slices, a "Primary" and a "Secondary". The primary could still
|
||||
only be 32Mb, but the Secondary had no size limit. And the trick was, it
|
||||
had another MBR in it, so now suddenly 5 slices could be availabel to
|
||||
MS-DOS, later the made the Secondary MBR recursive, and thereby effectively
|
||||
avoided any number limit. Of course you can still only have the 26 slices
|
||||
in MSDOS because they use "drive-letters".
|
||||
After a general introduction, you will find some explanation on what you need
|
||||
to do to assign space to FreeBSD on your disk(s). This is done through
|
||||
the "sysinstall" program, which lives on the inital boot floppy. Those
|
||||
already expert with PCs may wish to skip ahead to section 1.2, the rest of
|
||||
you may enjoy the brief history lesson.
|
||||
|
||||
1.3 What FreeBSD does
|
||||
|
||||
1.1 The ins and outs of allocating disk storage on your PC.
|
||||
------------------------------------------------------------
|
||||
|
||||
Modern hard disk drives are now getting big enough that people don't want
|
||||
to allocate all of one to just one operating system anymore, especially
|
||||
given the increasing size of disk drives (the latest 9.0 Gbyte models holding
|
||||
the equivalent of some six thousand 1.44MB floppies!) and the virtual
|
||||
explosion of operating system options available for the PC. To solve this
|
||||
problem, IBM came up with a scheme for "slicing" the disks into more manageble
|
||||
chunks, or partitions. It works, but only just. To better understand
|
||||
why, first a brief bit of history:
|
||||
|
||||
MS-DOS, when hard disk support was unceremoniously grafted on back in the
|
||||
late eighties, didn't have such things. What it had was a way to install
|
||||
Xenix and MS-DOS on the same disk (Remember when Microsoft were in the UNIX
|
||||
business? A long time ago, to be sure!).
|
||||
|
||||
In the first sector on the disk was a piece of "primary boot code" and a table
|
||||
with four entries. Each of those entries pointed at an arbitrary slice
|
||||
of the disk, with one of them was marked "active". The machine would boot
|
||||
by reading the first sector containing the boot code into RAM and then
|
||||
jumping to it. The job of this small piece of boot code was to look at
|
||||
the 4 entry table and decide which OS was to be booted by looking
|
||||
for the "active" flag. It would go and load the first sector of that slice
|
||||
of the disk into RAM and then and jump to it in turn. This bit of boot
|
||||
code was called the "secondary boot", and could be specific to a given
|
||||
operating system. The primary boot code and 4-entry table is known
|
||||
as the Master Boot Record, or MBR, and is very important to the proper
|
||||
operation of your PC! We will discuss the MBR in more detail later.
|
||||
|
||||
It was later realized, with the hindsight that IBM is famous for, that disks
|
||||
could be bigger than the 32Mb that the early DOS FAT-12 file system could
|
||||
handle, so they added a kludge: They had two MSDOS slices, a "Primary" and
|
||||
a "Secondary". The primary could still only be 32Mb, but the Secondary had
|
||||
no size limit. And the trick was that the secondary had ANOTHER "table entry"
|
||||
so that now suddenly up to 5 slices could be available to MS-DOS. The
|
||||
Secondary boot record was later made recursive, thus effectively avoiding
|
||||
any fixed limit. Of course, they were still stuck with a maximum of 26 slices
|
||||
given the use of "drive letters" in DOS. Yes, truly DOS was and is an
|
||||
utterly terrible operating system, which of course explains its amazing degree
|
||||
of success. Anyway, this all brings us up to today, which is where FreeBSD
|
||||
comes in.
|
||||
|
||||
|
||||
1.2 What FreeBSD does
|
||||
----------------------
|
||||
FreeBSD has, like any other UNIX, a concept of "partitions". There is no
|
||||
difference between a slice and a partition as such, but we use the two
|
||||
words to distinguish between the two different levels of slicing.
|
||||
FreeBSD has, like any other UNIX-like operating system, the concept of
|
||||
"partitions." Partitions are used to implement its own "slicing" abstraction,
|
||||
and although there is no real difference between a slice and a partition as
|
||||
such, we use the two words to distinguish between these two different levels
|
||||
of slicing.
|
||||
|
||||
The result is that we have a two-tier structure on the disk:
|
||||
|
||||
@ -59,127 +79,172 @@ The result is that we have a two-tier structure on the disk:
|
||||
+-------------------+ \ +----------------+
|
||||
| Partition C | --> | swap-partition |
|
||||
+-------------------+ +----------------+
|
||||
...
|
||||
| ... |
|
||||
|
||||
|
||||
Here is the rule-set that FreeBSD uses:
|
||||
Here are the rules that FreeBSD plays by:
|
||||
|
||||
A: FreeBSD always has a MBR-slice with type 0xa5. This means that there
|
||||
should always be a MBR-record, even in the case where FreeBSD occupies
|
||||
the entire disk.
|
||||
B: The FreeBSD-slice contains the FreeBSD-disklabel in the second sector.
|
||||
C: The 'C' partition in the FreeBSD-disklabel corresponds to the entire
|
||||
FreeBSD-slice.
|
||||
A: FreeBSD always has an MBR slice with type 0xa5 (each of the 4 slices can
|
||||
also have a unique integer identifier so you can tell your DOS slices
|
||||
from your FreeBSD slices from your Linux slices, etc). This means that
|
||||
there should always be an MBR record, even in the case where FreeBSD
|
||||
occupies the entire disk.
|
||||
B: The FreeBSD slice contains the FreeBSD disklabel in the second sector
|
||||
(remember, the first sector contains the secondard boot code for FreeBSD,
|
||||
which is what prints that FreeBSD prompt at you when you first boot
|
||||
FreeBSD from a floppy or hard disk).
|
||||
C: The 'C' partition in the FreeBSD disklabel corresponds to the entire
|
||||
FreeBSD slice.
|
||||
D: The 'D' partition corresponds to the entire physical disk.
|
||||
E: Should a disk not have a FreeBSD-slice (because there simply is no
|
||||
FreeBSD on it anywhere), then the MBR-slices are mapped into partitions
|
||||
'E' to 'H' of a artificially created FreeBSD-disklabel.
|
||||
E: Should a disk not have a FreeBSD slice (because there simply is no
|
||||
FreeBSD on it anywhere), then the MBR slices are mapped into partitions
|
||||
'E' to 'H' of a artificially created FreeBSD disklabel. This is useful
|
||||
for getting at DOS-only disks.
|
||||
|
||||
Therefore, to get FreeBSD onto your disk, you need to do the following:
|
||||
|
||||
1. Make a MBR-slice for FreeBSD (FDISK)
|
||||
2. Partition the diskspace in the MBR-slice into partitions (DISKLABEL)
|
||||
Step FreeBSD utility
|
||||
------------------------------------------------------------ ---------------
|
||||
1. Make an MBR slice for FreeBSD (FDISK)
|
||||
2. Partition the diskspace in the MBR slice into partitions (DISKLABEL)
|
||||
3. Assign mount-points to the partitions. (DISKLABEL)
|
||||
|
||||
|
||||
2. The main-screen
|
||||
-------------------
|
||||
The main-screen shows you the current status, It shows you which disks
|
||||
|
||||
2. The sysinstall utility
|
||||
--------------------------
|
||||
|
||||
The sysinstall utility is the program you first see when you boot
|
||||
FreeBSD's install floppy. It is responsible for partitioning your
|
||||
disk, creating an MBR slice for FreeBSD, setting up the disklabel
|
||||
within that slice and creating filesystems for each FreeBSD partition
|
||||
you create within that slice. It is composed of a number of screens.
|
||||
These are described below.
|
||||
|
||||
|
||||
2.1 The main screen
|
||||
--------------------
|
||||
The main screen shows you the current status, It shows you which disks
|
||||
FreeBSD has found, how big they are and how much of it is assigned to
|
||||
FreeBSD in a FreeBSD-MBR-slice. It also shows the partitions which have
|
||||
had a mountpoint assigned to them.
|
||||
FreeBSD in a FreeBSD MBR slice. It also shows the partitions which have
|
||||
had a mountpoint assigned to them (not necessarily FreeBSD partitions;
|
||||
FreeBSD is perfectly capable of mounting DOS disks directly).
|
||||
|
||||
(H)elp -- shows you this file.
|
||||
|
||||
(F)disk -- enters the Fdisk editor, where you can change the MBR-record.
|
||||
This is what you want to use to assign some part of the disk to FreeBSD.
|
||||
(F)disk -- enters the Fdisk editor, where you can change the MBR record.
|
||||
This is what you want to use to assign some part of the disk to FreeBSD.
|
||||
|
||||
(D)isklabel -- enters the Disklabel editor, here you can change how the
|
||||
FreeBSD slice is used.
|
||||
FreeBSD slice is partitioned for FreeBSD.
|
||||
|
||||
(Q)uit -- will continue the installation process.
|
||||
|
||||
|
||||
3. FDISK - how to make an MBR-slice
|
||||
2.2 FDISK - how to make an MBR slice
|
||||
-------------------------------------
|
||||
There is some rules to follow everywhere, and the MBR is a potential mine-
|
||||
field. There is no way to really make sure that you have a valid MBR. It
|
||||
is very complicated to write a validation check for it, because there are
|
||||
no real rules.
|
||||
There are some rules to follow here since altering your MBR is a potential
|
||||
minefield. There is really no way for the sysinstall program to genuinely
|
||||
know that you have a valid MBR, so you have to be extra careful in what
|
||||
you edit. Failure to do this properly can and will destroy your other
|
||||
operating system entries!
|
||||
|
||||
Even if you don't plan to have MSDOS on this disk, make a MSDOS slice
|
||||
Even if you don't plan to have MSDOS on a disk, make an MSDOS slice
|
||||
using the MSDOS's FDISK.COM program. The reason for this is that if you
|
||||
do it that way, you are 100% sure that FreeBSD will use the same number
|
||||
of heads, sectors and cylinders as MSDOS would use. If you don't plan
|
||||
to have MSDOS on the disk, just (D)elete the slice in the FreeBSD's
|
||||
(F)disk editor.
|
||||
of heads, sectors and cylinders as MSDOS would use. If you really don't plan
|
||||
to have MSDOS on the disk, just (D)elete the slice in the FreeBSD's (F)disk
|
||||
editor.
|
||||
|
||||
From the main-screen press 'F' to enter the MBR editor. You have five
|
||||
From the main screen press 'F' to enter the MBR editor. You have five
|
||||
commands available:
|
||||
|
||||
(H)elp -- Will launch you into this file.
|
||||
(H)elp -- Shows you this file.
|
||||
|
||||
(D)elete -- Will delete a slice entirely.
|
||||
(D)elete -- Deletes a slice entirely.
|
||||
|
||||
(E)dit -- Will allow you to edit a slice. It will ask how many megabytes
|
||||
you want to assign to this slice, and will suggest the maximum possible
|
||||
as default. It might say zero, even though there is disk-space available,
|
||||
then you need to delete and recreate the other partitions to get the
|
||||
puzzle solved. It will then ask you what type to give the slice, and
|
||||
the default here is 0xa5, which is a FreeBSD slice. You can enter any
|
||||
other number here too, which can be useful as a placeholder. Finally
|
||||
it will ask you about the "boot-flag", 0x80 means "boot from this" and
|
||||
anything else means "don't".
|
||||
If you specified a FreeBSD slice, any existing slices witht the 0xa5
|
||||
type will be reset to 0x00 "unused". FreeBSD only supports one slice
|
||||
per disk for FreeBSD.
|
||||
(E)dit -- Allows you to edit a slice. It will ask how many megabytes
|
||||
you want to assign to the slice, and will suggest the maximum possible
|
||||
as a default. It might say zero, even though there is disk space available,
|
||||
in which case you will probably need to delete and recreate the other
|
||||
partitions to get it to see where the free space is.
|
||||
It will then ask you what type to give the slice, for which the default is
|
||||
0xa5 (a FreeBSD slice). You can enter any other number here too, which can
|
||||
be useful as a placeholder for some other OS you plan to install later.
|
||||
Finally, it will ask you about the "boot flag". 0x80 means "boot from this"
|
||||
slice by default, and anything else means "don't".
|
||||
|
||||
If you specified a FreeBSD slice, any existing slices with the 0xa5
|
||||
type will be reset to 0x00 "unused". FreeBSD only supports one slice
|
||||
per disk for FreeBSD.
|
||||
|
||||
(R)eread -- This is your "undo" function. It will read the data of the
|
||||
disk again.
|
||||
disk again, disposing of any changes you may have made.
|
||||
|
||||
(W)rite -- When you are satisfied with the data, this function will write
|
||||
the new MBR to the disk.
|
||||
the new MBR to the disk.
|
||||
|
||||
(Q)uit -- Go back to the main-screen.
|
||||
(Q)uit -- Go back to the main screen.
|
||||
|
||||
|
||||
4. Disklabel - How to divide the FreeBSD-slice.
|
||||
------------------------------------------------
|
||||
2.3 Disklabel - How to divide up the FreeBSD slice.
|
||||
----------------------------------------------------
|
||||
|
||||
(H)elp -- Will launch you into this file.
|
||||
The disklabel screen provides the following commands:
|
||||
|
||||
(S)ize -- Will resize a partition for you, it will suggest as default the
|
||||
(H)elp -- Shows you this file.
|
||||
|
||||
(S)ize -- Resizes a partition for you, it will suggest as a default the
|
||||
maximum amount of diskspace it can find. This algorithm isn't too smart
|
||||
so it might say zero, even though there is diskspace available. If it
|
||||
and may say zero, even though there is diskspace available. If it
|
||||
does, delete and resize the other partitions.
|
||||
|
||||
(M)ountpoint -- Here you assign where the filesystem in a partition is to
|
||||
be mounted. 'b' partitions will always be made into "swap" partitions.
|
||||
be mounted. `b' partitions will always be made into "swap" partitions.
|
||||
|
||||
(D)elete -- Will delete a partition.
|
||||
(D)elete -- Delete a partition.
|
||||
|
||||
(R)eread -- Is a undo function. It will reread the current disklabel from
|
||||
(R)eread -- The undo function. It will reread the current disklabel from
|
||||
the kernel.
|
||||
|
||||
(W)rite -- This will write the disklabel to the disk. You must always write
|
||||
before you quit, otherwise your changes will be lost.
|
||||
|
||||
(Q)uit -- Exit back to the main-screen.
|
||||
(Q)uit -- Exit back to the main screen.
|
||||
|
||||
|
||||
5. Some hints on diskspace needed
|
||||
----------------------------------
|
||||
2.4. Hints on partition sizing
|
||||
-------------------------------
|
||||
|
||||
5.1 Swapspace
|
||||
--------------
|
||||
Always assign at least as much diskspace to swap as you have RAM in the
|
||||
machine. If you expect to run X11 (XFree86) on the machine, twice that
|
||||
amount.
|
||||
While it's impossible to say how much space you're going to want to
|
||||
make your various partitions without knowing more about your intended
|
||||
applicatins, here are some good rules of thumb to follow:
|
||||
|
||||
5.2 Filesystems
|
||||
----------------
|
||||
1. Root (/) should be at least 18MB, and probably no more than 50MB unless
|
||||
you have some special reason for making your root partition really
|
||||
large. Remember that the root filesystem is only supposed to contain
|
||||
vital system files and little else.
|
||||
|
||||
Mountpoint Filesystem-size
|
||||
2. Swap should be at least 2*memory. That is to say if you have 8MB of
|
||||
memory, then you probably want 16MB of swap. Even more swap space
|
||||
certainly doesn't hurt, if you can afford to allocate it, and you should
|
||||
also think ahead a little to any planned memory upgrades you may have
|
||||
in mind since increasing this later can be very painful!
|
||||
|
||||
If you're going to run the X Window System (XFree86), you should also
|
||||
consider having a *minimum* of 16MB of swap, since X tends to really
|
||||
use it up.
|
||||
|
||||
3. /usr can take up the rest of your disk, though some people like to create
|
||||
extra partitions for user home directories and the like. Be sure to make
|
||||
your /usr big enough to contain the system software (about 50MB) and perhaps
|
||||
some of your own, unless you're going to use symbolic links to point things
|
||||
like /usr/local (or /usr/src) somewhere else.
|
||||
|
||||
|
||||
Here are some suggested filesystem names and sizes, just for reference:
|
||||
|
||||
Mountpoint Filesystem size
|
||||
-------------------------------
|
||||
/var 10Mb
|
||||
/usr 50Mb
|
||||
@ -191,4 +256,4 @@ Mountpoint Filesystem-size
|
||||
/usr/X11R6 50Mb If you load the entire XFree86 binary kit.
|
||||
|
||||
|
||||
$Id$
|
||||
$Id: DISKSPACE.FAQ,v 1.1 1994/11/05 05:54:21 phk Exp $
|
||||
|
Loading…
Reference in New Issue
Block a user