ZFS setup notes

Posted on Sun 05 March 2017 in posts

install archiso

# sudo pacman -S archiso
# sudo -i or su root

create dir to hold arch live
# mkdir -p ~/archlive
# cp -r /usr/share/archiso/configs/releng/* ~/archlive

edit pacman.conf to add achzfs vim ~/archlive/pacman.conf

SigLevel = Optional TrustAll
Server = http://archzfs.com/$repo/x86_64

add archzfs-linux to ~/archlive/packages.x86_64

echo 'archzfs-linux' >> ~/archlive/packages.x86_64

build the image

cp -r archlive /tmp
cd /tmp/archlive/
mkdir out
./build.sh -v

use lsblk to find the usb device

dd bs=4M if=/tmp/archlive/out/archlinux-2017.03.05-dual.iso of=/dev/sdc
status=progress && sync

create an EFI partition on the usb using fdisk - create gpt partition table - create partition 512MB - set partition type as EFI (code 0 in fdisk)

create solaris root partition on other drives - create gpt partition table - create partition - change partition type to solaris root (47)

create zpool

zpool create -f -o ashift=12 vault mirror \
ata-st300d . . . . \
ata-st300d . . . . \
ata-st300d . . . . \
cache \
wwn-0x500 . . .\
wwn-0x500 . . . 

zpool status to check the status

systemctl enable zfs.target
systemctl enable zfs-import-cache.service

turn on compression
`zfs set compression=on vault`
`zfs set relatime=on vault`

create datasets ``` zfs create -o mountpoint=none vault/ROOT zfs create -o mountpoint=legacy vault/ROOT/default zfs create -o mountpoint=/home vault/home

create /tmp , /var and /usr dataset systemctl mask tmp.mount

unmount zfs zfs umount -a

zpool export vault
zpool import -d /dev/disk/by-id -R /mnt vault zfs umount /mnt/tmp zfs umount /mnt/home mount -t zfs vault/ROOT/default /mnt

mkdir /mnt/{boot,home,tmp,usr,var}

mount boot partition mount /dev/disk/by-partuuid/97aoydoiniiaei-ay-ai-y-i-a /mnt/boot

mount non-managed zfs mountpoints mount -t zfs vault/var /mnt/var mount -t zfs vault/usr /mnt/usr

mount ZFS managed mountpoints zfs mount vault/home zfs mount vault/tmp

set up mirrors

install the system pacstrap -i /mnt base base-devel

mkdir /mnt/etc/zfs cp /etc/zfs/zpool.cache /mnt/etc/zfs/zpool.cache

generate fstab and make sure /boot is mounted

edit mkinitcpio.conf and add hooks add archzfs to pacman.conf sign key

install zfs-linux pacman -S zfs-linux

go through normal install process

set up partition for boot drive update dotfiles for vimplut: