Defcon-1-Logo

           [Home]    [FBSD Articles]    [Scripts Corner]    [Contribute]    [Search]    [FBSD Links]    [Files]

About Us

FreeBSD Articles
  *Hardware
  *Networking
  *Security
  *Software
  *X Windows


Files / Scripts
Newbies Corner
Tech. Talk
Tips and Tricks


FreeBSD Links

Articles in other
Languages :
  *French Articles
  *Spanish Articles

Want to Help ?
 
   Click Here

Email Users5

Search:
 

 


FreeBSD Search:


 

 

Powered-By-Apache-Logo
Defcon1 Logo

Hard Drive Partion, and Setup Installation for FreeBSD

Getting Started:

 You will need either a bootable cdrom or a boot disk. This is needed to start the install program. If the cdrom drive is a bootable type, its not necessary to make a boot floppy. I set my bios to use the cdrom as the boot option and changed it back later to boot from the primary drive.

 Only one is needed. I also made another as a backup. Label the disk right away. It is not readable by dos. This is an image copy process and not the dos copy. Here's a screen representation of the process using DOS with the cdrom as drive "D: "

C:\> 
C:\>d: 
D:\>tools\rawrite d:\floppies\boot.flp a: 
Number of Sectors per track for this disk is 18 
Writing image to drive A:. Press ^C to abort. 
Track: 79  Head: 1  Sectors: 16 
Done. 

D:\>_

Booting By Floppy Disk :

 You must first have the CD Disk placed into your CD-rom Drive before turning the machine on, and the BIOS set to boot off of the Floppy disk, or if you are booting from the CD-Rom, then make sure that the BIOS is set to boot from the CD-Rom drive first. Once all this is done, then turn the machine on. The "twirling baton" indicates that its starting to load and a screen similar to the following will briefly appear.
 

Boot from ATAPI CD-ROM 
1. FD 1.44M System Type-(00) 

>>FreeBSD BOOT @ 0x10000: 639/64512 k of memory, internal console 
Boot default: 0:fd(0,a)kernel 
Usage: bios_drive:interface(unit,partition)kernel_name options 
  bios_drive  0, 1, ... 
  interface   fd, wd or sd 
  unit        0, 1, ... 
  partition   a, c, ... 
  kernel_name name of kernel, or ? for list of files in root directory 
  options     -a (ask name) -C (cdrom) -c (userconfig) -D (dual consoles) 
              -d (debug early) -g (gdb) -h (serial console) -P (probe kbd) 
              -r (default root) -s (single user) -v (verbose) 

Examples: 
 1:sd(0,a)mykernel boot 'mykernel' on the first SCSI drive when one IDE 
                   drive is present 
 1:wd(2,a)         boot from the second (secondary master) IDE drive 
 1:sd(0,a)?        list the files in the root directory on the specified 
                   interface, unit and partition 
 -cv               boot with the defaults, then run UserConfig to modify 
                   hardware parameters (c), and print verbose messages (v) 

boot:_

Next a boot prompt will appear with some instructions for different startup modes. Do nothing and in about 10 seconds, it will continue to boot.

This starts the UserConfig program which is used to tell the system what hardware to probe for and where to look. The best way to learn the UserConfig is to practice a few times.

To select the method recommended for new users ("Start kernel configuration in full screen Visual mode"), press the down arrow key to highlight the item and then press ENTER.
 

Kernel Configuration Menu 

Skip kernel configuration and continue with installation.  

Start kernel configuration in full screen Visual mode.  

Start kernel configuration in CLI mode.Here you have the chance to go into kernel configuration mode, making any changes which may be necessary to properly adjust the kernel to match your hardware configuration. 

If you are installing FreeBSD for the first time, select Visual Mode (press Down-Arrow then ENTER). 

If you need to do more specialized kernel configuration and are an experienced FreeBSD user, select CLI mode. 

If you are certain that you do not need to configure your kernel the simply press ENTER or Q now. 
   

 

