Installing testing on a workstation

An example installation of Debian testing on a workstation/desktop machine

Author: Francesco Poli
Contact: invernomuto@paranoici.org
Version: 0.19
Copyright: Expat license
Notice:

Copyright (c) 2007-2020 Francesco Poli

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About this document
Web form HyperText Markup Language
Source form reStructuredText
Web stylesheet Cascading StyleSheets
Build directives Makefile

Contents

Testing on a workstation step by step

The purpose of this document is showing an example installation of Debian testing on a machine intended to be used as workstation/desktop.

Please note that this is just a step by step description of the installation process for a particular case. It is not meant to replace or substitute the official Debian installation guide: you can find the Debian stable installation guide and the Debian testing installation guide online.

Hardware

For the record, the machine under consideration consists of the following components:

  • CoolerMaster Force 500 black Case
  • Cooler Master RS-600-ACAB-M4 ATX 600 W power supply unit
  • Startech.Com power cable
  • ASRock Mod 1150 Z97 Extreme6 ATX motherboard
  • Intel Core i5 4590S CPU
  • a pair of G.Skill RipjawsX CL11 DDR3 2400 MHz PC3-19200 8 Gibyte memory modules
  • Asus DRW-24F1ST DVD/CD drive
  • two Samsung MZ-75E250B 850 EVO SATA III 250 Gbyte solid-state drives
  • two TRIXES SSD mounting brackets
  • Logitech 104 (+8) key USB keyboard (USA layout)
  • Logitech Optical Wheel Mouse USB mouse
  • StarTech.com DVI to VGA adapter
  • SAMSUNG SyncMaster 2043 SN LCD screen
  • Logitech X-230 speaker system
  • Sennheiser HEADSET PC 3 CHAT headphones with microphone (double jack)
  • BOIFUN 1080P Full HD USB Webcam with microphone

Preparation

The hardware architecture of the box is AMD64 (EM64T). Since the goal is installing a 64 bit system, an amd64 installation medium is needed. The following testing netinst installation ISO hybrid image (with debian-installer based on the current testing alpha pre-release) is chosen:

$ wget \
http://cdimage.debian.org/cdimage/stretch_di_alpha3/amd64/iso-cd/debian-stretch-DI-alpha3-amd64-netinst.iso

Insert a USB flash memory stick into a USB port and check which device name it was assigned (by looking at recently created /dev/sd* files or by reading log messages with dmesg). You can now write the image to the USB stick:

# dd if=debian-stretch-DI-alpha3-amd64-netinst.iso of=/dev/sdb ; sync

Other available CD/DVD images are linked from the Debian Installer page.

Installation

Configure the UEFI in order to disable secure boot and legacy BIOS mode (CSM); also, set the legacy USB support to "UEFI setup only". After that, insert the USB stick into a USB port of the box and boot from USB. Check that the UEFI variant of the Debian Installer is being run, then select "Install" and press [Enter] at the boot prompt in order to start the installation process.

First questions

The very first thing you are asked to select is the language you want to use for the installation process (which will subsequently be set as default language for the installed system): choose English, if you share my preferences. After that, you have to choose your country, so that the correct timezone will be set: select other, Europe, then Italy (or otherwise, if you live elsewhere...). On next screen, choose the locale: select "en_US.UTF-8". Then choose the keymap to use: select "American English", if you have a US keyboard.

The installer says that some of your hardware (one onboard network interface) needs non-free firmware and offer to load it from removable media: you may proceed without it (select "No").

At that point the installer warns that multiple network interfaces were found in the system and ask the user to choose the primary interface. One is the Intel I218-V, the other one is the Realtek RTL8111/8168/8411: choose Intel as primary interface (assuming that you connected this interface to your LAN). The installer then proceeds to configure the network through DHCP. If you have a DHCP server on your LAN (as in my case), it succeeds and no further configuration is needed.

Now, use your creativity and choose a hostname for your box! You have to enter one in the next screen. Hereinafter, I'll refer to the chosen hostname as $HOSTNAME. Then, you have to enter the domain name: leave the field blank, if you have no established domain name for your LAN.

Time to set the root password: try and think a good one! You can create a regular user as well: enter your full name, a username, and a password.

Partitioning the disk

The goal is setting up a (hopefully) good partitioning layout for a workstation usage, with the two SSD drives in software RAID1. When asked, choose the manual partitioning method. Next screen displays the current partition tables:

SCSI1 (0,0,0) (sda) - 250.1 GB ATA Samsung SSD 850
SCSI2 (0,0,0) (sdb) - 250.1 GB ATA Samsung SSD 850

The USB stick is also displayed, but should obviously be left untouched.

Select the first drive (sda) and answer "Yes" when asked whether a new partition table should be created. Select the free space line and choose "Create a new partition" from the dialog screen. Enter "540 MB" as partition size and create the partition at the beginning of the available space, change the "Use as" entry to "EFI System Partition". After choosing "Done setting up the partition", you get back to the partition table screen, with the following updated status:

SCSI1 (0,0,0) (sda) - 250.1 GB ATA Samsung SSD 850
             1.0 MB        FREE SPACE
     #1    539.0 MB  B  f  ESP
           249.5 GB        FREE SPACE
SCSI2 (0,0,0) (sdb) - 250.1 GB ATA Samsung SSD 850

Again select the big free space line and choose "Create a new partition". Enter "1.5 GB" as partition size and create the partition at the beginning. Change the "Use as" entry to "physical volume for RAID". After choosing "Done setting up the partition", you get back to the partition table screen, with the following updated status:

SCSI1 (0,0,0) (sda) - 250.1 GB ATA Samsung SSD 850
             1.0 MB        FREE SPACE
     #1    539.0 MB  B  f  ESP
     #2      1.5 GB     K  raid
           248.0 GB        FREE SPACE
SCSI2 (0,0,0) (sdb) - 250.1 GB ATA Samsung SSD 850

Go on setting up partitions according to the following table:

entered size use as
"9.0 GB" swap
"24.0 GB" raid
"14.0 GB" raid
"900 MB" raid
"max" raid

Back to the partition table screen, the situation should look like:

SCSI1 (0,0,0) (sda) - 250.1 GB ATA Samsung SSD 850
             1.0 MB        FREE SPACE
     #1    539.0 MB  B  f  ESP
     #2      1.5 GB     K  raid
     #3      9.0 GB     f  swap          swap
     #4     24.0 GB     K  raid
     #5     14.0 GB     K  raid
     #6    899.7 MB     K  raid
     #7    200.1 GB     K  raid
           171.5 kB        FREE SPACE
SCSI2 (0,0,0) (sdb) - 250.1 GB ATA Samsung SSD 850

Now select the second drive (sdb) and create an identical partition table. After doing so, choose "Configure software RAID". You'll be asked to confirm the creation of partitions, before you can proceed: answer "Yes".

The next screen allows you to configure software RAID: choose "Create MD device", select "RAID1", with "2" active devices and "0" spare devices. Select "/dev/sda2" and "/dev/sdb2". Repeat this procedure to create other MD devices by coupling the other twin physical volumes for RAID. Choose "Finish", when you're done with MD device creation.

In the partition table screen, select the "#1 1.5 GB" line: change the "Use as" entry to "Ext4 journaling file system", and the mount point to /. After choosing "Done setting up the partition", repeat the process for the other MD devices, until the result is as follows:

RAID1 device #0 - 1.5 GB Software RAID device
     #1      1.5 GB     f  ext4          /
RAID1 device #1 - 24.0 GB Software RAID device
     #1     24.0 GB     f  ext4          /usr
RAID1 device #2 - 14.0 GB Software RAID device
     #1     14.0 GB     f  ext4          /var
RAID1 device #3 - 899.1 MB Software RAID device
     #1    899.1 MB     f  ext4          /tmp
RAID1 device #4 - 200.0 GB Software RAID device
     #1    200.0 GB     f  ext4          /home
SCSI1 (0,0,0) (sda) - 250.1 GB ATA Samsung SSD 850
             1.0 MB        FREE SPACE
     #1    539.0 MB  B  F  ESP
     #2      1.5 GB     K  raid
     #3      9.0 GB     F  swap          swap
     #4     24.0 GB     K  raid
     #5     14.0 GB     K  raid
     #6    899.7 MB     K  raid
     #7    200.1 GB     K  raid
           171.5 kB        FREE SPACE
