set password for root w/ passwd

systemctl start sshd

grab ip and login to use real terminal

  

fdisk /dev/vda

first partition 1MiB biosboot

second partition 512MiB linux

third partition rest of type solaris root (55)

  

load zfs modules - modprobe zfs

  

# Create our rpool

zpool create -f -o ashift=12         \

             -O acltype=posixacl       \

             -O relatime=on            \

             -O xattr=sa               \

             -O dnodesize=legacy       \

             -O normalization=formD    \

             -O mountpoint=none        \

             -O canmount=off           \

             -O devices=off            \

             -O compression=lz4        \

             -R /mnt                   \

             rpool /dev/disk/by-partuuid/76c49f1f-e0bf-7848-91a2-4f87c85e9fca

  

# Create datasets

# General storage, including homes

zfs create -o mountpoint=none rpool/data

# root filesystem(s) goes here

zfs create -o mountpoint=none rpool/ROOT

zfs create -o mountpoint=/ -o canmount=noauto rpool/ROOT/default

zfs create -o mountpoint=/home rpool/data/home 

zfs create -o mountpoint=/root rpool/data/home/root

  

  

# Test exporting and importing our pool, ENSURE specifying partuuid 

zpool export rpool

zpool import -d /dev/disk/by-partuuid -R /mnt rpool -N # -N means don't mount any filesystems

  

zfs umount -a 

rm -rf /mnt/* (when we created filesystems, because of our root in zpool create, folders got made here)

zfs mount rpool/ROOT/default

zfs mount -a

  

#set bootfs so bootloader knows where to find os

zpool set bootfs=rpool/ROOT/default rpool

  

# Legacy boot, format and mount

mkfs.ext4 /dev/vda2

mkdir /mnt/boot

mount /dev/vda2 /mnt/boot

  

pacstrap /mnt base base-devel vim openssh dhclient sudo # note - explicitly NOT including linux, zfs-linux

  

genfstab -U -p /mnt >> /mnt/etc/fstab # edit, remove all but the /boot, swap if you have it

  

arch-chroot /mnt

  

passwd # set root password

useradd jonathan

zfs create rpool/data/home/jonathan

zfs mount rpool/data/home/jonathan

chown jonathan rpool/data/home/jonathan

chmod 700 rpool/data/home/jonathan

  

# fix repos to be date of last zfs-linux release

pacman -S archzfs-linux # this will prompt you to install linux, we're using mkinitcpio

  

# generate a hostid

zgenhostid $(hostid)

  

zpool set cachefile=/etc/zfs/zpool.cache rpool

  

vim /etc/mkinitcpio.conf, modify hooks - keyboard, zfs, filesystems

mkinitcpio -p linux # note zfs hook now gets built

  

pacman -S grub

  

grub-install --target=i386-pc /dev/vda

  

grub-mkconfig -o /boot/grub/grub.cfg

  

ZPOOL_VDEV_NAME_PATH=1 grub-mkconfig -o /boot/grub/grub.cfg

systemctl enable zfs.target

systemctl enable zfs-import-cache

systemctl enable zfs-mount

systemctl enable zfs-import.target

  

exit

umount /mnt/boot

zfs umount -a

zpool export rpool

reboot