Skip to content

Instantly share code, notes, and snippets.

View MakiseKurisu's full-sized avatar

牧瀬紅莉栖 MakiseKurisu

View GitHub Profile
@MakiseKurisu
MakiseKurisu / proxmox_btrfs_raid1.sh
Last active July 26, 2023 10:48
Convert Proxmox VE over Btrfs to RAID-1 configuration
# Please follow https://gist.github.com/MakiseKurisu/3a44918bccf3383c0b5ccf362f429c8b first to set up rootfs
# Assuming rootfs on /dev/sdb2, and adding /dev/sda to the RAID-1 configuration
# Remove existing Proxmox installation and LVM Thin storage
pvesm remove local-lvm
vgremove pve -y
# Set up partition table
(echo g; echo n; echo ''; echo ''; echo '+512M'; echo t; echo 1; echo n; echo ''; echo ''; echo ''; echo w) | fdisk /dev/sda
@MakiseKurisu
MakiseKurisu / proxmox_raid1_recovery.sh
Last active February 14, 2020 23:38
Recover Proxmox VE RAID-1 configuration when one disk is replaced / readded
# TODO: Add ESP disk replacement
# Assuming the disk in problem is /dev/sdb, and we are running off /dev/sda in degraded mode.
# However, if both /dev/sda and /dev/sdb have been booted in degraded mode,
# then the next time when you boot with both disk present, initramfs will not be able to mount root in rw mode.
# In that case, you may have PERMANENT DATA LOSS if you are not careful, and MAKE BACKUPS of your current disks before any recovery.
# I HAVE NOT tried to recovery from such situation, as my plan is always recovery from existing backups.
# However, I'm more likely to recreate the system from scratch, as my data are stored in RAID and with multiple backups,
# so I only need to recreate my VM environment according to the script I'm writting on Gist. I love fresh system anyway.
@MakiseKurisu
MakiseKurisu / gist:1e16ef1448d66a56f3f9f07740010d35
Created February 11, 2021 16:18
Thinkpad W540 GPU passthrough
# Reference guides:
# https://pve.proxmox.com/wiki/PCI(e)_Passthrough
# https://elijahliedtke.medium.com/home-lab-guides-proxmox-6-pci-e-passthrough-with-nvidia-43ccfb9424de
# https://pve.proxmox.com/wiki/Install_Proxmox_VE_on_Debian_Buster
# Based on fresh Debian Buster install
# Remember to turn on SVM in BIOS and disable CSM
# Disable closing lid event
@MakiseKurisu
MakiseKurisu / deb.sh
Last active December 26, 2022 05:17
Install vanilla UEFI Debian for ESPRESSOBin
# You will need a real Debian machine to perform cross debootstrap
# Debian on WSL does not work
# Enter root mode
sudo -i
# Install dependency
apt update && apt install -y btrfs-progs dosfstools qemu-user-static debootstrap
# Set up partition table and file systems
@MakiseKurisu
MakiseKurisu / rock.sh
Last active July 5, 2022 19:36
Install vanilla UEFI Debian on Rock Pi 4B+
# You will need a real Debian machine to perform cross debootstrap
# Debian on WSL does not work
# Enter root mode
sudo -i
# Define variables
TARGET=/dev/mmcblk0
MOUNT_POINT=/mnt
IP_ADDRESS=192.168.0.2
@MakiseKurisu
MakiseKurisu / rpi3.sh
Last active November 18, 2021 14:33
Install vanilla UEFI Debian on Raspberry Pi 3
# You will need a real Debian machine to perform cross debootstrap
# Debian on WSL does not work
# Enter root mode
sudo -i
# Define variables
TARGET=/dev/mmcblk0
MOUNT_POINT=/mnt
IP_ADDRESS=192.168.0.2
@MakiseKurisu
MakiseKurisu / pimox.sh
Last active December 24, 2023 06:10
Install Pimox on Rock Pi 4B+
# You will need a real Debian machine to perform cross debootstrap
# Debian on WSL does not work
# Enter root mode
sudo -i
# Define variables
TARGET=/dev/mmcblk0
MOUNT_POINT=/mnt
IP_ADDRESS=192.168.0.2