Kernel Configuration

 The next steps you will be letting the installation software know a general idea of what hardware is currently running. It will try to probe your machine to get the items that it can see. Sometime it will see things incorrectly, so it is a good idea to know what IRQ and addresses that your network cards, etc are set on.  Probing is the name used for the process of detecting the presence of hardware. The drivers included cover a wide variety of hardware often with the same IRQ/Port information and will be indicated as "Conflicts".

 The objective is to specify the hardware probes to be included in the system and have no conflicts between them. Certain situations will have "permitted conflicts".

The first screen shows the layout of UserConfig and indicates the number of conflicts present. The catagories of device drivers (Storage, Network, etc.) are initially shown as a collapsed lists and can be expanded.
 

---Active-Drivers-----------------21 Conflicts------Dev---IRQ--Port--  
Storage:            (Collapsed)  
Network:            (Collapsed)  
Communications:     (Collapsed)  
Input:              (Collapsed)  
Multimedia:  
PCI:                (Collapsed)  
Miscellaneous:  

---Inactive-Drivers---------------------------------Dev--------------  
Storage:  
Network:  
Communications:      (Collapsed)  
Input:               (Collapsed)  
Multimedia:  
PCI:  
Miscellaneous:       (Collapsed)  
---------------------------------------------------------------------  
  

---------------------------------------------------------------------  
[Enter] Expand device list      [X] Expand all lists  
[TAB] Switch fields             [Q] Save and Exit        [ ? ] Help

 
The menu at the bottom includes "[ ? ] Help". Pressing "?" (without the quotes) will display information about screen layout, moving around, altering the list/parameters, and saving changes.
 

Main Installation Menu

Its important to read the documents provided before beginning the installation.
 

Welcome to FreeBSD! [2.2.7 - RELEASE]

This is the main menu of the FreeBSD installation system.  Please select one of the options below by using the arrow keys or typing the first character of the option name you're interested in.  Invoke an option by pressing [ENTER] or [TAB-ENTER] to exit the installation. 


1Usage         Quick start - How to use this menu system

2Doc           Installation instructions, README, etc.  
3Keymap        Select keyboard type 
4Options       View/Set various installation options 
5Novice        Begin a novice installation (for beginners)  
6 Express       Begin a quick installation (for the impatient)  
7Custom        Begin a custom installation (for experts)  
8Fixit         Enter repair mode with CDROM/floppy or shell start  
9Upgrade       Upgrade an existing system 
cConfigure     Do a post-install configuration of FreeBSD 
lLoad Config   Load default install configuration 
0Index         Glossary of functions 

[Select]

Exit Install

[ Press F1 for Installation Guide ] 

 

Starting Installation of FreeBSD

Select "Novice" installation (obviously). The term novice refers to the installation process and not experience with unix.
 

Welcome to FreeBSD! [2.2.7 - RELEASE]

This is the main menu of the FreeBSD installation system.  Please select one of the options below by using the arrow keys or typing the first character of the option name you're interested in.  Invoke an option by pressing [ENTER] or [TAB-ENTER] to exit the installation. 


1Usage         Quick start - How to use this menu system 
2Doc           Installation instructions, README, etc. 
3Keymap        Select keyboard type 
4Options       View/Set various installation options 

5Novice        Begin a novice installation (for beginners)

6Express       Begin a quick installation (for the impatient) 
7Custom        Begin a custom installation (for experts) 
8Fixit         Enter repair mode with CDROM/floppy or shell start 
9Upgrade       Upgrade an existing system 
cConfigure     Do a post-install configuration of FreeBSD 
lLoad Config   Load default install configuration 
0Index         Glossary of functions 

[Select]

Exit Install

                    [ Press F1 for Installation Guide ]  

 

Setting the FreeBSD Slice as bootable

Use the arrow keys to highlight the FreeBSD slice and press "S" to set the slice as bootable. The illustration below shows the FreeBSD Slice as set as bootable. The
Flags should indicate "CA" before you leave this screen.

When finished, press [Q] to save the changes and quit. The boot manager will be install next.

