mirror of https://github.com/bohanyang/debi
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
4.8 KiB
4.8 KiB
Debian Network Reinstall Script
Introduction
This script is written to reinstall a VPS/virtual machine to Debian 10 Buster.
Should Work On
Virtualization Platform
- SolusVM/OpenStack/DigitalOcean/Vultr/Linode/Proxmox/QEMU KVM (BIOS boot)
- Oracle Cloud Infrastructure (with
--force-efi-extra-removable; UEFI boot) - Google Cloud Compute Engine (manually set the VPC internal
--ip,--netmask,--gateway; UEFI boot) - AWS EC2 & Lightsail (BIOS boot)
- Hyper-V but not Azure! (Generation 1 BIOS boot & Generation 2 UEFI boot)
Original OS
- Debian 8/9/10
- Ubuntu 14.04/16.04/18.04/20.04
- CentOS 7/8
How It Works
- Generate a preseed file to automate installation
- Download the 'Debian-Installer' to the
/bootdirectory - Append a menu entry of the installer to the GRUB2 configuration file
Usage
curl -fLO https://raw.githubusercontent.com/bohanyang/debi/master/debi.sh && sudo bash debi.sh <OPTIONS>
Available Options
--ip <string>Static public/private IP, e.g.10.0.0.2--netmask <string>e.g.255.255.255.0/ffff:ffff:ffff:ffff::. Ignored if--ipis not specified--gateway <string>e.g.10.0.0.1. Ignored if--ipis not specified--dns '8.8.8.8 8.8.4.4'Quoted string where IP addresses are seperated by spaces. Ignored if--ipis not specified--hostname debian--network-consoleEnable the network console of the installer.ssh installer@ipto connect--suite buster--mirror-protocol httporhttpsorftp--httpsalias to--mirror-protocol https--mirror-host deb.debian.org--mirror-directory /debian--security-repository http://security.debian.org/debian-securityMagic value:'mirror' = <mirror-protocol>://<mirror-host>/<mirror-directory>/../debian-security--skip-account-setup--username debianNew user withsudoprivilege orroot--password <string>Password of the new user. You'll be prompted if you choose to not specify it here--authorized-keys-url <string>URL to your authorized keys for SSH authentication. e.g.https://github.com/torvalds.keys--sudo-with-passwordRequire password when the user invokessudocommand--timezone UTChttps://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List--ntp 0.debian.pool.ntp.org--skip-partitioning--disk <string>Manually select a disk for installation. Please remember to specify this when more than one disk is available! e.g./dev/sda--no-force-gptBy default, GPT rather than MBR partition table will be created. This option disables it.--biosDon't create EFI system partition. If GPT is being used, create a BIOS boot partition (bios_grubpartition). Default if/sys/firmware/efiis absent. See--efiCreate an EFI system partition. Default if/sys/firmware/efiexists--filesystem ext4--kernel <string>Choose an package for the kernel image--cloud-kernelChooselinux-image-cloud-amd64as the kernel image--no-install-recommends--install 'ca-certificates libpam-systemd'Additional packages to install. Quoted string where package names are seperated by spaces. Package names specified here will override the default list, rather than append to it--safe-upgrade(Default)apt upgrade --with-new-pkgs. See--full-upgradeapt dist-upgrade--no-upgrade--ethDisable Consistent Network Device Naming to get interface names like ethX back--bbrEnable TCP BBR congestion control--holdDon't reboot or power off after installation--power-offPower off after installation rather than reboot--architecture <string>e.g.amd64,i386,arm64,armhf, etc.--boot-partitionShould be used if/bootdirectory is mounted from a dedicated partition like a LVM setup--firmwareLoad additional non-free firmwares--force-efi-extra-removableSee. Useful on Oracle Cloud--grub-timeout 5How many seconds the GRUB menu shows before entering the installer--dry-runPrint generated preseed and GRUB entry without downloading the installer and actually saving them
Presets
--cdn
--mirror-protocol https--mirror-host deb.debian.org--security-repository mirror
--aws
--mirror-protocol https--mirror-host cdn-aws.deb.debian.org--security-repository mirror
--china
--dns '223.5.5.5 223.6.6.6'--mirror-protocol https--mirror-host mirrors.aliyun.com--security-repository mirror--ntp ntp.aliyun.com