Free BSD Manual install commands

Free BSD Manual install commands

FreeBSD Manual Install Commands

DHCP Network


iface is interface of your NIC my computer is rl0.

# dhclient iface DHCP     (Optional)

# gpart show     #Verify

If disk had partitions

# gpart delete -i 1 ada0
  ada0s1 deleted
# gpart destroy ada0

# gpart create -s mbr ada0
  ada0 created
# gpart add -t freebsd -i 1 ada0
  =>      63  33554369  ada0  MBR  (16G)
          63  33554367     1  freebsd  (16G)
    33554430         2        - free - (1.0K)
  
# bsdlabel -wB /dev/ad0s1       # to create an empty table shown below

# bsdlabel /dev/ad0s1 > labeloutfile

# /dev/ad0s1:
8 partitions:
#          size     offset    fstype   [fsize bsize bps/cpg]
  a:   33554351         16    unused        0     0
  c:   33554367          0    unused        0     0     # "raw" part, don't edit

Edit this table to match similar ee can be used during this time
Edit this to your ways

ee labeloutfile

# bsdlabel /dev/ad0s1 (16 GB Drive)

# /dev/ad0s1:
8 partitions:
#          size     offset    fstype   [fsize bsize bps/cpg]
  a:         2G         16    4.2BSD        0     0     0
  b:         4G          *      swap        0     0
  c:   33554367          0    unused        0     0     # "raw" part, don't edit
  d:         5G          *    4.2BSD        0     0     0
  e:         *           *    4.2BSD        0     0     0

* Means use whatever and * on Size means use rest.

Restore disk information from your file

# bsdlabel -R /dev/ad0s1 labeloutfile

Display the information

# bsdlabel /dev/ad0s1

# /dev/ad0s1:
8 partitions:
#          size     offset    fstype   [fsize bsize bps/cpg]
  a:    4194304         16    4.2BSD        0     0     0
  b:    4194304    4194320      swap        0     0
  c:   33554367          0    unused        0     0     # "raw" part, don't edit
  d:    8388608    8388624    4.2BSD        0     0     0
  e:   16777135   16777232    4.2BSD        0     0     0
 
  then format each of the drives

# newfs -U -O2 /dev/ad0s1a
# newfs -U -O2 /dev/ad0s1d
# newfs -U -O2 /dev/ad0s1e

 then mount them

# mount /dev/ad0s1a /mnt
# mkdir /mnt/usr
# mkdir /mnt/usr/home
# mount /dev/ad0s1e  /usr
# mount /dev/ad0s1d    /home

# cd /mnt

 install bootblock
# boot0cfg -B /dev/ada0


# df -h
Filesystem                      Size    Used   Avail Capacity  Mounted on
/dev/iso9660/FREEBSD_INSTALL    564M    564M      0B   100%    /
devfs                           1.0K    1.0K      0B   100%    /dev
/dev/md0                         31M    316K     28M     1%    /var
/dev/md1                         19M     56K     17M     0%    /tmp
/dev/ad0s1a                     1.9G     16K    1.8G     0%    /mnt
/dev/ad0s1e                     7.7G     12K    7.1G     0%    /mnt/usr
/dev/ad0s1d                     3.9G    8.0K    3.6G     0%    /mnt/usr/home
# pwd
/tmp

# ls /usr/freebsd-dist/*.txz

To see the files in the directory on CD
then if wanted to a shell script can be created or they can be manually
extracted.

Script way (Example Script)
!/bin/sh
# forls

    for loop in `ls /usr/freebsd-dist/*.txz `
        do
           
            tar vxjpf $loop
        done   


Without script the command is

# tar xjpfv /usr/freebsd-dist/file.txz

and so on till each file in the directory requested is extracted.

Configuring the Fstab

Add lines to the /etc/fstab as it is blank similar to below

#Device                  Mount    FSTtype    Option   Dump    Pass

/dev/ad0s1a             /         ufs        rw       1         1
/dev/ad0s1b             none      swap       sw       0         0
/diskdev/usr            /usr      ufs        rw       0         0
/diskdev/home           /home     ufs        rw       0         0
proc                    /proc     procfs     rw       0         0


/diskdev/usr   Symbolic link to /dev/ad0s1e
/diskdev/home  Symbolic link to /dev/ad0s1d

Symbolic link will not work for the root filesystem

Then configure the /etc/rc.conf

Basic Configuration just to get it to work

# Set Hostname
hostname="TestComp"

#Set Keyboard
keymap="uk.iso.kbd"

#Set Network
ifconfig_rl0="DHCP"

# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"


Set the password for root

# cd /mnt
# chroot .
passwd
Enter password for root: Password
Confirm password for root: Password

adduser
Follow promptings on screen

exit # Exit the chroot environment

cd /
umount /mnt/usr/home
umount /mnt/usr
umount /mnt

Before rebooting verify the settings.

reboot

No comments:

Post a Comment