Disk name:  wd0              FDISK Partition Editor 
Disk Geometry 16383 cyls/16 heads/63 sectors = 16514064 sectors 

  Offset   Size   End  Name PType   Desc Subtype Flags 

    0    63    62    -   6  unused    0 
    63 16514001 16514063  wd0s1   3 freebsd   165 CA

 
 

 The following commands are supported (in upper or lower case) 

 A = Use Entire Disk  B = Bad Block Scan    C = Create Slice 
 D = Delete Slice    G = Set Drive Geometry  S = Set Bootable 
 T = Change Type    U = Undo All Changes   Q = Quit 

 Use F1 or ? to get more help, arrow keys to select.

Install a Boot Manager

First, highlight the boot manager option desired, the press [SPACE]. An asterisk "*" will indicate the selection. I was installing FreeBSD alone so a boot manager was
not needed.

When finished, select [OK] and press [ENTER].

                         Install Boot Manager for drive wd0?
 FreeBSD comes with a boot selector that allows you to easily select between FreeBSD and any other operating systems on your machine at boot time. If you have more than one drive and want to boot from the second one, the boot selector will also make it possible to do so (limitations in the PC BIOS usually prevent this otherwise). If you do not want a boot selector, or wish to replace an existing one, select "standard". If you would prefer your Master Boot record to remain untouched then select "None". 

 NOTE: PC-DOS users will almost certainly require "None"! 


 ( ) BootMgr   Install the FreeBSD Boot Manager ("Booteasy") 
 (*) Standard   Install a standard MBR (no boot manager)
 ( ) None      Install the FreeBSD Boot Manager ("Booteasy") 

                          [ OK ]   Cancel 

                    [ Press F1 to read about drive setup ] 

FreeBSD Disklabel Editor

                              Message
 Next, you need to create BSD partitions inside of the fdisk partition(s) just created. If you have a reasonable amount of disk space (200MB or more) and don't have any special requirements, simply use the (A)uto command to allocate space automatically. If you have more specific needs or just don't care for the layout chosen by (A)uto, press F1 for more information on manual input. 

                               [  OK  ]
                       [ Press enter to continue ]

There are no partitions shown when you first enter the editor. If you press [A] to create the auto defaults for all the file systems (/,swap, /var, /usr), it will suggest minimum sizes and give the most user space. Those are shown on the next screen.

                             FreeBSD Disklabel Editor
 
 Disk: wd0  Partition name: wd0s1  Free: 16514001 blocks (8063MB)
 Part  Mount   Size Newfs  Part  Mount   Size Newfs 
 ----  -----   ---- -----  ----  -----   ---- ----- 
 
 
 
 

 The following commands are supported (in upper or lower case) 

 C = Create       D = Delete       M = Mount pt. 
 N = Newfs Opts   T = Newfs Toggle  U = Undo      Q = Finish 
 A = Auto Defaults for all! 

 Use F1 or ? to get more help, arrow keys to select.

                                Partition
 This is the FreeBSD DiskLabel Editor. 

 NOTE: If you're entering this editor from the update procedure then you probably shouldn't (C)reate anything at all but rather use only the (M)ount command to check and mount existing partitions for upgrading. If you would like the label editor to do most of the following for you, simply type 'A' for automatic partitioning of the disk. 

 If you wish to create partitions manually you may do so by moving the highlighted selection bar with the arrow keys over the FreeBSD partition(s) displayed at the top of the screen. Typing (C)reate while a partition with available free space is selected will allow you to create a BSD partition inside of it using some or all of its available space. 

 Typing (M)ount over an existing partition entry (displayed in the middle of the screen) will allow you to set a mount point for it without initializing it. If you want it initialized, use the (T)oggle command to flip the Newfs flag. When Newfs is set to "Y", the filesystem in question will be ERASED and rebuilt from scratch! 

 You should use this editor to create at least the following filesystems: 

   Name  Purpose        Min Size?     Optional? 
   ----  -------             ---------        --------- 
   /     Root filesystem     20MB         No 
   swap Swap space        2 * MEM      No 
   /usr  System & user files 80MB or more   Yes


 Note: If you do not create a /usr filesystem then you / filesystem will need to be bigger - at least 100MB. This is not recommended as any media errors that may occur during disk I/O to user files will corrupt the filesystem containing vital system files as well. It is for this reason that / is generally kept on its own filesystem, where it should be considered essentially "read only" in your administration of it. 

 Swap space is a little trickier, and the rule of "2 * MEM" is simply a best-guess approximation and not necessarily accurate for your intended usage of the system. If you intend to use the system heavily in a server or multi-user application, you may be well advised to increase this size. You may also create swap space on multiple drives for a larger "total" swap and this is, in fact, recommended if you have multiple, fast drives for which such load-balancing can only help overall I/O performance. 

 The /usr filesystem should be sized according to what kind of distributions you're trying to load and how many packages you intend to install in locations like /usr/local. You can also make /usr/local a separate filesystem if you don't want to risk filling up your /usr by mistake. 

 Another useful filesystem to create is /var, which contains mail, news printer spool files and other temporary items. It is a popular candidate for a separate partition and should be sized according to your estimates of the amount of mail, news or spooled print jobs that may be stored there. 

 WARNING: If you do not create a separate filesystem for /var, space for such files will be allocated out of the root (/) filesystem instead. You may therefore wish to make the / partition bigger if you expect a lot of mail or news and do not want to make /var its own partition. 

 If you're new to this installation, you might also want to read the following explanation of how FreeBSD's new "slice" paradigm for looking at disk storage works: 

 In FreeBSD's new system, a device name can be broken up into up to 3 parts. Take a typical name like "/dev/sd0s1a": 

   The first three characters represent the drive name. If we had a system with two SCSI drives on it then we'd see /dev/sd0 and /dev/sd1 as the device entries representing the entire drives. 

   Next you have the "slice" (or "FDISK Partition") number as seen in the Partition Editor. Assuming that our sd0 contained two slices, a FreeBSD slice and a DOS slice, that would give us /dev/sd0s1 and /dev/sd0s2 as device entries pointing to the entire slices. 

   Next if a slice is a FreeBSD slice, you can have a number of (confusingly named) "partitions" inside of it. 

   These partitions are where various filesystems or swap areas live, and using our hupothetical two-SCSI-disk machine again, we might have something like the following layout on sd0: 
      Name      Mountpoint 
      ----      ---------- 
      sd0s1a     / 
      sd0s1b     <swap space> 
      sd0s1e     /usr
   Because of historical convention, there is also a short-cut, or "compatibility slice", that is maintained for easy access to the *first* FreeBSD slice on a disk. This give some backwards compatibility to utilities that still may not know how to deal with the new slice scheme. 

   The compatibility slice names for our filesystem above would also look like: 
    
      Name      Mountpoint 
      ----      ---------- 
      sd0a      / 
      sd0b      <swap space> 
      sd0e      /usr
   Again, let it be noted: FreeBSD automatically maps the compatibility slice to the first FreeBSD slice it find (in this case, sd0s1). You may have multiple FreeBSD slice on a drive, but only the first one will be mapped to the compatibility slice! 

  The compatibility slice will eventually be phased out, but it is still important right now for several   reasons: 
    
      1. Some programs, as mentioned before, still don't work with the slice paradigm and need time to 
        catch up. 

      2. The FreeBSD boot blocks are unable to look for a root file system in anything but a
        compatibility slice right now. This means that our root will always show up on "sd0a" in the
        above scenario, even though it real lives over on sd0s1a and would otherwise be referred to by
        its full slice name.

 Once you understand all this, the the purpose of the label editor becomes fairly clear: You're carving up the FreeBSD slices displayed at the top of the screen into smaller pieces, which are displayed in the middle of the screen, and then assigning FreeBSD file system names (mount points) to them. 

 You can also use the label editor to mount existing partitions/slices into your filesystem hierarchy, as is
 frequently done for DOS FAT slices. For FreeBSD partitions, you can also toggle the "newfs" state so that the partitions are either (re)created from scratch or simply checked and mounted (the contents are preserved). 

 Whey you're done, type 'Q' to exit. 

 No actual changes will be made to the disk until you (C)ommit from the Install menu or (W)rite directly from this one. You're working with what is essentially a copy of the disk label(s), both here and in the FDISK Partition Editor, and the actual on-disk labels won't be affected by any changes you make until you explicitly say so. 
                           [  OK  ]
                             

