``` suite=buster tgt=/mnt alias c="chroot $tgt"
fdisk -l /dev/sda mkfs.vfat /dev/sda1 mkfs.ext4 -M / -L Linux_Root /dev/sda2 mkfs.ext4 -M /var -L Linux_Var -E lazy_itable_init,lazy_journal_init /dev/sda3 mount /dev/sda2 $tgt mkdir $tgt/var mount /dev/sda3 $tgt/var
apt install debootstrap debootstrap --merged-usr $suite $tgt
mkdir $tgt/var/local/home $tgt/var/local/sys chmod -s $tgt/var/local/* chown :root $tgt/var/local/* mount --bind $tgt/var/local/home $tgt/home mount --bind $tgt/var/local/srv $tgt/srv
mount -t proc proc $tgt/proc mount -t sysfs sys $tgt/sys mount --bind /dev $tgt/dev mount -t devpts pts $tgt/dev/pts
c apt purge cron ifupdown isc-dhcp-client rsyslog tasksel tasksel-data vim-common vim-tiny whiptail xxd dialog+ echo HOSTNAME > $tgt/etc/hostname cat > $tgt/etc/fstab <<__EOF
/etc/fstab: static file system information.
#
Use 'blkid' to print the universally unique identifier for a
device; this may be used with UUID= as a more robust way to name devices
that works even if disks are added and removed. See fstab(5).
#
/dev/disk/by-label/Linux_Root / ext4 rw,errors=remount-ro,noatime 0 1 /dev/disk/by-label/Linux_Var /var ext4 defaults 0 2 /dev/disk/by-uuid/$(blkid -s UUID -o value /dev/sda1) /boot/efi vfat noauto,umask=0177 0 1
none /tmp tmpfs auto,nosuid,nodev 0 0 /var/local/home /home none bind,nosuid,nodev 0 0 /var/local/srv /srv none bind,nosuid,nodev 0 0 __EOF
c dpkg-reconfigure debconf cat > $tgt/etc/apt/sources.list <<_EOF deb http://deb.debian.org/debian $suite main contrib non-free deb http://deb.debian.org/debian-security $suite/updates main contrib non-free _EOF c apt update && c apt upgrade
c apt install firmware-realtek c apt install --no-install-recommends \ linux-image-amd64 firmware-linux-free fwupd-amd64-signed intel-microcode \ grub-efi-amd64 efibootmgr grub-efi-amd64-signed shim-signed \ zsh locales console-setup file xz-utils systemd-cron mkdir $tgt/run/dbus mount --bind /run/dbus $tgt/run/dbus rm $tgt/initrd.img* $tgt/vmlinuz*
mkdir $tgt/boot/efi c mount /boot/efi c grub-install /dev/sda1
c systemctl enable systemd-networkd c passwd c adduser ... c adduser ... sudo mkdir $tgt/var/log/journal
c apt install task-gnome-desktop task-german-desktop
umount -R $tgt ```
dd für Windows
Um ein Linux-Image unter Windows auf einen USB-Stick zu schreiben, gibt es Rufus. Dort kann man das Gerät und die Datei wählen und beim Schreiben muss man den DD-Modus wählen und dann wird das Image wie mit dd direkt auf den Stick geschrieben.