-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Encryption #6
Comments
This would require an updated zfs version like 0.8.4. I've customized the script to install zfs 0.8.4 and the machine boots okay. The only challenge is grub breaks when an encrypted dataset is created. |
#!/bin/bash -e debian-buster-zfs-root.shInstall Debian GNU/Linux 10 Buster to a native ZFS root filesystem(C) 2018-2020 Hajo Noerenberghttp://www.noerenberg.de/https://github.com/hn/debian-buster-zfs-rootThis program is free software: you can redistribute it and/or modifyit under the terms of the GNU General Public License version 3.0 aspublished by the Free Software Foundation.This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See theGNU General Public License for more details.You should have received a copy of the GNU General Public License alongwith this program. If not, see http://www.gnu.org/licenses/gpl-3.0.txt.Static settings, overridable by TARGET_* environment variablesZPOOL=${TARGET_ZPOOL:-rpool} PARTBIOS=${TARGET_PARTBIOS:-1} SIZESWAP=${TARGET_SIZESWAP:-2G} NEWHOST=${TARGET_HOSTNAME} User settingsdeclare -A BYID for DISK in $(lsblk -I8,254,259 -dn -o name); do TMPFILE=$(mktemp) if [ $? -ne 0 ]; then while read -r DISK; do whiptail --backtitle "$0" --title "RAID level selection" --separate-output if [ $? -ne 0 ]; then RAIDLEVEL=$(head -n1 "$TMPFILE" | tr '[:upper:]' '[:lower:]') case "$RAIDLEVEL" in GRUBPKG=grub-pc
fi whiptail --backtitle "$0" --title "Confirmation" if [ $? -ne 0 ]; then Start the real workhttps://bugs.debian.org/cgi-bin/bugreport.cgi?bug=595790if [ "$(hostid | cut -b-6)" == "007f01" ]; then DEBRELEASE=$(head -n1 /etc/debian_version) modprobe zfs for DISK in "${DISKS[@]}"; do
done sleep 2 zpool create -f -o ashift=12 -o altroot=/target -O atime=off -O mountpoint=none $ZPOOL $RAIDDEF zfs set compression=lz4 $ZPOOL The two properties below improve performance but reduce compatibility with non-Linux ZFS implementationsCommented out by default#zfs set xattr=sa $ZPOOL zfs create $ZPOOL/ROOT zfs create -o mountpoint=/tmp -o setuid=off -o exec=off -o devices=off -o com.sun:auto-snapshot=false -o quota=$SIZETMP $ZPOOL/tmp /var needs to be mounted via fstab, the ZFS mount script runs too late during bootzfs create -o mountpoint=legacy $ZPOOL/var /var/tmp needs to be mounted via fstab, the ZFS mount script runs too late during bootzfs create -o mountpoint=legacy -o com.sun:auto-snapshot=false -o quota=$SIZEVARTMP $ZPOOL/var/tmp zfs create -V sometimes needed to wait for /dev/zvol/$ZPOOL/swap to appearsleep 2 zpool status debootstrap --include=openssh-server,locales,linux-headers-amd64,linux-image-amd64,joe,rsync,sharutils,psmisc,htop,patch,less --components main,contrib,non-free $TARGETDIST /target http://deb.debian.org/debian/ test -n "$NEWHOST" || NEWHOST=debian-$(hostid) Copy hostid as the target system will otherwise not be able to mount the misleadingly foreign file systemcp -va /etc/hostid /target/etc/ cat << EOF >/target/etc/fstab /etc/fstab: static file system information.Use 'blkid' to print the universally unique identifier for adevice; this may be used with UUID= as a more robust way to name devicesthat works even if disks are added and removed. See fstab(5)./dev/zvol/$ZPOOL/swap none swap defaults 0 0 mount --rbind /dev /target/dev perl -i -pe 's/# (en_US.UTF-8)/$1/' /target/etc/locale.gen chroot /target /usr/bin/apt-get install --yes grub2-common if [ "${GRUBPKG:0:8}" == "grub-efi" ]; then
fi if [ -d /proc/acpi ]; then ETHDEV=$(udevadm info -e | grep "ID_NET_NAME_ONBOARD=" | head -n1 | cut -d= -f2) chroot /target /usr/bin/passwd sync #zfs umount -a chroot /target /bin/bash --loginzpool import -R /target rpool |
Hi @Amplificator I just found another install script that can help you install with encryption. It doesn't even have any issues with UEFI boot. Check it out here: https://github.com/HankB/Linux_ZFS_Root |
Can encryption be enabled so a password is required at boot?
The text was updated successfully, but these errors were encountered: