ok du nimmst btrfs,
unter Void und legst die subvolumes händisch an? hmm da ziehe ich meinen Hut und trau mir jetzt gar nichts dazu zu sagen,
ich bin da auch oft gescheitert bis ich die Schnau... voll hatte, dann habe ich mir ein script geschrieben das vor der Installation ausgeführt werden muss, (da darf noch nichts gemountet sein) und dann installiere ich es, ich kann dir jetzt nur die Schritte zeigen die ich dem Script machen las
https://codeberg.org/pinguin-tv/VCF…anch/main/btrfs
#!/bin/bash
set -e
if [[ $EUID -ne 0 ]]; then
echo "Bitte als root ausführen."
exit 1
fi
MNT="/mnt"
# Platte auswählen
echo "Gefundene Festplatten:"
lsblk -dno NAME,SIZE,MODEL | nl -w2 -s'. '
DISKS=($(lsblk -dno NAME))
NUM_DISKS=${#DISKS[@]}
if [[ $NUM_DISKS -eq 0 ]]; then
echo "Keine Festplatten gefunden."
exit 1
elif [[ $NUM_DISKS -eq 1 ]]; then
DISK=${DISKS[0]}
echo "Nur eine Platte gefunden, verwende: /dev/$DISK"
else
read -rp "Bitte Platte auswählen (Nummer 1-$NUM_DISKS): " DISKNUM
if ! [[ "$DISKNUM" =~ ^[0-9]+$ ]] || ((DISKNUM < 1 || DISKNUM > NUM_DISKS)); then
echo "Ungültige Auswahl."
exit 1
fi
DISK=${DISKS[$((DISKNUM-1))]}
fi
DEVICE="/dev/$DISK"
echo "Verwende Platte: $DEVICE"
# Partitionsschema
echo "Partitionsschema:"
echo " 1) UEFI (GPT + EFI)"
echo " 2) BIOS/Legacy (MBR)"
read -rp "Auswahl (1 oder 2): " PARTSCHEME
EFI_SIZE=0
if [[ "$PARTSCHEME" == "1" ]]; then
read -rp "Größe EFI-Partition in MB (z.B. 512): " EFI_SIZE
if ! [[ "$EFI_SIZE" =~ ^[0-9]+$ ]] || ((EFI_SIZE < 100)); then
echo "Ungültige EFI-Größe."
exit 1
fi
fi
# Swap auswählen
echo "Swap anlegen als:"
echo " 1) Swap-Partition"
echo " 2) Swap-Datei auf Btrfs"
echo " 3) Kein Swap"
read -rp "Auswahl (1, 2 oder 3): " SWAP_CHOICE
SWAP_SIZE=0
if [[ "$SWAP_CHOICE" != "3" ]]; then
read -rp "Swap-Größe in MB: " SWAP_SIZE
if ! [[ "$SWAP_SIZE" =~ ^[0-9]+$ ]] || ((SWAP_SIZE <= 0)); then
echo "Ungültige Swap-Größe."
exit 1
fi
fi
echo "Partitioniere $DEVICE ..."
if [[ "$PARTSCHEME" == "1" ]]; then
sgdisk --zap-all "$DEVICE"
sgdisk --clear "$DEVICE"
sgdisk --mbrtogpt "$DEVICE"
sgdisk --new=1:0:+${EFI_SIZE}M --typecode=1:ef00 --change-name=1:"EFI System" "$DEVICE"
if [[ "$SWAP_CHOICE" == "1" ]]; then
sgdisk --new=2:0:+${SWAP_SIZE}M --typecode=2:8200 --change-name=2:"Linux swap" "$DEVICE"
sgdisk --new=3:0:0 --typecode=3:8300 --change-name=3:"Btrfs root" "$DEVICE"
EFI_PART="${DEVICE}1"
SWAP_PART="${DEVICE}2"
BTRFS_PART="${DEVICE}3"
else
sgdisk --new=2:0:0 --typecode=2:8300 --change-name=2:"Btrfs root" "$DEVICE"
EFI_PART="${DEVICE}1"
SWAP_PART=""
BTRFS_PART="${DEVICE}2"
fi
else
dd if=/dev/zero of="$DEVICE" bs=512 count=2048 conv=fsync status=progress
(
echo o
echo n
echo p
echo 1
echo
if [[ "$SWAP_CHOICE" == "1" ]]; then
TOTAL_MB=$(($(blockdev --getsize64 "$DEVICE") / 1024 / 1024))
ROOT_END=$((TOTAL_MB - SWAP_SIZE - 1))
echo +${ROOT_END}M
else
echo
fi
echo t
echo 83
if [[ "$SWAP_CHOICE" == "1" ]]; then
echo n
echo p
echo 2
echo
echo +${SWAP_SIZE}M
echo t
echo 2
echo 82
fi
echo w
) | fdisk "$DEVICE"
sleep 2
ROOT_PART="${DEVICE}1"
if [[ "$SWAP_CHOICE" == "1" ]]; then
SWAP_PART="${DEVICE}2"
else
SWAP_PART=""
fi
fi
echo "Formatieren..."
if [[ "$PARTSCHEME" == "1" ]]; then
mkfs.fat -F32 "$EFI_PART"
fi
if [[ "$SWAP_CHOICE" == "1" && -n "$SWAP_PART" ]]; then
mkswap "$SWAP_PART"
fi
mkfs.btrfs -f "$BTRFS_PART"
mount "$BTRFS_PART" "$MNT"
btrfs subvolume create "$MNT/@" || true
btrfs subvolume create "$MNT/@home" || true
btrfs subvolume create "$MNT/@snapshot" || true
umount "$MNT"
mount -o subvol=@,compress=zstd "$BTRFS_PART" "$MNT"
mkdir -p "$MNT/home" "$MNT/.snapshots"
mount -o subvol=@home,compress=zstd "$BTRFS_PART" "$MNT/home"
mount -o subvol=@snapshot,compress=zstd "$BTRFS_PART" "$MNT/.snapshots"
if [[ "$PARTSCHEME" == "1" ]]; then
mkdir -p "$MNT/boot/efi"
mount "$EFI_PART" "$MNT/boot/efi"
fi
if [[ "$SWAP_CHOICE" == "2" ]]; then
echo "Erstelle Swap-Datei auf Btrfs..."
fallocate -l ${SWAP_SIZE}M "$MNT/swapfile"
chmod 600 "$MNT/swapfile"
chattr +C "$MNT/swapfile"
mkswap "$MNT/swapfile"
fi
UUID_BTRFS=$(blkid -s UUID -o value "$BTRFS_PART")
mkdir -p "$MNT/etc"
cat > "$MNT/etc/fstab" <<EOF
UUID=$UUID_BTRFS / btrfs rw,relatime,subvol=@,compress=zstd 0 1
UUID=$UUID_BTRFS /home btrfs rw,relatime,subvol=@home,compress=zstd 0 2
UUID=$UUID_BTRFS /.snapshots btrfs rw,relatime,subvol=@snapshot,compress=zstd 0 2
EOF
if [[ "$PARTSCHEME" == "1" ]]; then
UUID_EFI=$(blkid -s UUID -o value "$EFI_PART")
echo "UUID=$UUID_EFI /boot/efi vfat defaults 0 2" >> "$MNT/etc/fstab"
fi
if [[ "$SWAP_CHOICE" == "1" && -n "$SWAP_PART" ]]; then
UUID_SWAP=$(blkid -s UUID -o value "$SWAP_PART")
echo "UUID=$UUID_SWAP none swap sw 0 0" >> "$MNT/etc/fstab"
elif [[ "$SWAP_CHOICE" == "2" ]]; then
echo "/swapfile none swap sw 0 0" >> "$MNT/etc/fstab"
fi
# Snapshot mit Timestamp
TIMESTAMP=$(date +%Y%m%d_%H%M%S)
SNAP_NAME="@_timeshift_${TIMESTAMP}"
mount "$BTRFS_PART" "$MNT"
echo "Erstelle ersten Snapshot $SNAP_NAME"
btrfs subvolume snapshot "$MNT/@" "$MNT/$SNAP_NAME"
umount "$MNT"
# grub.cfg erstellen (minimal mit Snapshot und Standard)
GRUB_CFG="$MNT/boot/grub/grub.cfg"
mkdir -p "$(dirname "$GRUB_CFG")"
cat > "$GRUB_CFG" <<EOF
set default=0
set timeout=5
menuentry "Void Community Flavour Snapshot $SNAP_NAME" {
insmod btrfs
search --no-floppy --fs-uuid --set=root $UUID_BTRFS
linux /$SNAP_NAME/boot/vmlinuz-linux root=UUID=$UUID_BTRFS subvol=$SNAP_NAME rw quiet splash
initrd /$SNAP_NAME/boot/initramfs-linux.img
}
menuentry "Void Community Flavour" {
insmod btrfs
search --no-floppy --fs-uuid --set=root $UUID_BTRFS
linux /@/boot/vmlinuz-linux root=UUID=$UUID_BTRFS subvol=@ rw quiet splash
initrd /@/boot/initramfs-linux.img
}
EOF
# Locale & Zeitzone vorbereiten
cat > "$MNT/etc/locale.conf" <<EOF
LANG=de_DE.UTF-8
EOF
ln -sf /usr/share/zoneinfo/Europe/Berlin "$MNT/etc/localtime"
echo "Partitionierung, Subvolumes, Snapshot, fstab, grub.cfg, Locale und Zeitzone sind eingerichtet."
echo "Starte void-installer..."
void-installer
Alles anzeigen
ich habe mich für drei subvolumes entschieden, kannst du ja anpassen und in dem Script lasse ich Timeshift installieren und gleich einen snapshot erstellen und ins Grub-Menu schreiben, AAAAAAber ich bin noch am Testen, und bin für jede Hilfe Dankbar