Points of departure:
gpg --recv-keys 0xBB572E0E2D182910 gpg --verify install-amd64-minimal-20141204.iso.DIGESTS.asc
grep -A 1 -i sha512 install-amd64-minimal-20141204.iso.DIGESTS.asc sha512sum install-amd64-minimal-20141204.iso.DIGESTS.asc #or openssl dgst -sha512 install-amd64-minimal-20141204.iso
boot: gentoo
dhcpcd enp4s0
# passwd # useradd -m -G users,wheel john # passwd john # /etc/init.d/sshd start
gdisk /dev/sda o #create empty new GUID partition table. n #add new partition. 1 #partition number 1. 2048 #default first sector. +2MiB #BIOS boot partition size. ef02 #partition type. n #add new partition. 2 #partition number 2. <default> #default next sector. +2GiB #SWAP partition size. 8200 #partition type. n #add new partition. 3 #partition number 3. <default> #default next sector. <default> #Rest of disk. 8300 #partition type. w #write changes and exit.
gdisk /dev/sdb o #create empty new GUID partition table. n #add new partition. 1 #partition number 1. 2048 #default first sector. +2MiB #BIOS boot partition size. ef02 #partition type. n #add new partition. 2 #partition number 2. <default> #default next sector. <default> #Rest of disk. 8300 #partition type. w #write changes and exit.
# mkfs.btrfs -L btrfsmirror -m raid1 -d raid1 /dev/sda3 /dev/sdb2 WARNING! - Btrfs v3.14.2 IS EXPERIMENTAL WARNING! - see http://btrfs.wiki.kernel.org before using Performing full device TRIM (57.62GiB) ... Turning ON incompat feature 'extref': increased hardlink limit per file to 65536 Performing full device TRIM (59.62GiB) ... adding device /dev/sdb2 id 2 fs created label SSDRAID1 on /dev/sda3 nodesize 16384 leafsize 16384 sectorsize 4096 size 117.25GiB Btrfs v3.14.2
# btrfs filesystem show Label: 'SSDRAID1' uuid: 3a69524a-97d1-4255-ab39-9ebf206f3f61 Total devices 2 FS bytes used 112.00KiB devid 1 size 57.62GiB used 2.03GiB path /dev/sda3 devid 2 size 59.62GiB used 2.01GiB path /dev/sdb2 Btrfs v3.14.2
LABEL=btrfsmirror /mnt/gentoo btrfs defaults,noatime 0 0 LABEL=btrfsmirror /mnt/gentoo/root btrfs defaults,noatime,compress=lzo,autodefrag,subvol=root 0 0
# mount /mnt/gentoo
btrfs subvolume create /mnt/gentoo/root btrfs subvolume create /mnt/gentoo/root/home btrfs subvolume create /mnt/gentoo/root/var
# btrfs subvolume list /mnt/gentoo/ ID 258 gen 9 top level 5 path root ID 259 gen 8 top level 258 path root/home ID 260 gen 9 top level 258 path root/var # btrfs fi df /mnt/gentoo Data, RAID1: total=1.00GiB, used=512.00KiB Data, single: total=8.00MiB, used=0.00 System, RAID1: total=8.00MiB, used=16.00KiB System, single: total=4.00MiB, used=0.00 Metadata, RAID1: total=1.00GiB, used=160.00KiB Metadata, single: total=8.00MiB, used=0.00 unknown, single: total=16.00MiB, used=0.00
# date Thu Dec 18 19:56:19 UTC 2014 # date [MMDDhhmm[[CC]YY][.ss]] #or ntpdate ntp1.polaire.nl
# cd /mnt/gentoo/root # links http://www.gentoo.org/main/en/mirrors.xml stage3-amd64-20141204.tar.bz2.CONTENTS stage3-amd64-20141204.tar.bz2.DIGESTS stage3-amd64-20141204.tar.bz2.DIGESTS.asc
# openssl dgst -r -sha512 stage3-amd64-<release>.tar.bz2
# gpg --recv-keys 0xBB572E0E2D182910 # gpg --verify stage3-amd64-20141204.tar.bz2.DIGESTS.asc
# tar xvjpf stage3-*.tar.bz2
# vi /mnt/gentoo/root/etc/portage/make.conf CFLAGS="-march=native -O2 -pipe" CXXFLAGS="${CFLAGS}" MAKEOPTS="-j5" USE="bindist mmx sse sse2 systemd -consolekit"
# mirrorselect -i -o >> /mnt/gentoo/root/etc/portage/make.conf # mirrorselect -i -r -o >> /mnt/gentoo/root/etc/portage/make.conf
# cp -L /etc/resolv.conf /mnt/gentoo/root/etc/
# mount -t proc proc /mnt/gentoo/root/proc # mount --rbind /sys /mnt/gentoo/root/sys # mount --rbind /dev /mnt/gentoo/root/dev
# chroot /mnt/gentoo/root /bin/bash # source /etc/profile # export PS1="(chroot) $PS1"
# emerge-webrsync
# emerge --sync --quiet
# eselect profile list # eselect profile set <num>
# ln -sf /proc/self/mounts /etc/mtab
# emerge -avDN @world
# emerge --ask vim
# echo "Europe/Amsterdam" > /etc/timezone
# emerge --config sys-libs/timezone-data
# vi /etc/locale.gen en_US ISO-8859-1 en_US.UTF-8 UTF-8 # locale-gen # locale -a
# eselect locale list # eselect locale set <num>
# env-update && source /etc/profile
# emerge --ask sys-kernel/gentoo-sources
# emerge --ask sys-apps/pciutils
# cd /usr/src/linux # make menuconfig CONFIG_AUTOFS4_FS CONFIG_CGROUPS CONFIG_FANOTIFY ##BTRFS General setup ---> [*] Initial RAM filesystem and RAM disk (initramfs/initrd) support File systems ---> <*> Btrfs filesystem support [*] Btrfs POSIX Access Control Lists ##SystemD Gentoo Linux ---> Support for init systems, system and service managers ---> [*] systemd ##devtmpfs Device Drivers ---> Generic Driver Options ---> -*- Maintain a devtmpfs filesystem to mount at /dev [*] Automount devtmpfs at /dev, after the kernel mounted the rootf
make -j5 && make modules_install make install
# emerge genkernel # genkernel --install initramfs # ls /boot/initramfs*
# mkswap /dev/sda2 Setting up swapspace version 1, size = 2097148 KiB no label, UUID=6de68c5a-1c90-4b25-b019-00def47e6c35
LABEL=btrfsmirror / btrfs defaults,noatime,compress=lzo,autodefrag,subvol=root 0 0 UUID="6de68c5a-1c90-4b25-b019-00def47e6c35" none swap sw 0 0
# vi /etc/conf.d/hostname # vi /etc/conf.d/net dns_domain_lo="homenetwork" config_enp4s0="dhcp" # emerge --ask --noreplace net-misc/netifrc
127.0.0.1 tux.homenetwork tux localhost
passwd
# emerge --ask virtual/mailx # emerge --config =mail-mta/nullmailer-1.13-r4
# emerge --ask app-admin/logrotate
# emerge --ask app-admin/syslog-ng # systemctl enable syslog-ng.service
# emerge --ask sys-process/cronie # systemctl enable cronie.service
# emerge --ask sys-apps/mlocate
# emerge --ask net-misc/dhcpcd
# vi /etc/portage/package.use sys-boot/grub:2 device-mapper # emerge --ask sys-boot/grub # vi /etc/default/grub # Append parameters to the linux kernel command line GRUB_CMDLINE_LINUX="rootfstype=btrfs rootflags=device=/dev/sda3,device=/dev/sdb2,subvol=root init=/usr/lib/systemd/systemd"
# grub2-install /dev/sda # grub2-install /dev/sdb
# grub2-mkconfig -o /boot/grub/grub.cfg
exit
umount -l /mnt/gentoo/dev{/shm,/pts,} umount /mnt/gentoo{/boot,/sys,/proc,} reboot