This is an old revision of the document!
Table of Contents
Linux Raid
This setup installs Debian Buster on twin drives (which do not need to be identical) in RAID 1 mirror mode.
Two partitions are created, one for swap and the other for data using the “news” inode allocation scheme.
Blank disc drives (optional)
Blanking the drives is optional but useful for reinstall.
Boot from USB media, debian xfce live CD
https://cdimage.debian.org/debian-cd/current-live/amd64/iso-hybrid/debian-live-10.2.0-amd64-xfce.iso
sudo -s
Blank full disc
dd if=/dev/zero of=/dev/sda bs=4M
dd if=/dev/zero of=/dev/sdb bs=4M
Blank boot sector
dd if=/dev/zero of=/dev/sda bs=4M count=1
dd if=/dev/zero of=/dev/sdb bs=4M count=1
Installation
Boot from USB media, debian net install
https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-10.2.0-amd64-netinst.iso
Install
We setup the two discs as independent clones of each other then add both as RAID 1 as two partitions, one for data and the other as swap.
- english
- united kingdom
- british english
- load missing firmware? NO
- primary NIC
- hostname/domain
- root/user
- guided partitioning
- guided use entire disc
- SDA
- all files in one partition
- edit /
- options: noatime, nodiratime
- usage: news
- done
- SDB
- automatic, all files in one partition
- edit /
- options: noatime, nodiratime
- usage: news
- done
- configure software RAID
- write changes
- create MD device
- RAID 1
- 2 device
- 0 spares
- /dev/sdaX /dev/sdbX
- create MD device
- RAID 1
- 2 devices
- 0 spares
- /dev/sdaX /dev/sdX
- RAID 1 DEVICE 0
- mount /
- use as ext4
- options: noatime, nodiratime
- usage: news
- done
- RAID 1 DEVICE 1
- use as swap
- done
- finish partitioning
- mirror
- uk
- no package survey
- choose software
- SSH server
- standard utils
- install grub
- yes
- /dev/sda1
Post install
If the machine does not boot after install, change the drive order in the BIOS and reboot.
Environment
Login as root
/bin/su - root export PATH=/bin:/sbin:/usr/bin:/usr/sbin
Grub
Install grub onto second drive.
grub-install /dev/sdb
Other
Install useful software.
apt-get install apt-file smartmontools sudo vim apt-file update update-alternatives --set editor /usr/bin/vim.basic
Services
Web.
apt-get install apache2 php-cli php-mysql default-mysql-client php-sqlite3 sqlite3
SQL server (mariadb)
apt-get install default-mysql-server
Development
Programming tools for fetching and building code from repositories.
apt-get install tcsh bc build-essential git mercurial