how do I create partitions?

Jerry McAllister jerrymc at clunix.cl.msu.edu
Sun Feb 5 17:24:30 PST 2006


> 
> What tool allows me to boot on some media (cd, fd) and create partitions
> of various types (for FreeBSD, Windows 98/2000 at least) and sizes 
> (in sectors)?

Probably you should read up on how disks are set up and how booting
works.   That overall picture will help you the most to understand
things.

One thing to understand is that there is a standard about the very 
lowest level of disk management and initial bootup that is pretty
much common across all systems.   This is of necessity rather than
because the best possible was has been found.

The necessity is that something must happen _first_ to get a system
up and going.   After that minimal point every system can take its
own course.  

So, boot starts in BIOS which is a program written on some nonvolatile 
memory storage on the system.   That program normally can be set to 
control which devices it will try to boot from and in which order it
will check them (after doing some other setup and system checkout stuff).
A typical boot list and order might be: Floppy, CD, first hard disk.

The BIOS looks at the very first sector (512 Bytes) on each listed boot 
device for a specific code in the exactly correct position in that sector
that tells it this is a boot sector.   The first one it finds it loads
in to the system and transfers control to it.  That little bit of code
is called an MBR.   It contains a little bit of a program and some tables
that tell it how the disk is divided and and how to find the next part
of the boot process.  

That first MBR sector must follow some very specific rules so the BIOS
can find it.   But, there it all begins to differ a little.
The most compatible MBRs all fit in to that one sector, but some systems
take advantage of the fact that, nowdays most disk management tools
just waste the rest of the whole first track anyway, so they use all
of those sectors to make up a prettier/fancier MBR.  But those MBRs all
still do the same ultimate thing.

The MBR consults its tables and decides which disk divisions to look in
for the next boot level.  Most of them other than those by MS tend to
give you a choice as to which one of the possibilties available to
use for the next boot level.   

That Third level (BIo=1, MBR=2,...) part of the boot process has some
standard parts that any MBR can read and get in to.  You pick the one 
you want and it reads in that (slice in FreeBSD lingo) boot code and 
passes control to it.

Then things get really individual and each system comes up in its own way.

In general the fdisk(8) program (named the same in MS, but it is a different
program there) does the most basic division of the disk (into slices) and
writes out whatever MBR you want put there - none, or the FreeBSD standard.

The disklabel(8) (pre 5.xxx of bsdlabel(8) 5.xxx and later) divides the
slices into partitions, writes the secondary label (the one in each slice)
and that "third" boot level sector in the slice.

The standard (but not default) FreeBSD MBR is able to boot all systems
that use this standard process including those from MS and LINUX as well
as FreeBSD, but it might not be able to display a nice looking name for
all of them because it still fits in that single sector rather than
borrowing the "wasted" sectors.  This is done to make sure it is as
completely compatible with everything as possible.

Now that you have this tome, you should go on and read for yourself
and fill in the details and the parts I glossed over.  

////jerry

> 
> 
> 	
> 
> 	
> 		
> __________________________________________________________ 
> Find your next car at http://autos.yahoo.ca
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"
> 
> 



More information about the freebsd-questions mailing list