###### Ubuntu Update Repos
deb http://archive.ubuntu.com/ubuntu/ noble-security main universe multiverse restricted
deb http://archive.ubuntu.com/ubuntu/ noble-updates main universe multiverse restricted
-deb http://archive.ubuntu.com/ubuntu/ noble-backports main universe restricted
+deb http://archive.ubuntu.com/ubuntu/ noble-backports main universe multiverse restricted
deb-src http://archive.ubuntu.com/ubuntu/ noble-security main universe multiverse restricted
deb-src http://archive.ubuntu.com/ubuntu/ noble-updates main universe multiverse restricted
-deb-src http://archive.ubuntu.com/ubuntu/ noble-backports main universe restricted
+deb-src http://archive.ubuntu.com/ubuntu/ noble-backports main universe multiverse restricted
bpart() { # btrfs a partition
case $raid_level in
- 0) mkfs.btrfs -f $@ ;;
+ 0) mkfs.btrfs -f $raid_metadata_arg $@ ;;
*) mkfs.btrfs -f -m raid$raid_level -d raid$raid_level $@ ;;
esac
}
/dev/mapper/crypt_dev_ata-ST6000DM001-1XY17Z_Z4D29EBL-part1 /mnt/rust2 btrfs nofail,$fstabstd,noatime,compress=zstd,subvolid=0 0 0
EOF
fi
- fi
fi
+fi
}
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
+fi
+
declare -A disk_excludes
if ! $mkroot2 && ! $mkroot2tab && ! $mktab ! ifclass USE_MOUNTED; then
## ignore disks that are mounted, eg when running from fai-cd
first_boot_dev=${boot_devs[0]}
even_raid=false
-if ifclass RAID0 || (( ${#boot_devs[@]} == 1 )); then
+if (( ${#boot_devs[@]} == 1 )); then
raid_level=0
raid_duplication=1
+elif ifclass RAID0; then
+ raid_level=0
+ if (( ${#boot_devs[@]} >= 3 )); then
+ # Default is raid1 metadata for >=2 devices, but metadata is <.5%
+ # data use, so lets increase that redundancy.
+ raid_metadata_arg="-m raid1c3"
+ fi
elif ifclass RAID1 || (( ${#boot_devs[@]} == 2 )); then
if (( ${#boot_devs[@]} == 2 )); then
even_raid=true
+# DEBIAN.gpg was originally just:
+# pub rsa4096/2BF8D9FE074BCDE4 2013-07-30 [SC]
+# B11EE3273F6B2DEB528C93DA2BF8D9FE074BCDE4
+# uid [ unknown] Thomas Lange <lange@informatik.uni-koeln.de>
+# uid [ unknown] Thomas Lange <lange@debian.org>
+# sub rsa4096/3EE0AA36517A03DA 2013-07-30 [E]
+#
+# I added all the keys from a bookworm chroot etc/apt/trusted.gpg.d/*, which are the generated distro keys from debian 10-12 by importing them then exporting with
+# gpg --export debian-release@lists.debian.org ftpmaster@debian.org lange@debian.org >DEBIAN.gpg
+
+
# otherwise sshd takes like 10 seconds to start.
# not sure if this applies to bullseye or just buster, installing it so i dun have to worry.
PACKAGES install BUSTER BULLSEYE BOOKWORM