I got myself a new Server on which I’m going to install Gentoo with systemd. The Serverspecs are:
CPU1: Intel(R) Xeon(R) CPU E3-1245 V2 @ 3.40GHz (Cores 8) Memory: 15960 MB Disk /dev/sda: 3000 GB (=> 2794 GiB) doesn't contain a valid partition table Disk /dev/sdb: 3000 GB (=> 2794 GiB) doesn't contain a valid partition table Total capacity 5589 GiB with 2 Disks
But lets get down to business. There are a couple of decisions that have to be made before the installation of the operating system. First is the partioning of the harddrives. As one can see from the code fragment above, the server has 2 x 3 TB disk space. Since the main purpose of the server is to host customer websites and databases a hugh junk of the disk will be used for datastorage. The other decision is about the bootloader, which is decided by wether it is a legacy BIOS or an EFI system.
BIOS or EFI
To determine if the system has a legacy BIOS or an EFI bootloader an article at askubuntu.com suggests to check /proc/firmware/efi which tells if the system is booted as EFI. In my case this was not the case. It was also mentioned to check the kernel bootlog, dmesg, if there are any hints on a EFI system. But from expirience with previous servers from Hetzner it seem the case that their systems are all legacy boot systems, which is fine because there are not any important feature differences for a server system.
Partitioning and disk layout
The server sadly has no hardware RAID controller, but since it has two disk drives with each having enough space, I decided to go with a mirrored software RAID 1. For the data patition an LVM will be used so that I’m a little bit more flexible in allocating the space. The patitions will be like this:
- (EF02) Partition for GRUB Bios files
- (FD00) 500MB ext2 /boot
- (8200) SWAP 16GB
- (FD00) 500GB ext4 /
- (FD00) LVM 2,34TB
- /customers 1,5TB ext4
- /usr/portage 50GB ext2
- /usr/portage/distfiles 100GB ext2
# parted -a optimal /dev/sda (parted) mklabel gpt (parted) unit MiB (parted) mkpart primary 2 100 (parted) set 1 bios_grub on (parted) mkpart primary 512 1024 (parted) mkpart primary linux-swap(v1) 1024 17408 (parted) mkpart primary 17408 529408 (parted) mkpart primary 529408 -1 (parted) set 2 raid on (parted) set 4 raid on (parted) set 5 raid on (parted) p Model: ATA ST33000650NS (scsi) Disk /dev/sda: 2861588MiB Sector size (logical/physical): 512B/512B Partition Table: gpt Number Start End Size File system Name Flags 1 1.00MiB 101MiB 100MiB BIOS boot partition bios_grub 2 512MiB 1024MiB 512MiB ext2 primary raid 3 1024MiB 17408MiB 16384MiB linux-swap(v1) primary 4 17408MiB 529408MiB 512000MiB ext4 primary raid 5 529408MiB 2861588MiB 2332180MiB primary raid
Now that the partitions on sda are created, the patition table will be mirrored to sdb using sgdisk and then a new GUID will be generated for sdb.
sgdisk -R /dev/sdb /dev/sda sgdisk -G /dev/sdb
So let’s initialize the RAID. For /boot and / I use the metadata 0.9, since otherwise I would need an initramfs, which I’m not familiar with.
mdadm --create /dev/md0 --level=1 --raid-devices=2 --metadata=0.90 /dev/sda2 /dev/sdb2 mdadm --create /dev/md1 --level=1 --raid-devices=2 --metadata=0.90 /dev/sda4 /dev/sdb4 mdadm --create /dev/md2 --level=1 --raid-devices=2 /dev/sda5 /dev/sdb5
This will take a while due to the size of the disk drives. The current progress can be seen by issuing the following command `cat /proc/mdstat`
Next is the preparation of the newly created md3 RAID 1 for LVM. First a physical volume is created on md3 and then a volume group called vg. This volume group then holds the logical volumes.
pvcreate /dev/md2 vgcreate vg /dev/md2 lvcreate -L10G -nportage vg lvcreate -L50G -ndistfiles vg lvcreate -L1T -ncustomer vg
The boot partition will have a simple ext2, where as all other partition will have an ext4 filesystem.
mkfs.ext2 /dev/md0 mkfs.ext4 /dev/md1 mkswap /dev/sda2 && mkswap /dev/sdb2 swapon -p 1 /dev/sda2 && swapon -p 1 /dev/sdb2 mkfs.ext2 -b 1024 -N 200000 /dev/vg/portage mkfs.ext2 -b 4096 -T largefile /dev/vg/distfiles mkfs.ext4 /dev/vg/customer
Now the preparations for the installation are done and I will post the install process in another post.
[…] preparing the system’s disks the operating system can now be installed. The best resource for installing Gentoo is the […]