Auto Defaults for Partitions

This was the suggested disklabels for my disk size. If you are using a small hard disk, you may wish to use the defaults.

If you choose to change the disklabels, first make a note of the suggested disk label information shown for your disk. The steps for changing the Size of the partitions follow.

                  FreeBSD Disklabel Editor
 
 Disk: wd0  Partition name: wd0s1  Free: 0 blocks (0MB)

 Part  Mount   Size    Newfs  Part  Mount   Size Newfs 
 ----   -----   ----     -----  ----  -----   ---- ----- 
 wd0s1a  /    32MB   UFS Y 
 wd0s1b swap 137MB  SWAP 
 wd0s1e  /var  30MB   UFS Y 
 wd0s1f  /usr   7863MB UFS Y 
 

 The following commands are supported (in upper or lower case) 

 C = Create       D = Delete       M = Mount pt. 
 N = Newfs Opts   T = Newfs Toggle  U = Undo      Q = Finish 
 A = Auto Defaults for all! 

 Use F1 or ? to get more help, arrow keys to select.

Creating Custom Partitions

After writing down the auto defaults for all the file systems (/,swap, /var, /usr), select the first partition ( / ) and press [D] to delete the partition. Delete all the partitions in the same manner and the screen will look similar to this but with different numbers for "Free:" depending on the hard disk size.

                     FreeBSD Disklabel Editor
 
 Disk: wd0  Partition name: wd0s1  Free: 16514001 blocks (8063MB)

 Part  Mount   Size Newfs  Part  Mount   Size Newfs 
 ----  -----   ---- -----  ----  -----   ---- ----- 
 
 
 
 

 The following commands are supported (in upper or lower case) 

 C = Create       D = Delete       M = Mount pt. 
 N = Newfs Opts   T = Newfs Toggle  U = Undo      Q = Finish 
 A = Auto Defaults for all! 

 Use F1 or ? to get more help, arrow keys to select. 

I create the partitions in the same order as the auto default.
 

CREATING THE ROOT PARTITION "/"
To create the "/" partition, first press [C] and the dialog box will appear:

                             Value Required
 Please specify the partition size in blocks or append a trailing M for megabytes or C for cylinders. 16514001 blocks (8063MB) are free. 
 
                              
16514001

 
                              [OK]  
Cancel

Edit the number to a value you want. I'm going to set the "/" partition to 256M. First, delete the entry using the [BACKSPACE] and enter:

                            Value Required
 Please specify the partition size in blocks or append a trailing M for megabytes or C for cylinders. 16514001 blocks (8063MB) are free. 
 
                                256M
 
                             [OK]  Cancel

With "OK" highlighted, then press [ENTER]. The following dialog box appears:

                        Please Choose a Partition Type
 If you want to use this partition for swap space, select Swap. 
 If you want to put a filesystem on it, choose FS. 
 
                     FS      A file system
                     Swap    A swap partition


     
                              [OK]  Cancel

The following dialog box appear to enter the mount point. Enter "/" for the root partition mount point. With the [OK] highlighted, press [ENTER]

                             Value Required
 Please specify a mount point for the partition. 
 
                                 /
 
                             [OK]   Cancel

CREATING THE "SWAP" SPACE

To create the partition, first press [C] and the dialog box will appear:

                            Value Required
 Please specify the partition size in blocks or append a trailing M for megabytes or C for cylinders. 15989713 blocks (7807MB) are free. 
 
                              15989713
 
                             [OK]   Cancel

