You are not logged in.

#1 2016-06-25 18:19:55

ESPNSTI
Member
Registered: 2016-06-21
Posts: 11

[SOLVED] ZFS on Root, UEFI - "/sbin/init does not exist"

I wanted to share this in case someone else runs in to it, as it took me a while to figure it out.

After setting up ZFS on Root, I got this during boot:

:: running early hook [udev]
starting version 230
:: running hook [udev]
:: Triggering uevents...
:: running hook [zfs]
ash: 1: unknown operand
cannot open 'zpool': no such pool
ZFS: Importing pool zroot.
:: running late hook [zfs]
no pools available to import
:: running cleanup hook [udev]
ERROR: Root device mounted successfully, but /sbin/init does not exist.
Bailing out, you are on your own. Good luck.

sh: can't access tty: job control turned off

Turns out that in the UEFI boot entry, I had "zfs=zroot".
Changing it to "zfs=bootfs" fixed the problem.

The guide indicates either should work. I don't know why I tried "zfs=zroot" first as opposed to "zfs=bootfs".
https://wiki.archlinux.org/index.php/In … therboards

FYI, I know next to nothing about ZFS or Linux. The wiki guides were very helpful.
Here are the commands I used to get to that point:

# https://wiki.archlinux.org/index.php/Installing_Arch_Linux_on_ZFS

lsblk

gdisk
#n/1/enter/2M/EF02
#n/2/enter/+260M/EF00
#n/3/enter/enter/BF00
#w

#https://wiki.archlinux.org/index.php/Beginners%27_guide#UEFI.2FGPT_examples

mkfs.fat -F32 /dev/sda2

# http://archzfs.com/

dirmngr </dev/null
echo "[archzfs]" >> /etc/pacman.conf
echo "SigLevel = Required DatabaseOptional TrustedOnly" >> /etc/pacman.conf
echo "Server = http://demizerone.com/\$repo/\$arch" >> /etc/pacman.conf
pacman-key -r 0EE7A126
pacman-key --lsign-key 0EE7A126
pacman -Syy
pacman -S archzfs-archiso-linux

modprobe zfs

# https://wiki.archlinux.org/index.php/Installing_Arch_Linux_on_ZFS

zpool create -f zroot /dev/disk/by-id/<id-to-disk-part>

zfs create -o mountpoint=none zroot/data
zfs create -o mountpoint=none zroot/ROOT
zfs create -o mountpoint=/ zroot/ROOT/default
zfs create -o mountpoint=/home zroot/data/home

zfs umount -a

zfs set mountpoint=/ zroot/ROOT/default
zfs set mountpoint=legacy zroot/data/home

zpool set bootfs=zroot/ROOT/default zroot

zpool export zroot

zpool import -d /dev/disk/by-id -R /mnt zroot

df -h

mkdir /mnt/etc
mkdir /mnt/etc/zfs

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

mkdir /mnt/boot


#https://wiki.archlinux.org/index.php/Beginners%27_guide

timedatectl set-ntp true

pacstrap -i /mnt base base-devel

genfstab -U -p /mnt >> /mnt/etc/fstab

nano /mnt/etc/fstab 
#rem out zroot entries

arch-chroot /mnt /bin/bash

nano /etc/locale.gen
#uncomment en_US.UTF-8
locale-gen

nano /etc/locale.conf
#LANG=en_US.UTF-8

tzselect
ln -s /usr/share/zoneinfo/America/Chicago /etc/localtime
hwclock --systohc --utc

# https://wiki.archlinux.org/index.php/Installing_Arch_Linux_on_ZFS

echo "[archzfs]" >> /etc/pacman.conf
echo "SigLevel = Required DatabaseOptional TrustedOnly" >> /etc/pacman.conf
echo "Server = http://demizerone.com/\$repo/\$arch" >> /etc/pacman.conf
pacman-key -r 0EE7A126
pacman-key --lsign-key 0EE7A126
pacman -Syy
pacman -S zfs-linux

nano /etc/mkinitcpio.conf
# HOOKS="base udev autodetect modconf block keyboard zfs filesystems"

#https://wiki.archlinux.org/index.php/Beginners%27_guide
mkinitcpio -p linux

nano /etc/hostname
#<hostname>
nano /etc/hosts
# add <hostname>

ls /sys/class/net
systemctl enable dhcpcd@interface.service

passwd

exit

blkid /dev/sda3/ -o value -s U
efibootmgr -d /dev/sda -p 2 -c -L "Arch Linux" -l /vmlinuz-linux -u "root=PARTUUID=<uuid> zfs=bootfs spl.spl_hostid=0x<hostid> rw initrd=/initramfs-linux.img"

umount /mnt/boot
zfs umount -a
zpool export zroot

reboot

Offline

Board footer

Powered by FluxBB