SCSI2 (0,0,0) (sdb) - 250.1 GB ATA Samsung SSD 850
             1.0 MB        FREE SPACE
     #1    539.0 MB  B  F  ESP
     #2      1.5 GB     K  raid
     #3      9.0 GB     F  swap          swap
     #4     24.0 GB     K  raid
     #5     14.0 GB     K  raid
     #6    899.7 MB     K  raid
     #7    200.1 GB     K  raid
           171.5 kB        FREE SPACE

Choose "Finish partitioning and write changes to disk"; you'll be asked to confirm the creation of the partitions: answer "Yes". The desired filesystems are created.

Finishing the installation

At this point, you just have to wait for the base system to be installed. Then you'll be asked to choose a mirror near you (for instance choose Italy, deb.debian.org, which is the Debian CDN). You also have to specify an HTTP proxy, if you use one; if instead you do not use any HTTP proxy on your LAN (as in my case), then leave the proxy field blank. Then you'll be asked whether you want to contribute to popcon: answer "Yes", if you care about Debian. The next screen allows you to select groups of packages: since the goal here is installing the base system only, deselect everything and choose "Continue".

The installation is complete: remove the USB stick and choose "Continue" to reboot the system!

Configuring the boot process for failing drives

In order for the RAID1 setup to be really useful, the system must be able to boot even when one of the two drives fails to work correctly.

To this aim, we have to add the "nofail" option to the swap partitions and to the EFI system partition (ESP) in /etc/fstab:

# grep nofail /etc/fstab
UUID=CE67-C4AD  /boot/efi       vfat    umask=0077,nofail     0      1
UUID=f5c29a-d648 none       swap    sw,nofail     0      0
UUID=8eecee-6d08 none       swap    sw,nofail     0      0

Moreover, we can use the EFI system partition (ESP) created on the second drive (sdb). Since the first ESP is mounted on /boot/efi, we can mount the second ESP on /boot/efi2. First of all, create the mount point:

# mkdir /boot/efi2

Then, figure out the UUID of the second ESP:

# blkid /dev/sdb1

add a corresponding entry to /etc/fstab:

# grep efi2 /etc/fstab
# /boot/efi2 was on /dev/sdb1 during installation
UUID=CE67-EBDD  /boot/efi2      vfat    umask=0077,nofail     0      1

and mount the second ESP:

# mount /boot/efi2

Finally, copy the content of /boot/efi to /boot/efi2:

# cp -a /boot/efi/EFI /boot/efi2/

At this point the system should become able [1] to boot from any of the two drives. To this aim, configure the UEFI boot order so that the machine attempts to boot from the second drive (this way, you can check that it is actually able to do so) and then from the first one as a fallback:

# efibootmgr
BootCurrent: 0000
Timeout: 1 seconds
BootOrder: 0000
Boot0000* debian
# efibootmgr --create --disk /dev/sdb --loader '\EFI\debian\grubx64.efi' \
  --label debian2 --part 1
BootCurrent: 0000
Timeout: 1 seconds
BootOrder: 0001,0000
Boot0000* debian
Boot0001* debian2

If the efibootmgr command is not available, install the corresponding package:

# apt update && apt install efibootmgr

Please note that /boot/efi2 has to be manually kept in sync with /boot/efi: update it whenever the content of /boot/efi changes (that is to say, whenever package grub-efi-amd64 is upgraded). Moreover, the EFI boot order configuration has to be set again (whenever package grub-efi-amd64 is upgraded).

[1]currently this requires manual intervention on the console: see bug #784070 for further details

Optimizing the SSD performance

Since the drives are SSDs, it is suggested to enable TRIM support at filesystem level. It will transparently pass through the software RAID layer.

Edit file /etc/fstab, adding the "discard" option to each ext4 filesystem (for instance "defaults" becomes "defaults,discard") and even to the vfat and swap partitions.

Conclusions

Now the system is installed and ready to run: you can boot it and log in as root or as the previously created regular user. But very little can be done with the base system only: next step is tuning the system configuration and begin adding software packages according to your needs. More details in a separate document (HTML, reST).