Manual Installation FreeBSD/en

Aus EUserv Wiki

(Unterschied zwischen Versionen)
Wechseln zu: Navigation, Suche
(Die Seite wurde neu angelegt: „{{Languages|Manual_FreeBSD_Live_System}} Kategorie:Betriebssysteme und Software '''''Installing FreeBSD on my root server ''''' __TOC__ <div style= "font-size…“)
Zeile 62: Zeile 62:
<nowiki>#</nowiki> bsdlabel -wB /dev/ad8s1<br>
<nowiki>#</nowiki> bsdlabel -wB /dev/ad8s1<br>
<nowiki>#</nowiki> bsdlabel -e /dev/ad8s1<br>
<nowiki>#</nowiki> bsdlabel -e /dev/ad8s1<br>
 +
 +
  <nowiki>
 +
# /dev/ad8s1:
 +
8 partitions:
 +
# size offset fstype [fsize bsize bps/cpg]
 +
a: * 16 4.2BSD 0 0
 +
b: 4G * swap 0 0
 +
c: * 0 unused 0 0 # raw part, don't edit
 +
  </nowiki>
 +
 +
''Example-Label (4GB swap-Slice, rest for /):
 +
 +
This is the most simple kind of an example label. If you want to partitionize your hard disk otherwise, be careful that your partitions will be provided with the filesystem and mounted correctly. You have to customize your fstab accordingly.''
 +
 +
Create the BSD filesystem:<br>
 +
 +
<nowiki>#</nowiki> newfs -U -O2 /dev/ad8s1a<br>
 +
 +
Mount the partitions:<br>
 +
 +
<nowiki>#</nowiki> mount /dev/ad8s1a /mnt<br>
 +
 +
 +
=== Downloading the installation files: ===
 +
 +
<nowiki>#</nowiki> cd /mnt<br>
 +
<nowiki>#</nowiki> mkdir /mnt/install<br>
 +
<nowiki>#</nowiki> cd install<br>
 +
<nowiki>#</nowiki> mkdir kernels base<br>
 +
 +
You can freely choose your FreeBSD version. Open your browser using the following address:
 +
ftp://ftp.de.freebsd.org/pub/FreeBSD/releases/i386/
 +
''The 64bit versions are located in the directory /pub/FreeBSD/releases/amd64/''
 +
 +
Choose your desired version.
 +
 +
Now before downloading you have to choose the corresponding folder.
 +
 +
For a minimal installation you need the folders "Base" and "Kernels".
 +
 +
''Hint: Older versions can be found in the FreeBSD Archives under:''
 +
 +
ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/
 +
 +
Alternative: ftp.fi.freebsd.org/pub/FreeBSD/releases/i386/7.1-RELEASE/
 +
 +
 +
=== Example FreeBSD 8.1: ===
 +
 +
<nowiki>#</nowiki> ftp ftp.de.freebsd.org<br>
 +
 +
  <nowiki>
 +
freebsdrescue# ftp ftp.de.freebsd.org
 +
Trying 213.83.42.56...
 +
Connected to ftp.plusline.net.
 +
220 ProFTPD 1.3.1 Server (FTP Plus.line AG) [::ffff:213.83.42.56]
 +
Name (ftp.de.freebsd.org:root): anonymous
 +
331 Anonymous login ok, send your complete email address as your password
 +
Password: 1234 (an dieser Stelle ist es egal, was man hineinschreibt)
 +
</nowiki>
 +
 +
<nowiki>#</nowiki> cd /pub/FreeBSD/releases/i386/8.1-RELEASE/<br>
 +
<nowiki>#</nowiki>  mget base base/<br>
 +
''mget base/base.bh [anpqy?]? a''<br>
 +
 +
<nowiki>#</nowiki> mget kernels kernels/<br>
 +
''mget kernels/kernels.bh [anpqy?]? A''<br>
 +
 +
<nowiki>#</nowiki> exit<br>
 +
 +
=== Example Free BSD 7.1: ===
 +
 +
<nowiki>#</nowiki> ftp ftp-archive.freebsd.org<br>
 +
 +
user: anonymous
 +
 +
<nowiki>#</nowiki> cd /pub/FreeBSD-Archive/old-releases/i386/7.1-RELEASE/<br>
 +
 +
<nowiki>#</nowiki> mget base base/<br>
 +
mget base/base.bh [anpqy?]? a<br>
 +
 +
<nowiki>#</nowiki> mget kernels kernels/<br>
 +
mget kernels/kernels.bh [anpqy?]? A<br>
 +
 +
<nowiki>#</nowiki> exit<br>
 +
 +
 +
=== Installation of the basic system: ===
 +
 +
You have to set the environment variable for the installation directory, so the system can be installed on your hard drive.
 +
 +
<nowiki>#</nowiki> setenv DESTDIR /mnt<br>
 +
 +
Now the setup files are made executable and are executed after that:
 +
 +
<nowiki>#</nowiki> cd /mnt/install/base<br>
 +
 +
<nowiki>#</nowiki> chmod +x install.sh<br>
 +
 +
<nowiki>#</nowiki> ./install.sh<br>
 +
 +
<nowiki>#</nowiki> cd /mnt/install/kernels<br>
 +
 +
<nowiki>#</nowiki> chmod +x install.sh<br>
 +
 +
<nowiki>#</nowiki> ./install.sh GENERIC<br>
 +
 +
The kernel is in the folder "GENERIC". The content of the folder must be copied to /mn/boot/kernel so the bootloader can find the kernel:
 +
 +
<nowiki>#</nowiki> mv /mnt/boot/GENERIC/* /mnt/boot/kernel/<br>
 +
 +
<nowiki>#</nowiki> rmdir /mnt/boot/GENERIC<br>
 +
 +
 +
=== Configuration of the system: ===
 +
 +
Installation of the Bootloader:
 +
 +
<nowiki>#</nowiki> #boot0cfg -B /dev/ad8<br>
 +
 +
''Hint: Make sure that you use the correct designation of your hard drives.''
 +
 +
The file fstab must be created in /etc, so the slices are correctly mounted during the booting process. If you want to setup a software Raid, you can skip this step!
 +
 +
<nowiki>#</nowiki> vi /mnt/etc/fstab<br>
 +
 +
  <nowiki>
 +
dev/ad8s1a / ufs rw 1 1
 +
dev/ad8s1b none swap sw 0 0
 +
  </nowiki>
 +
''Example fstab''
 +
 +
Activate the SSH root login:
 +
 +
<nowiki>#</nowiki> vi /mnt/etc/ssh/sshd_config<br>
 +
Here the line "#PermitRootLogin no" must be edited:
 +
 +
  <nowiki>
 +
PermitRootLogin yes
 +
  </nowiki>
 +
 +
''(Do not forget to delete the #, so this line isn't a comment anymore)''
 +
 +
Setting the nameserver in the resolv.conf:
 +
 +
<nowiki>#</nowiki> vi /mnt/etc/resolv.conf<br>

Version vom 14:14, 27. Sep. 2012

Installing FreeBSD on my root server

Inhaltsverzeichnis

Installing FreeBSD on my root server

Prerequisites

For the installation of FreeBSD you need the following software on your system:

* SSH-client (e.g. OpenSSH / PuttY)


Start FreeBSD Live System

Start the FreeBSD Live-System, see: About the FreeBSD Live-System (RescueSystem)

Log in to your server via SSH. Before starting the installation be careful that you have an updated backup of your server.

Usually all data will be deleted at the installation.

Hint: On 64bit systems the 64bit RescueSystem will always be started by default. On this system an installation in 32 and 64bit is possible.


Starting the installation

The FreeBSD installation tool Sysinstall causes some problems, so we recommend that you run the installation manually.


Preparation of the hard drives

It's important for the installation that the system knows the existing hard drives. You can check this with the following command:

# ls -1 /dev/ad* /dev/da* /dev/twed* /dev/aacd* | grep -E '[a-z]{2}[0-9]+$' /dev/ad8 /dev/ad10

To get more information about the hard drives, you can use dmesg:

# dmesg | grep ad8 ad8: 1430799MB <Seagate ST31500341AS CC1H> at ata4-master UDMA100 SATA 3Gb/s

# dmesg | grep ad10 ad10: 1430799MB <Seagate ST31500341AS CC1H> at ata5-master UDMA100 SATA 3Gb/s

Here are 2 SATA2 hard disks with 1.5 TB installed on the server. (ad8 and ad10).

This intstruction describes the installation of a hard drive with the designation "ad8". You have to replace this designation with the name of your hard drive.

Now the hard drives have to be formatted:

# gpart show
# gpart delete -i 1 ad8
# gpart destroy ad8
# gpart create -s mbr ad8
# gpart add -t freebsd -i 1 ad8

Creating the partitions with bsdlabel:

# bsdlabel -wB /dev/ad8s1
# bsdlabel -e /dev/ad8s1

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

Example-Label (4GB swap-Slice, rest for /):

This is the most simple kind of an example label. If you want to partitionize your hard disk otherwise, be careful that your partitions will be provided with the filesystem and mounted correctly. You have to customize your fstab accordingly.

Create the BSD filesystem:

# newfs -U -O2 /dev/ad8s1a

Mount the partitions:

# mount /dev/ad8s1a /mnt


Downloading the installation files:

# cd /mnt
# mkdir /mnt/install
# cd install
# mkdir kernels base

You can freely choose your FreeBSD version. Open your browser using the following address: ftp://ftp.de.freebsd.org/pub/FreeBSD/releases/i386/ The 64bit versions are located in the directory /pub/FreeBSD/releases/amd64/

Choose your desired version.

Now before downloading you have to choose the corresponding folder.

For a minimal installation you need the folders "Base" and "Kernels".

Hint: Older versions can be found in the FreeBSD Archives under:

ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/

Alternative: ftp.fi.freebsd.org/pub/FreeBSD/releases/i386/7.1-RELEASE/


Example FreeBSD 8.1:

# ftp ftp.de.freebsd.org

  
freebsdrescue# ftp ftp.de.freebsd.org
Trying 213.83.42.56...
Connected to ftp.plusline.net.
220 ProFTPD 1.3.1 Server (FTP Plus.line AG) [::ffff:213.83.42.56]
Name (ftp.de.freebsd.org:root): anonymous
331 Anonymous login ok, send your complete email address as your password
Password: 1234 (an dieser Stelle ist es egal, was man hineinschreibt)

# cd /pub/FreeBSD/releases/i386/8.1-RELEASE/
# mget base base/
mget base/base.bh [anpqy?]? a

# mget kernels kernels/
mget kernels/kernels.bh [anpqy?]? A

# exit

Example Free BSD 7.1:

# ftp ftp-archive.freebsd.org

user: anonymous

# cd /pub/FreeBSD-Archive/old-releases/i386/7.1-RELEASE/

# mget base base/
mget base/base.bh [anpqy?]? a

# mget kernels kernels/
mget kernels/kernels.bh [anpqy?]? A

# exit


Installation of the basic system:

You have to set the environment variable for the installation directory, so the system can be installed on your hard drive.

# setenv DESTDIR /mnt

Now the setup files are made executable and are executed after that:

# cd /mnt/install/base

# chmod +x install.sh

# ./install.sh

# cd /mnt/install/kernels

# chmod +x install.sh

# ./install.sh GENERIC

The kernel is in the folder "GENERIC". The content of the folder must be copied to /mn/boot/kernel so the bootloader can find the kernel:

# mv /mnt/boot/GENERIC/* /mnt/boot/kernel/

# rmdir /mnt/boot/GENERIC


Configuration of the system:

Installation of the Bootloader:

# #boot0cfg -B /dev/ad8

Hint: Make sure that you use the correct designation of your hard drives.

The file fstab must be created in /etc, so the slices are correctly mounted during the booting process. If you want to setup a software Raid, you can skip this step!

# vi /mnt/etc/fstab

  
dev/ad8s1a / ufs rw 1 1
dev/ad8s1b none swap sw 0 0
   

Example fstab

Activate the SSH root login:

# vi /mnt/etc/ssh/sshd_config
Here the line "#PermitRootLogin no" must be edited:

  
PermitRootLogin yes
   

(Do not forget to delete the #, so this line isn't a comment anymore)

Setting the nameserver in the resolv.conf:

# vi /mnt/etc/resolv.conf