r0b0 / debian-installer

Opinionated Debian Installer - alternative debian installer for laptops and desktop PCs
GNU General Public License v3.0
34 stars 3 forks source link

Timeshift #88

Closed thunderbird-93 closed 2 months ago

thunderbird-93 commented 3 months ago

Hi

First of all, thank you for all the great work to create an elegant and lightning fast installer. Debian is not the easiest distro, but your installer makes is so much better experience to get up and running in a breeze. Debian LUKS2 and TPM seems to be overly complicated. I followed number of guides and keep stumbling... Your installer makes it look effortless.

Everything looks perfect after install yet somehow timeshift refuses to configure. I run compatibility script from timeshift's git and it's not passing...

grep -E '^[^#].+/\s+btrfs' /etc/fstab | \
grep -oE 'subvol=[^,]+' | \
cut -d= -f2 | \
grep -qE '^/?@$' && \
echo 'OK' || \
echo 'Not OK'
Not OK

Would you please help me to meet timeshift criteria?

Many thanks!

r0b0 commented 3 months ago

The problem with that script is that our fstab does not have an entry for root. You can add one yourself - just open /etc/fstab as root, copy the line for /home and change from /home to / and change subvol from @home to @

But when I continue reading their requirements, there are other things that don't match - such as that we use the @ subvolume as default (as opposed of their requirement for this to be the the "top" subvolume) and we use systemd-boot and not grub.

thunderbird-93 commented 3 months ago

Thanks for looking into this. I really appreciate it. Meanwhile I've been digging and made some progress.

  1. Had to change installer.sh script
    #mkdir -p ${target}/root/btrfs1
    # map @ subvol to /
    cat <<EOF > ${target}/etc/fstab
    UUID=${btrfs_uuid} /home btrfs defaults,subvol=@home,${FSFLAGS} 0 1
    UUID=${btrfs_uuid} / btrfs defaults,subvol=@,${FSFLAGS} 0 1
  2. Above step seemingly fulfilled timeshift requirements but still "no cigar". I had to set @ as default subvolume and adjust kernel parameters as suggested here.
    sudo btrfs subvolume set-default 5 /

    Changed rootflags in /boot/efi/loader/entries/{current_kernel}.conf. Not sure how to make it permanent to follow kernel updates...

    # before
    rootflags=compress=zstd:1
    # after
    rootflags=compress=zstd:1,subvol=@

That made timeshift play nicely. I hope this is helpful.

r0b0 commented 3 months ago

That's interesting.

You can add the subvol=@ flag to /etc/dracut.conf.d/90-luks.conf and also to /etc/kernel/cmdline

This should make it survive kernel and initrd updates.

Let me know if you encounter any side effects later.

thunderbird-93 commented 3 months ago

Glad to confirm subvol=@ survives kernel and initrd updates. I am running Debian Testing with critical security updates pinned to unstable. Today 6.9.7-1 kernel dropped in - no problems.

r0b0 commented 2 months ago

I have tested timeshift with this new version and everything looks ok