From: Ian Kelling Date: Sat, 28 Feb 2026 14:59:27 +0000 (-0500) Subject: minor improvements X-Git-Url: https://iankelling.org/git/?a=commitdiff_plain;h=510b388ff75b73e2fbacbbeaf2036f9c8a3c5010;p=automated-distro-installer minor improvements --- diff --git a/fai/config/hooks/partition.DEFAULT b/fai/config/hooks/partition.DEFAULT index 6af8d38..522285f 100755 --- a/fai/config/hooks/partition.DEFAULT +++ b/fai/config/hooks/partition.DEFAULT @@ -325,6 +325,7 @@ dev-mib() { luks-setup() { local luksdev="$1" local cryptname="$2" + local sector_arg # when we move to newer than trisquel 9, we can remove --type # luks1. We can also check on cryptsetup --help | less /compil to see # about the other settings. Default in debian 9 is luks2. You can @@ -332,7 +333,17 @@ luks-setup() { # luksAddKey --pbkdf pbkdf2 then remove the new format keys with # cryptsetup luksRemoveKey then cryptsetup convert DEV --type luks1, # then readd old keys and remove temp. - yes YES | cryptsetup luksFormat $luksdev $luks_file || [[ $? == 141 ]] + + # per https://cdn.kernel.org/pub/linux/utils/cryptsetup/v2.8/v2.8.0-ReleaseNotes + # and + # https://wiki.archlinux.org/title/Advanced_Format#NVMe_solid_state_drives + # and if sector arg was not given, that can be fixed. First, check that it is 1mib aligned, + # eg. parted -m /dev/mapper/crypt-vgnvme-WD_BLACK_SN850X_8000GB_245244802091-root unit MiB print + # Then cryptsetup reencrypt --sector-size 4096 device + if [[ $luksdev == *nvme* ]]; then + sector_arg="--sector-size 4096" + fi + yes YES | cryptsetup luksFormat $sector_arg $luksdev $luks_file || [[ $? == 141 ]] yes "$lukspw" | \ cryptsetup luksAddKey --key-file $luks_file \ $luksdev || [[ $? == 141 ]] @@ -370,7 +381,7 @@ EOF if $data_part; then vg=${vgs[0]} cat >/tmp/fai/crypttab </tmp/fai/fstab <>$target_etc/crypttab <> $target_etc/fstab < 2)); then - mopts=,compress=zstd + mopts+=,compress=zstd fi -# Use conservative btrfs mount settings for single disk x200. I got this -# error below on intel drive and I had several errors on a crucial -# enterprise drive after sudden power off due to low battery. -# -# nodiscard based on -# https://lore.kernel.org/linux-btrfs/d76a88d8-4262-4db4-88fd-d230139a98e0@gmx.com/ -# -# flushoncommit based on the man page info it sounds sensible. -# -# Nov 25 07:28:04 x3 kernel: BTRFS error (device dm-4): bad tree block start, mirror 1 want 358059982848 have 12696086966779840503 -# Nov 25 07:28:04 x3 kernel: BTRFS error (device dm-4 state A): Transaction aborted (error -5) -# Nov 25 07:28:04 x3 kernel: BTRFS: error (device dm-4 state A) in btrfs_drop_snapshot:6162: errno=-5 IO failure -# -# -# smartctl -a /dev/sda -# .... -# Model Family: Intel S4510/S4610/S4500/S4600 Series SSDs -# Device Model: INTEL SSDSC2KB038T7 -# Firmware Version: SCV10150 - if [[ $HOSTNAME == x[23] ]]; then - mopts=,nodiscard,flushoncommit mopts_o=$mopts,compress=zstd else mopts_o=$mopts