Thicc Plex¶
Using Hetzner
Specs:
CPU: Xeon(R) CPU E3-1270 v3 @ 3.50GHz
RAM: 32gb DDR3
Disk: 4x 10TB HDD (raid5 mdadm)
Connection: 1 GBit/s port
Guaranteed bandwidth: 1 GBit/s
The most important part, the neofetch once booted:
# bl @ bl-thicc in ~ [9:29:39]
$ neofetch
-` bl@bl-thicc
.o+` -----------
`ooo/ OS: Arch Linux x86_64
`+oooo: Host: S1200RP
`+oooooo: Kernel: 5.16.14-arch1-1
-+oooooo+: Uptime: 30 days, 21 hours, 11 mins
`/:-:++oooo+: Packages: 326 (pacman)
`/++++/+++++++: Shell: zsh 5.8.1
`/++++++++++++++: Memory: 1601MiB / 31835MiB
`/+++ooooooooooooo/` Disk (/): 9.7G / 126G (9%)
./ooosssso++osssssso+` Disk (/home): 5.5T / 28T (22%)
.oossssso-````/ossssss+`
-osssssso. :ssssssso.
:osssssss/ osssso+++.
/ossssssss/ +ssssooo/-
`/ossssso+/:- -:/+osssso+-
`+sso+:-` `.-/+oso:
`++:. `-/+/
.` `/
Getting started¶
- Boot to rescue
- Run
installimage
and edit the storage to use ~80/100etc gb for root (/) and the remainder for /home. In this case giving ~28tb of storage for /home. - Let it run
First boot¶
Make sure the storage is correct.
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 9.1T 0 disk
├─sda1 8:1 0 16G 0 part
│ └─md0 9:0 0 16G 0 raid1 [SWAP]
├─sda2 8:2 0 1G 0 part
│ └─md1 9:1 0 1022M 0 raid1 /boot
├─sda3 8:3 0 42.7G 0 part
│ └─md2 9:2 0 127.9G 0 raid5 /
├─sda4 8:4 0 9T 0 part
│ └─md3 9:3 0 27.1T 0 raid5 /home
└─sda5 8:5 0 1M 0 part
sdb 8:16 0 9.1T 0 disk
├─sdb1 8:17 0 16G 0 part
│ └─md0 9:0 0 16G 0 raid1 [SWAP]
├─sdb2 8:18 0 1G 0 part
│ └─md1 9:1 0 1022M 0 raid1 /boot
├─sdb3 8:19 0 42.7G 0 part
│ └─md2 9:2 0 127.9G 0 raid5 /
├─sdb4 8:20 0 9T 0 part
│ └─md3 9:3 0 27.1T 0 raid5 /home
└─sdb5 8:21 0 1M 0 part
sdc 8:32 0 9.1T 0 disk
├─sdc1 8:33 0 16G 0 part
│ └─md0 9:0 0 16G 0 raid1 [SWAP]
├─sdc2 8:34 0 1G 0 part
│ └─md1 9:1 0 1022M 0 raid1 /boot
├─sdc3 8:35 0 42.7G 0 part
│ └─md2 9:2 0 127.9G 0 raid5 /
├─sdc4 8:36 0 9T 0 part
│ └─md3 9:3 0 27.1T 0 raid5 /home
└─sdc5 8:37 0 1M 0 part
sdd 8:48 0 9.1T 0 disk
├─sdd1 8:49 0 16G 0 part
│ └─md0 9:0 0 16G 0 raid1 [SWAP]
├─sdd2 8:50 0 1G 0 part
│ └─md1 9:1 0 1022M 0 raid1 /boot
├─sdd3 8:51 0 42.7G 0 part
│ └─md2 9:2 0 127.9G 0 raid5 /
├─sdd4 8:52 0 9T 0 part
│ └─md3 9:3 0 27.1T 0 raid5 /home
└─sdd5 8:53 0 1M 0 part
Check the status of the raid build:
$ sudo mdadm -D /dev/md3
/dev/md3:
Version : 1.2
Creation Time : Thu Mar 17 11:56:29 2022
Raid Level : raid5
Array Size : 29111213568 (27.11 TiB 29.81 TB)
Used Dev Size : 9703737856 (9.04 TiB 9.94 TB)
Raid Devices : 4
Total Devices : 4
Persistence : Superblock is persistent
Intent Bitmap : Internal
Update Time : Sun Apr 17 09:34:26 2022
State : clean
Active Devices : 4
Working Devices : 4
Failed Devices : 0
Spare Devices : 0
Layout : left-symmetric
Chunk Size : 512K
Consistency Policy : bitmap
Name : rescue:3
UUID : f4148415:057331f8:d89f42d7:eccd67e4
Events : 102990
Number Major Minor RaidDevice State
0 8 20 0 active sync /dev/sdb4
1 8 4 1 active sync /dev/sda4
2 8 36 2 active sync /dev/sdc4
4 8 52 3 active sync /dev/sdd4
Next, setup user.
useradd bl
passwd bl {passwd}
usermod -aG wheel bl
pacman -S sudo vi vim git curl
visudo {edit wheel to have permisisions}
pacman -Syu (probably not needed, but good to make sure the image wasn't old.)
reboot
SSH with your new user. Test permissions -> sudo df -h /
Now install system tools and docker. - pip3: for python3 modules - docker: read more here - docker-compose: read more here - nload: watch network traffic - vnstat: log the network traffic (throughput and data over time) - fail2ban: block repeated ssh login attempts (helps to stop bots) - htop: monitor cpu and memory usage
sudo pacman -S zsh python-pip docker docker-compose vnstat nload htop fail2ban
Now start services and add user to docker group.
sudo systemctl enable docker
sudo systemctl start docker
sudo systemctl enable fail2ban
sudo systemctl start fail2ban
sudo systemctl start vnstat
sudo systemctl enable vnstat
sudo usermod -aG docker bl
Reboot.
Login again. Test docker running -> docker run hello-world
Expected output:
$ docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
2db29710123e: Pull complete
Digest: sha256:10d7d58d5ebd2a652f4d93fdd86da8f265f5318c6a73cc5b6a9798ff6d2b2e67
Status: Downloaded newer image for hello-world:latest
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/get-started/
Now build folder structure. I use the following:
/home
|--/docker
|--/docker/imageName/
|--/docker/imageName/docker-compose.yml
/home
|--/dev
|--/dev/Homelab-Setup/
/home
|--/media/
|--/media/tv/
|--/media/movies/
|--/media/other/
|--/media/other/yt
|--/media/other/edu