Skip to content

Instantly share code, notes, and snippets.

@smartbit
smartbit / Fedora UEFI GRUB Restore Guide (for BTRFS LUKS after Windows Install).md
Last active October 21, 2025 16:24
Fedora UEFI GRUB Restore Guide (for BTRFS/LUKS after Windows Install)

Purpose

This script automates the process of restoring the Fedora GRUB bootloader on a UEFI system after it has been removed or overwritten, typically by a Windows installation.

It is designed for a common Fedora setup: a LUKS-encrypted BTRFS root partition and a separate /boot partition. The script performs the following actions:

  1. Prompts for the LUKS encryption password to unlock the Fedora system partition.
  2. Correctly mounts the BTRFS root subvolume, the /boot partition, and the EFI System Partition (ESP).
  3. Binds the necessary system directories from the live environment.
  4. Executes a chroot command to run commands inside the installed Fedora system.
@smartbit
smartbit / copy-from-time-machine.sh
Created September 21, 2017 11:45 — forked from magicoli/copy-from-time-machine.sh
Copy data from a Time Machine volume mounted on a Linux box.
#!/bin/bash
#
# Copy data from a Time Machine volume mounted on a Linux box.
#
# Usage: copy-from-time-machine.sh <source> <target>
#
# source: the source directory inside a time machine backup
# target: the target directory in which to copy the reconstructed
# directory trees. Created if it does not exists.
#