Edit the number to a value you want. I'm going to set the "SWAP" partition to 256M. First, delete the entry using the [BACKSPACE] and enter:

                            Value Required
 Please specify the partition size in blocks or append a trailing M for megabytes or C for cylinders. 15989713 blocks (7807MB) are free. 
 
                               256M
 
                             [OK]  Cancel

With "OK" highlighted, then press [ENTER]. The dialog box appears again. This time, I'm creating SWAP space so I highlight SWAP with the down arrow. With [OK]
highlighted, press [ENTER]. It will not prompt for a mount point when SWAP is selected.

                       Please Choose a Partition Type
 If you want to use this partition for swap space, select Swap. 
 If you want to put a filesystem on it, choose FS. 
 
                     FS     A file system
                     Swap   A swap partition


                           [OK]  Cancel

CREATING THE "/var" PARTITON

To create the "/var" partition, first press [C] and the dialog box will appear:

                          Value Required
 Please specify the partition size in blocks or append a trailing M for megabytes or C for cylinders. 15465425 blocks (7551MB) are free. 
 
                            15465425

                           [OK]   Cancel

Edit the number to a value you want. I'm going to set the "/var" partition to 256M.
First, delete the entry using the [BACKSPACE] and enter:

                           Value Required
 Please specify the partition size in blocks or append a trailing M for megabytes or C for cylinders. 15465425 blocks (7551MB) are free. 
 
                              256M
 
                            [OK]  Cancel

With "OK" highlighted, then press [ENTER]. The following dialog box appears:

                      Please Choose a Partition Type
 If you want to use this partition for swap space, select Swap. 
 If you want to put a filesystem on it, choose FS. 
 
                     FS     A file system
                     Swap   A swap partition


                         [OK]  Cancel

The following dialog box appear to enter the mount point. Enter "/var" for the partition mount point. With the [OK] highlighted, press [ENTER]

                            Value Required
 Please specify a mount point for the partition. 
 
                                 /var
 
                             [OK]  Cancel

CREATING THE "/usr" PARTITION

To create the "/usr" partition, first press [C] and the dialog box will appear:

                            Value Required
 Please specify the partition size in blocks or append a trailing M for megabytes or C for cylinders. 14941137 blocks (7295MB) are free. 
 
                             14941137
 
                            [OK]  Cancel

I'm going to set the "/usr" partition to the remaining amount.
With the [OK] highlighted, I just press [ENTER]. The following dialog box appears:

                       Please Choose a Partition Type
 If you want to use this partition for swap space, select Swap. 
 If you want to put a filesystem on it, choose FS. 
 
                     FS      A file system
                     Swap    A swap partition


                            [OK]  Cancel

The following dialog box appear to enter the mount point. Enter "/usr" for the usr partition. With the [OK] highlighted, press [ENTER] 

                             Value Required
 Please specify a mount point for the partition. 
 
                                 /usr
 
                             [OK]   Cancel

                         FreeBSD Disklabel Editor
 
 Disk: wd0  Partition name: wd0s1  Free: 0 blocks (0MB)

 Part    Mount   Size    Newfs  Part  Mount   Size Newfs 
 ----    -----    ----    -----   ----  -----   ---- ----- 
 wd0s1a  /      256MB  UFS Y 
 wd0s1b swap   256MB  SWAP 
 wd0s1e  /var    256MB  UFS Y 
 wd0s1f  /usr    7295MB UFS Y 

 The following commands are supported (in upper or lower case) 

 C = Create       D = Delete       M = Mount pt. 
 N = Newfs Opts   T = Newfs Toggle  U = Undo      Q = Finish 
 A = Auto Defaults for all! 

 Use F1 or ? to get more help, arrow keys to select.

Click Here for Part 2 -->>

GhostRdr v.1.0

FreeBSD Installed - Visually / Step by Step

Email Us

ghostrdr@defcon1.org

This site cannot be duplicated without permission

© 1998 - 2010 Defcon1, www.defcon1.org. Copyrights for all materials on this web site are held by the individual authors, artists, photographers or creators. Materials may not be reproduced or otherwise distributed without permission of www.defcon1.org and the content's original author.