Moin
ich denke mal hier passt rein
Ich wollte mal irgendwann debian 13 auf zroot installieren, bin dann aber davon abgekommen warum auch immer
naja auf jedenfall hab ich mir diese Anleitung dazu erstellt, angepasst an eine VM laeuft sie nicht, auf dem Laptop laeuft es hab hier aber noch Probleme
Leider find ich die Original Anleitung nicht mehr wo man mal nachschauen kann wo der fehler liegt oder das so gemacht wurde und ich selbst bin zu doof dafuer
Code:
sudo -i
dmesg | grep -i efivars
ip a
apt update && apt install -y openssh-server
passwd user
Login Terminal ssh
sudo -i
apt install -y console-data
dpkg-reconfigure keyboard-configuration
setupcon
nano /etc/apt/sources.list
deb http://deb.debian.org/debian trixie main contrib non-free non-free-firmware
deb-src http://deb.debian.org/debian trixie main contrib non-free non-free-firmware
deb http://deb.debian.org/debian-security/ trixie-security main contrib non-free non-free-firmware
deb [trusted=yes] file:/run/live/medium trixie main non-free-firmware
apt update
apt install --yes linux-headers-$(uname -r)
apt install -y debootstrap gdisk parted zfs-dkms zfs-zed zfsutils-linux systemd-timesyncd
timedatectl set-ntp true
modprobe zfs && zfs version
. /etc/os-release
export ID
zgenhostid -f "0x$( date +%s | cut -c1-8 )"
lsblk -f
export DISK="/dev/nvme0n1"
export BOOT_PART="1"
export SWAP_PART="2"
export POOL_PART="3"
export BOOT_DEVICE="${DISK}p${BOOT_PART}"
export SWAP_DEVICE="${DISK}p${SWAP_PART}"
export POOL_DEVICE="${DISK}p${POOL_PART}"
wipefs -a $DISK
sgdisk --zap-all --clear $DISK
partprobe $DISK && sgdisk -p $DISK
sgdisk --list-types
sgdisk -n "${BOOT_PART}:1m:+1g" -t "${BOOT_PART}:ef00" -c 0:esp $DISK
sgdisk -n "${SWAP_PART}:0:+8g" -t "${SWAP_PART}:8200" -c 0:swap $DISK
sgdisk -n "${POOL_PART}:0:-10m" -t "${POOL_PART}:bf00" -c 0:pool $DISK
partprobe $DISK && sgdisk -p $DISK
echo 'passphrase' > /etc/zfs/zroot.key
chmod 000 /etc/zfs/zroot.key
export POOL_ID=/dev/disk/by-partuuid/$( lsblk -o PATH,PARTUUID | grep $POOL_DEVICE | awk '{ print $NF }' )
zpool create \
-o ashift=12 \
-o autotrim=on \
-O encryption=on -O keylocation=prompt -O keyformat=passphrase \
-O acltype=posixacl -O xattr=sa -O dnodesize=auto \
-O compression=lz4 \
-O relatime=on \
-O canmount=off \
-O mountpoint=/ \
-O keylocation=file:///etc/zfs/zroot.key \
-R /mnt \
rpool-lp01 $POOL_ID
zfs create -o canmount=noauto -o mountpoint=/ rpool-lp01/ROOT/${ID}
zfs mount rpool-lp01/ROOT
zfs create rpool-lp01/home
zfs create -o mountpoint=/root rpool-lp01/home/root
chmod 700 /mnt/root
zfs create -o canmount=off rpool-lp01/var
zfs create rpool-lp01/var/log
zfs create -o canmount=off rpool-lp01/usr
zfs create rpool-lp01/usr/local
zfs create rpool-lp01/var/games
zfs create rpool-lp01/var/lib/AccountsService
zfs create rpool-lp01/var/lib/NetworkManager
zpool set bootfs=rpool-lp01/ROOT/${ID} rpool-lp01
zpool export rpool-lp01
zpool import -N -R /mnt rpool-lp01
zfs load-key -L prompt rpool-lp01
zfs mount rpool-lp01/ROOT/${ID}
zfs mount rpool-lp01/home
mount -t zfs
udevadm trigger
debootstrap trixie /mnt
cp /etc/hostid /mnt/etc/
cp /etc/resolv.conf /mnt/etc/
mkdir /mnt/etc/zfs
cp /etc/zfs/zroot.key /mnt/etc/zfs/
mount -t proc proc /mnt/proc
mount -t sysfs sys /mnt/sys
mount -B /dev /mnt/dev
mount -t devpts pts /mnt/dev/pts
chroot /mnt /bin/bash
passwd
echo lp01 > /etc/hostname
cat <<EOF > /etc/hosts
127.0.0.1 localhost
127.0.1.1 lp01 lp01.lan
EOF
nano /etc/apt/sources.list
deb http://deb.debian.org/debian trixie main contrib non-free-firmware
deb-src http://deb.debian.org/debian trixie main contrib non-free-firmware
deb http://deb.debian.org/debian-security trixie-security main contrib non-free-firmware
deb-src http://deb.debian.org/debian-security trixie-security main contrib non-free-firmware
deb http://deb.debian.org/debian trixie-updates main contrib non-free-firmware
deb-src http://deb.debian.org/debian trixie-updates main contrib non-free-firmware
apt update
apt install -y linux-image-amd64 linux-headers-amd64 zfs-initramfs console-setup curl dosfstools efibootmgr locales firmware-linux network-manager cryptsetup firmware-iwlwifi
echo "REMAKE_INITRD=yes" > /etc/dkms/zfs.conf
dpkg-reconfigure locales
echo "UMASK=0077" > /etc/initramfs-tools/conf.d/umask.conf
update-initramfs -u -k all
systemctl enable zfs.target
systemctl enable zfs-import-cache
systemctl enable zfs-mount
systemctl enable zfs-import.target
mkfs.vfat -F32 $BOOT_DEVICE
echo "PARTLABEL=esp /boot/efi vfat defaults 0 0" >> /etc/fstab
mkdir -p /boot/efi
mount /boot/efi
zfs set org.zfsbootmenu:commandline="quiet" rpool-lp01/ROOT
zfs set org.zfsbootmenu:keysource="zroot/ROOT/${ID}" rpool-lp01
mkdir -p /boot/efi/EFI/ZBM
curl -o /boot/efi/EFI/ZBM/VMLINUZ.EFI -L https://get.zfsbootmenu.org/efi
cp /boot/efi/EFI/ZBM/VMLINUZ.EFI /boot/efi/EFI/ZBM/VMLINUZ-BACKUP.EFI
mount -t efivarfs efivarfs /sys/firmware/efi/efivars
efibootmgr -c -d "$DISK" -p "$BOOT_PART" -L "ZFSBootMenu (Backup)" -l '\EFI\ZBM\VMLINUZ-BACKUP.EFI'
efibootmgr -c -d "$DISK" -p "$BOOT_PART" -L "ZFSBootMenu" -l '\EFI\ZBM\VMLINUZ.EFI'
adduser username
dpkg-reconfigure tzdata
dpkg-reconfigure console-setup
setupcon
dpkg-reconfigure keyboard-configuration
echo "swap PARTLABEL=swap /dev/urandom swap,offset=2048,cipher=aes-xts-plain64,size=512" >> /etc/crypttab
echo "/dev/mapper/swap none swap defaults 0 0" >> /etc/fstab
useradd -m -G wheel -s /bin/bash username
passwd username
echo "%wheel ALL=(ALL:ALL) ALL" >> /etc/sudoers
exit
umount -l -n -R /mnt
zpool export rpool-lp01
reboot
zu den Problemen
auf dem Laptop hab ich ein Doppellogin fuer die Festplatte, ist die jetzt zweimal verschluesselt durch cryptsetup und ZFS?
wenn ich die Swap ueber die Anleitung erstelle braucht er ewig lang zum booten und wird als swappoff angezeigt, erstelle ich sie hinter gehts ratsfatz
Wenn ich
zfs create rpool-lp01/var/lib/AccountsService
zfs create rpool-lp01/var/lib/NetworkManager
bekomm ich die Fehlermeldung "parents are dont exist" hab aber keine ahnung warum
irgendwo ist da noch der wurm drin :-/