{"id":15163095,"url":"https://github.com/treesgreens/debian-btrfs","last_synced_at":"2026-02-01T22:02:50.355Z","repository":{"id":246184948,"uuid":"820348470","full_name":"treesgreens/debian-btrfs","owner":"treesgreens","description":"Debian testing install on luks with btrfs subvolumes and encrypted swap. Debian Astro.","archived":false,"fork":false,"pushed_at":"2024-06-26T20:15:46.000Z","size":315,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-23T19:06:06.945Z","etag":null,"topics":["btrfs","btrfs-snapshots","btrfs-subvolume","debian","debian-astro","luks","luks2","testing","trixie"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/treesgreens.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-26T09:40:43.000Z","updated_at":"2024-06-26T20:15:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"d9b7d58a-5718-413a-a502-9801e15466e0","html_url":"https://github.com/treesgreens/debian-btrfs","commit_stats":{"total_commits":40,"total_committers":1,"mean_commits":40.0,"dds":0.0,"last_synced_commit":"3b4aa549ddd7a7a9d417fefd413dbc04027d16f3"},"previous_names":["treesgreens/debian-btrfs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/treesgreens/debian-btrfs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treesgreens%2Fdebian-btrfs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treesgreens%2Fdebian-btrfs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treesgreens%2Fdebian-btrfs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treesgreens%2Fdebian-btrfs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/treesgreens","download_url":"https://codeload.github.com/treesgreens/debian-btrfs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treesgreens%2Fdebian-btrfs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28992655,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T22:01:47.507Z","status":"ssl_error","status_checked_at":"2026-02-01T21:58:37.335Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["btrfs","btrfs-snapshots","btrfs-subvolume","debian","debian-astro","luks","luks2","testing","trixie"],"created_at":"2024-09-27T02:03:59.046Z","updated_at":"2026-02-01T22:02:50.338Z","avatar_url":"https://github.com/treesgreens.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"w\u003cp align=\"center\"\u003e\u003cimg src=debian-logo.png width=\"300\"\u003e\u003c/p\u003e\u003cbr\u003e\n\nManually install Debian trixie/testing with LUKS2 and BTRFS with subvolumes and Encrypted Swap: \n\n - EFI Boot Partition\n - LUKS2 Swap Partition\n - LUKS2 Container\n - BTRFS Partition\n - 2 BTRFS Subvolumes\n\n# Debian installation (debootstrap)\n\n## Pre-installation setup\n\nBoot from latested stable or testing release of Debian/Gentoo LiveISO. I personally used a working Gentoo Environment.\n\nInstalled needed packages\n\n    apt install debbootstrap cryptsetup\nOn Gentoo\n````\nsudo emerge -av debootstrap cryptsetup\n````\n\n## Partitions\n\n### Creating partitions\n\nPerform formatting and partitioning with cfdisk. \n````\ncfdisk /dev/nvme0n1\n````\n - create a new partition 2G or more. Change type to EFI System.\n - create a new partition 8G or more. Leave type as Linux.\n - Create a new partition 100%FREE. Use remainder of drive. Leave type as Linux.\n - Save and write to disk\n - Ext\n\n### Preparing partitions\n\nFormat the first partition as EFI (boot) and set needed flags:\n\n    mkfs.fat -F 32 /dev/nvme0n1p1\n    parted /dev/nvme0n1 set 1 esp on\n    parted /dev/nvme0n1 set 1 boot on\n\nPrepare the second encrypted swap partition\n````\n    cryptsetup luksFormat -s 256 -c aes-xts-plain64 /dev/nvme0n1p2\n````\nRespond with a \"YES\" and enter a passphrase twice (-y provides this).\n\nOpen the main partition with a name \"OPEN\"\n\n    cryptsetup open /dev/nvme0n1p2 DEBIANSWAP \n    \u003cpassphrase\u003e\n\nFormat the partition as swap\n\n````\nmkswap /dev/mapper/DEBIANSWAP\nswapon /dev/mapper/DEBIANSWAP\n````\n\n### Creating BTRFS main and subvolumes\n````\ncryptsetup luksFormat -s 256 -c aes-xts-plain64 /dev/nvme0n1p3\ncryptsetup luksOpen /dev/nvme0n1p3 DEBIANLUKS\n\u003cpassphrase\u003e\nmkfs.btrfs -L DEBIAN /dev/mapper/DEBIANLUKS\nmkdir /mnt/debian\nmkdir /mnt/debianbtrfs\nmount -t btrfs -o defaults,noatime,compress=lzo,autodefrag /dev/mapper/DEBIANLUKS /mnt/debianbtrfs\n````\n\nMount main partition temporarily\n\n\nCreate subvolumes for rootfs, home, var and snapshots\n\n    btrfs subvol create /mnt/debianbtrfs/debianroot\n    btrfs subvol create /mnt/debianbtrfs/debianhome\n\n### Re-mounting subvolumes as partitions to /mnt\n\n    mount -t btrfs -o defaults,noatime,compress=lzo,autodefrag,subvol=debianroot /dev/mapper/DEBIANLUKS /mnt/debian/\n    mkdir /mnt/debian/home\n    mount -t btrfs -o defaults,noatime,compress=lzo,autodefrag,subvol=debianhome /dev/mapper/DEBIANLUKS /mnt/debian/home\n    mkdir /mnt/debian/boot\n    mount /dev/nvme0n1p1 /mnt/debian/boot\n    \n## Base installation\n\n### Bootstrapping a base-system\n\nWith all partitions mounted, run\n\n    debootstrap  --arch=amd64 testing /mnt/debian http://deb.debian.org/debian\n\n### Preparing the `chroot` environment\n\nCopy the mounted file systems table\n\n    cp /etc/mtab /mnt/etc/mtab\n\nBind the pseudo-filesystems for chroot\n\n    mount -o bind /dev /mnt/debian/dev/\n    mount -o bind /proc /mnt/debian/proc\n    mount -o bind /sys /mnt/debian/sys\n\n### Changing root to the new system\n\nCopy over resolve.conf for internet.\n````\nsudo cp /etc/resolv.conf /mnt/debian/etc/resolv.conf\n\n````\n\n\n    sudo chroot /mnt/debian_root /bin/bash -l\n\n## Configuration\n\n### Modifying fstab\n````\nnano /etc/fstab\n````\n\n````\nUUID=952C-65CB\t/boot\tvfat\tumask=0077\t0 1\nLABEL=DEBIAN\t/\tbtrfs\tdefaults,noatime,compress=lzo,autodefrag,discard=async,subvol=debianroot\t0 0\nLABEL=DEBIAN\t/home\tbtrfs\tdefaults,noatime,compress=lzo,autodefrag,discard=async,subvol=debianhome\t0 0\nshm        /dev/shm        tmpfs        nodev,nosuid,noexec  0 0\n/dev/mapper/DEBIANSWAP\tnone\tswap\tsw,discard\t0 0\n````\nSomething like this should get you by. To find your blkid of you FAT32 EFI partition. Use blkid.\n\n\n### Setting `HOSTNAME` for your machine, this example uses `astro`\n\n    echo 'Astro' \u003e /etc/hostname\n    echo '127.0.1.1 astro.localdomain astro' \u003e\u003e /etc/hosts\n\n### Setting up `apt` sources\n\nUpdate `/etc/apt/sources.list` to contain the following:\n\n    deb https://deb.debian.org/debian testing main contrib non-free non-free-firmware\n    apt update\n\n### Setting timezone\n\n    dpkg-reconfigure tzdata\n\nChoose an appropriate region.\n\n### Setting locale\n\n    apt-get install locales\n    dpkg-reconfigure locales\n\nChoose `en_US.UTF-8` from the list of locales, or whatever is appropriate for you.\n\n### Install your your desktop environment\n\n    apt update\n    apt-get install linux-image-amd64 linux-headers-amd64 firmware-linux-free firmware-misc-nonfree cryptsetup-initramfs console-setup sudo firmware-misc-nonfree  firmware-linux-nonfree firmware-intel-sound firmware-linux cryptsetup-suspend btrfs-progs intel-media-va-driver-non-free systemd-cryptsetup\n\n    \nInstall whichever desktop environment you want, my prefernce is Gnome:\n    \n    apt install task-gnome-desktop ufw gufw\n    \nOther Desktop Environment (DE) options are:\n\n    # task-cinnamon-desktop\n    # task-gnome-desktop\n    # task-kde-desktop\n    # task-lxde-desktop\n    # task-lxqt-desktop\n    # task-mate-desktop\n    # task-xfce-desktop\n    \nIf you are installing this on a laptop:\n\n    apt install task-laptop powertop gnome-power-manager linux-cpupower cpupower-gui laptop-mode-tools\n\n## Creating users and groups\n\n### Setting root password\n\n    passwd\n\n### Creating a non-root user\n\nCreate your main user.  Replace `duder` with your username below.\n\n    useradd duder -m -c \"Duder\" -s /bin/bash\n\nSet password for your user\n\n    passwd duder\n\nAdd user to sudo group\n\n    usermod -aG sudo,adm,dialout,cdrom,floppy,audio,dip,video,plugdev,users,netdev,bluetooth,wireshark duder\n\n### Setting up crypttab\n\nUse `blkid` to get the `UUID` of your encrypted partition, which is `/dev/nvme0n1p3` in this example\n\n````\ndd bs=512 count=4 if=/dev/random of=/etc/swap.key iflag=fullblock\nopenssl genrsa -out /etc/swap.key 4096\nchmod -v 0400 /etc/swap.key\nchown root:root /etc/swap.key\ncryptsetup luksAddKey /dev/nvme0n1p10 /etc/swap.key\nblkid\n````\n\nCreate an entry in the `/etc/crypttab` file\n\n    DEBIANSWAP UUID=uuidofdisk /etc/swap.key luks\n    DEBIANLUKS UUID=uuidofdisk none luks\n\n## Setting up bootloader\n\n### Installing bootloader utils\n\n    apt install efi-grub btrfs-progs cryptsetup-initramfs\n\n### Setup Grub\n\n    grub-install --target=x86_64-efi --efi-directory=/boot\nModify /etc/defaults/grub to look like this depending on the UUID of your LUKS2 root partition.\n\n````\nGRUB_CMDLINE_LINUX_DEFAULT=\"crypt_root=UUID=63f8dc5d-026d-4528-b85c-0a292adac2dd quiet splash\"\n````\nMake a grub.cfg file.\n````\ngrub-mkconfig -o /boot/grub/grub.cfg\n````\n### Enable Intel Video Acceleration\nI'm using a Thinkpad X1C \n````\nnano /etc/modprobe.d/intel.conf\n````\n````\noptions i915 enable_guc=2\n````\nWrite changes.\n\n### Testing your new bootloader\n\nExit chroot\n\n    exit\n\nUnmount all mounted partitions\n\n    umount -a\n\nReboot\n\n    reboot\n\nIf your bootloader fails and does not allow you to boot into your new system, follow the same instructions to remount all volumes and see if you are having issues with BLKID's.\n\n\n\n# Post installation\n\n## Basic system configuration\n\n### Console setup\n\nAssuming you are now logged into your newly created useraccount (and not root)\n\n    sudo dpkg-reconfigure console-setup\n\n### Connecting to the internet\n\nAs long as you installed task-gnome-desktop as recommended in the previous steps, you can use the GUI to setup your Internet.\n\nIf you didn't install a DE like Gnome, you can use `nmtui` to setup your network at the command prompt.\n\n### Install whatever other software you need or want.  I'd suggest this at a minimum:\n\n    sudo apt install git curl wget\n\n### If you have a fingerprint reader:\n    \n    sudo apt install libpam-fprintd\n    sudo pam-auth-update    ### Enable fingerprint authentication\n    fprintd-enroll\n    fprintd-verify\n\n### Debian Astro\n\n\nI use Debian Astro. It takes up about 7 gigs.\n````\napt-get install astro-all\n````\n\nDone.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftreesgreens%2Fdebian-btrfs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftreesgreens%2Fdebian-btrfs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftreesgreens%2Fdebian-btrfs/lists"}