Schulung-Teil1-Server mit RAID1 aufsetzen

From revampedia
Jump to: navigation, search

Preface

It is planned that we have some interal training every two weeks. This entry is to the training we had on 10-20-16. JR

If there are still questions open after these instructions, please go to "Views" and then "Discussion" to leave your feedback, so I can add more Details to this page. jr


Instructions for the installation of Debian Jessie in English can be found at "data/Intern/Schulung/Manuals/Server". 3.11.16 mstauffer
Link to Installation Debian Jessie in Englisch
Link to Software RAID1 in Englisch

In our case we had computers with 2x250GB HD and 4GB RAM. With the F12 key we were able to select the network boot option, were we chose the Debian Jessie Installer. Many parts of the installation are done automatically, but some things still require human input. I didn't memorize the proper synthax during the installation, so the options will be named by it's purpose rather than the exact wording.

Installation of the Operating System

This is the part where human input is required:

- Select the language
(what language should the operating system have)
- Select country
(relevant for time servers and mirrors)
- Select keyboard layout
(in our case it's most likely to be CH-DE, so the keys we type match the keys on the keyboard)
- Select server name
(so the user knows on what machine they are working)
- Select mirror
(tells the system from what server it should retrieve the necessary files for the network installation)
- Set root password
- Create username and password

Partitioning

- Partitioning
(this requires more human input)
From the possible options we chose the manual installation
1debian install-partitioning method.png
Ideally we have two new hard drives without any partitions.
2debian install-partition disks.png
We need to create a partition table for the first hard drive
3debian install-partition disks-create empty partition table.png
It will look something like the following picture after both hard drives have a partition table
4debian install-partition disks-with empty partition tables.png
Now we select the free space of the first hard drive
5debian install-partition disks-partitions.png
And create a new partition
6debian install-partition disks-create new partition.png

Activate Raid1

Since we're planing to use RAID1 we need to set the "Use as" to "physical volume for RAID".
7debian install-partition disks-create new partition settings.png
And we do the same with the second hard drive. We only had two volumes and not four as the screenshot shows, as I copied it from another site. We will also add LVM to it later
8debian install-partition disks-partitions end.png
Now we select "Configure software RAID".
9debian install-partition disks-md.png
The changes we've made so far need to be saved, so we select "Yes" to be able to proceed
10debian install-partition disks-save.png
We select "Create MD device"
11debian install-partition disks-md new.png
And select "RAID1"
12debian install-partition disks-md new type.png
In our case it consists of 2 devices
13debian install-partition disks-md new number of devices.png
And 0 spare devices
14debian install-partition disks-md new number of spare devices.png
Now we select the partitions that will be part of our RAID1. We should only have two options and we select both of them.
15debian install-partition disks-md select devices.png
Our case is once again diffrent from the screenshot since we only have one RAID-partition.
16debian install-partition disks-md done.png

Configure LVM and create partitions

Now our instructions are no longer the same as in the english link at the top of the page. We now configure the "Logical Volume Manager" (short LVM).
- Create Volume-Group
-> in our case we called it "vg01"
- Create logical volume
-> In our case we need three partitions (root 20GB, home 10GB and swap 5GB)
root Mount point = / and "Use as" ext4
17debian install-partition disks-md0.png
home Mount point = /home and "Use as" ext4
swap "Use as" swap area
18debian install-partition disks-md1.png
Once all the partitions are create, the hard part is over
19debian install-raid done.png
And we wish to write the changes to the disk
20debian install-confirm.png

While the packages are being installed we can change to a different console with Alt+F4. Here we can see what the the installation program does. With Alt+F1 we get back to graphical version of the installation program.
- We only selected the SSH server and default system tools
-> for a normal computer you'd also chose one or more desktop enviroments and possibly also the print server
- Install Grub2 on both hard drives
21debian install-grub.png
-> As we've only installed it on one hard drive so far we don't finish, but go back and install GRUB in the other hard drives boot sector
- Reboot the computer
- login as root

First steps on the new system

- apt update
- apt install sudo
- adduser "username" sudo
- exit
- Login with your username now
- nano .bashrc in the home folder of your username

The file is opened in the editor and there you want to remove the # on the line where there's written "force_color_prompt=yes" -> your regular user will show up in green now
If you wish to have a different colour, you need to make some modifications:

PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '

\[\033[0;30m\]	black 
\[\033[1;30m\] dark grey
\[\033[0;31m\] red
\[\033[1;31m\] light red
\[\033[0;32m\] green
\[\033[1;32m\] light green
\[\033[0;33m\] brown
\[\033[1;33m\] yellow
\[\033[0;34m\] blue
\[\033[1;34m\] light blue
\[\033[0;35m\] dark purple
\[\033[1;35m\] light purple
\[\033[0;36m\] dark turquoise
\[\033[1;36m\] turquoise
\[\033[0;37m\] light grey
\[\033[1;37m\] white
\[\033[0m\] colourless

That root also has the promt in colour, you need to copy the .bashrc as root (or sudo) into /root/ and edit the newly copied file. To change it to red you need to change the 34 to 31 or if you want a different colour, enter the proper colour code. For further information to individualize your CLI in German

To learn how to setup a Xen-Hypervisor, please follow the link to Teil2 or if you wish to setup an Apache2-server you can go to Teil3.
,