Hello all, This is just for reference. Please don't try this in production. Please test this first if you want to rely on it. I apologize, but I can't take responsibility if it fails. I recommend Stephen's approach of trying on a VM first. NOTE: Like Stephen says, always run update-grub after a snapshot and let it finish! Ideally grub-btrfs would catch this, and it probably usually does, but if not given enough time, it won't pick up on your new snapshots. Also! This may only work on Debian, I'm not sure. Usually Debian does a lot of behind-the-scenes heavy-lifting for you! So again, please don't use this on production! Always thoroughly test before relying on something like this! There is no substitute for good, tested backups as well! I was able to follow this guide and rollback fine, with some modifications to your method: 1) I never used ### btrfs sub set-def ## / #-- I didn't have to touch it at all. Snapper (or Debian) did the work for me. I didn't set it before or after! I never touched it in this process. ( I don't know if this matters...) 2) I rebooted into the good read-only snapshot, then I ran "snapper --ambit classic rollback", but before rebooting: 3) While in the read-only snapshot, I ran "update-initramfs -c -k all" and "update-grub". I also used "snapper ls" to confirm that the correct read-write snapshot was selected now. 4) I rebooted into the new read-write snapshot created by the last step by selecting it in the grub-btrfs submenu. (This seems necessary for some reason.) 5) I ran "update-initramfs -c -k all" then "update-grub" from the read-write snapshot (which had already been defaulted by snapper). 6) I didn't move snapshots around or delete any of the snapshots or force there to be only one snapshot. 7) After a reboot, the default boot entry worked as expected booting into the new default read-write snapshot! This may be able to be simplified. My problem was that if I didn't reboot twice (In the way described above), the system didn't register the change in which snapshot to use as root. I updated the initramfs just in case, but this may be unnecessary. If you're trying this, please follow all the steps outline by Stephen before the breaking change (Except setting a default btrfs subvolume for /) and then all the steps above. Note that /boot will have to be on a separate partition or subvolume. I'm sure this can be optimized, and I'll look into it if I get the chance, but I believe these steps will increase your odds of recovery. If anyone has suggestions or amendments, I'd really appreciate them! Either way, thank you very much Stephen! I'd never have been able to work with snapper without your videos! (Documentation seems sparse, so I really appreciate the detailed explanations you always give!) My main fear in running Debian and other non-immutable distros was breaking changes I couldn't recover from. While I still love Silverblue, I really appreciate you opening up so many more distros to me! Thanks again Stephen and all, Dan / jedi453
@@stephenstechtalks5377 Thanks Stephen! I also just wanted to point out that you were correct that use of the update-initramfs command seems unnecessary (I just tested this on my machine). update-grub is enough, but you'll still seem to need to do the two boots from the grub-btrfs submenu and follow the other steps above to make it work. Thanks again!
@@DanI-xf6ym would it be good to add update-grub on boot using a cron job? Also, I think you guys assume that the bios (for baremetal) is not efi? Thx for sharing all of that, this is super appreciated !
I really enjoyed the details that you went through. I've read many discussions on using Snapper and it comes down to which method you use. Arch, Opensuse, or something else which can complicate it. At this point for critical systems that I know will need snapshots, I use snapper, grub-btrfs, and btrfs-assistant. I use btrfs-assistant to configure snapper and never the snapper console command. It avoids the default ID changes and copies/moves the snapshots where it needs them and keeps the default id as a level 5. I can't say I understand it but I've not been left stranded yet 😀
Great video!! It's always nice to see what can be done. I don't really have a use case for it as files are stored direct on a file server which is encrypted backed up in the cloud. I do once a clean install of the system and take a full disk image of the machine. Even though you don't have a fast restore, you are better protected against disk failure. Since I don't need for most things the latest packages, only would need to reinstall a few flatpaks for where it is needed to have the latest and update the system. Even though previous versions of Debian were not all that easy on the installation side, always sticked to it for it's stability. Once installed forget about it and do the stuff you need to do. Recently upgraded server to Debian 12, without any issue.
Big thanks Stephen for this great video, in the coming daysI will try the same setup on my thinkpad X1 4th gen, that now run on Deebian bullseye with Xfce Desktop and Spectrwm window manager. I was never a friend of Gnome, but it seems that gnome is really getting better. Thanks again and greetings from Switzerland.
Hi. It also works fine with no encryption/no separate boot partition. I use snapper-rollback. No need for intermediate update-grub or default snapshots. Thanks!
This has been a very informative video, as always. Though I'm using btrfs with the basic @home sub volume and timeshift, I'll have to keep my eye out on ways to simplify using Snapper and keeping GRUB in-sync. Aeon/MicroOS is cool but I kinda see it as a relief option to get around the process.
Thanks for this. I love debian but they do make it harder than it needs to be sometimes! ;) I like with arch this is set up for you. Hopefully eventually debian will also It's still my go to OS for servers and many containers.
Hi Stephen. Another terrific video. So how did you deduce that /var/lib/AccountsServive and /var/lib/gdm3 had to be writable with a ro snapshot? Trial and error, or did you find a web site highlighting this? What about sddm and KDE plasma with a ro snapshot? Thanks!
Trial and error with Fedora actually, but there it's simply /var/lib/gdm w/o the '3'. I haven't gone too deep with sddm/KDE ro snapshot booting yet, but I seem to recall those didn't need any special subvols from what I tested so far! Truth be told, for btrfs I've been simply following this method here: ruclips.net/video/K_O4jIpE66o/видео.html My current Debian install snapshotting works great on LVM (true COW): ruclips.net/video/VwtqIPDJSwQ/видео.html Recovery from live media is pretty simple once you get the hang of it!
I think yours might be the first video to perform this type of install for Debian 12. It's a shame the installer doesn't allow for easy subvolume creation when choosing BTRFS. It would be great if you had a link to a text overview of the BusyBox commands on Git or somewhere. Thanks!
Really impressive, thanks a lot!!!! I appreciate your knowledge and explanation very much. I am trying to do the same but use btrfs-assistant with snapper instead of command line for rollbaks, I hope some time you have time to make a video with btrfs-assistant if you think it's a good software. Thanks again!!!
Thanks for the insights about snapper ! (as I never made it to get a SUSE install working lol, I'll stick to debian anyway as the suse apt equivalent is rumored to be slow). Since the BTRFS quotas feature isn't stable as of 2024, I wonder why nobody on YT made a guide on how to use BTRFS on LVM (e.g at debian install time), for hot-resizing/hot-bay-expanding/hot-bay-removal/insertion in a LVM rig. BTRFS itself seems enough for partitioning/isolating into subvolumes, but without LVM, users have to know beforehands the allocated storage sizes. You have the best partition scheme I've seen, very convenient to isolate the QEMU stuff. I wish you overhauled it with LVM, as I don't know if getting a dedicated home logical volume, instead of keeping it as a a btrfs subvolume, would still allow timeshift/snapper to snapshot...
Thanks for sharing! BTRFS subvolumes are logical too - you can have as many as you want on a single physical partition formatted with BTRFS. :) LVM is CoW already, and BTRFS is considered by most to be CoW, so there may be redundancy here...
@@stephenstechtalks5377 Thanks to YOU for being this reactive! I commented (few days ago too) on this video watch?v=RPO-fS6HQbY . If I recall correctly his explanations, btrfs equilibrates free space among the logical volumes at all time, so one file evergrowing crazy (e.g logfile) is enough to make the system logical volume unusable. BTRFS quotas feature may have been created for this probably, but because it's not stable yet, I think LVM is a safer underlayer. It seems that at least another frenchie thought about such overthinked setup few years ago : watch?v=DFxs3EN4QAk
I think I would write a script that automates the process (running snapper, testing the state, running update-grub). BTW shouldn't it be update-grub2 with Debian?
Thnx for this vid ! I guess you missed a few subvols: /var/cache, /var/tmp, /var/crash, /var/spool, /var/www Hopefully the subvol creation will be included in the next version oif the debian installer!
@@stephenstechtalks5377 no it was plain btrfs that has failed me every time I tried, I try it again every few years. My use case is RAID1 btrfs for root. Every few years I try it, install Debian with ext4 on a VM with a root and /boot partition, build the latest released kernel to get the latest btrfs. Boot from that, add a second disk to the VM, partition it the same and make the root for that disk btrfs, rsync it all, make sure it can boot from the second disk; shutdown VM, remove disk and boot with one disk with btrfs as root. Add a new second disk, create the same partitions, etc. to make it bootable and set up a btrfs RAID1/mirror the other second disk (RAID1 for Data, System and Meta data) and sync and shutdown. Then boot and again sync and shutdown. Then remove the first disk and boot up from the second disk, with kernel parameter degraded, then boot with 2 disks again, syncing the second from the old first. And boot from the old first as single disk and repeat a few times, it will fail eventually after just a few tries and syncing each time before the shutdown.
Could I do this same installation and use TimeShift as an alternative to Snapper? I wanted something simpler because I switched to Linux a few weeks ago and I found the snapper very complicated to use in your video example
Hello Sir. I have a small issue with booting from grub to r/o snapshots. System just hangs and get bunch of errors like Gdm service failed, account service failed etc.. I have the same layout as yours. My workaround has been to open tty and make BTRFS snapshot ro false and then I can boot into Gdm and my system works. I also had to change the /var/lib/ gdm3 to just /var/lib/gdm. Why would that be? Thank you I didn’t see you run into that issue for some reason.
INTERESTING... I think I may do that too.. I did BTRFS once and did NOt have very good luck with it. (I'm sure I screwed it up though- not the software itself!! :)
In my experience, good old Timeshift is a *much* better fit for Debian on BTRFS than Snapper. Just /@ and /@home subvols needed. Definitely experiment on a VM first and get comfortable before attempting hardware. :) Full disclosure: I've had GREAT results with the LVM Debian installer defaults on ext4, and under-provisioned a bit to allow for snapshots...
@@stephenstechtalks5377 /@ and /@home? Do a video on that please.. have no idea what that is. I tried BTRFS- and it would not let me save it in Timeshift because I wanted it on different drive than the SSD for my OS. However, the large 2T drive I have for data didn't have a BTRFS partition on it-- so I made one- and it STILL wouldn't save to it. I don't get all that stuff..
I was wanting to get some help. Every time I run the command mount /dev/mapper/ I get a message that says mount: can’t find /dev/mapper/ in /etc/fstab. How do I proceed?
If the mount point is not specified in /etc/fstab you would need to specify explicitly where (on which mount point directory) to mount /dev/mapper. Good luck!
@@stephenstechtalks5377 thanks for the tip. I’ve been thinking about the problem. One thing I’m going to try is when I was following your instructions and trying to install Debian 12 that way I was using a ventoy usb because that’s where I keep all of my distro ISO files on. Normally it works just fine. What I was thinking I would try is taking a blank USB and making it a dedicated Debian 12 usb and repeating the process to see if that changes anything.
I love how thorough the vids are but I wish you also had a website with the commands listed for reference. And some thought was given to scripting wherever possible. A Debian 12 with BTRFS and Snapshots is ideal for many SSD owners. Yes, I've followed the content.. I just like to simplify to scripts if possible to make installs quicker and not require me to remember all steps. I get the need to drop to shell to unmount and remount etc but there must be a better way? (and yes, Spiral Linux has this set up but its not Debian 12 based yet!). Finally, maybe explain why all the sub volumes? Is it just to map the other dirs to their own subvolumes to make the "@" snapshot smaller? Or is it to be able to snapshot the VM images and Containers (if so, say so) ?? I only ask all these questions cos I am VERY interested in the content 🙂 Others seem to copy your content but dont do it as well ;-)
Thanks for the feedback and suggestions! Yes all those subvolumes are created to avoid snapshotting directories with high "churn," being able to log in to read-only snapshots, and preserving logs across snapshots as well as minimizing disk usage. :)
B Tree File System is redirect on write, not copy on write. That system requires more writes and is not preferred for ssds nor HDDs. Wear them or. So don't have a COW, if it's not what you think it is. People are sloppy and seem not even to know there is a difference between redirection and copying.
35:25 How to get more detailed than just "apt" comments on the grub-btrfs list ? (other than manually editing each time the snapper-GUI) Anyone found a workaround ? Arch users do have the full CLI that they typed to install/remove a package, before rebooting... Is it thanks to snap-pac package? Is there an equivalent for apt ?
Directly on LUKS is probably a simpler option and something worth investigating with the Debian installer. :) BTRFS on LVM should be fine as long as you never attempt to snapshot the LVM - btrfs on snapshotted LVM is a big no-no (COW on COW). Thanks for sharing!
I did this, and it was working, but I didn't turn off boot snapshots and now I cannot get to a rw filesystem for the life of me I tried `snapper --ambit classic rollback 0` which outputted ambit is classic creating read-only snapshot of current system. (snapshot 8) creating read-write snapshot of 0 (snapshot 9) setting default subvolume to snapshot 9 io erro(open failed path:/errno:1 (operation not permitted)). any help? I seem to have trapped myself into ro root and I can't find my way out.
I deleted all my /.snapshot/* subvolumes and unsurprisingly hosed the system, but then I edited the grub boot option to point back to subvol=@ and booted to a read-write root no problem.
@@stephenstechtalks5377 is there are reason why not to make all of /var a separate subvol? that is how fedora silverblue works. It's what I intend to try on my next laptop
Interesting video. Since encryption should be default for notebooks, your install should be the recommend one for notebooks and PCs. What you do with snapshots looks nice, but the current system integration is to bad for normal users. Far to much hassle. The installers/recovery do have a lot of potential. They don't even integrate multi disk encrypted setups. Let alone recovery with snapper.
Was able to successfully finish the complete process including rollbacks, etc. However, the problem for me is that even after successfully rolling back, the packages (neofetch in this case) I was expecting to be throwing "command not found" error, but it ended up working as if it was installed. Anyone has any ideas as to what could have gone wrong?
This is a great explanation of the difference between rollbacks and undochange (for Arch, but same for Debian): www.reddit.com/r/linuxquestions/comments/m6hm9g/snappers_rollback_vs_undochange_whats_the/ Good luck!
@@stephenstechtalks5377 got it, something I'll bookmark and review tonight. However, I have a major issue with NVIDIA drivers and the setup you talked about. If I go with guided default installation method and ext4, the nividia drivers load fine and everything is good but if I switch to btrfs and your subvol layout, it just fails, consistently throwing unable to load, cannot find drivers.
Trying to rollback but even after deleting all snaps and keeps the one that I want to use, grub doesn't boot to that snapshot. I can boot to that snapshot, but only If I select in the grub, not by default.
@@stephenstechtalks5377 Its weird, because, looks like by default will choose the "current" snapshot. Watching many tutorials, After adding a snapshot, automatically will boot to that new snapshot.
I was going to try this but felt like too much work, even setting up subvolumes for timeshift is a pain IMO as i never done it before but i made it work on the first try suprisingly
I'm trying to duplicate your example and when it comes to the part about "btrfs su set-default 269 /", I have to ask why do this. If I skip this step and just update-grub and reboot I can see that snapshot and can boot with it. The difference is while booted into that snapshot, snapper ls shows snapshot "1-" instead yours showed "1*". These are the things that baffle me about snapper.
Thanks for asking! Snapper works much better not only on OpenSUSE but Arch and Fedora as well. There, grub-btrfs will boot from the default subvolume automatically - which means much less of a battle than on Debian as shown in this video. :)
@@stephenstechtalks5377 The Mageia people are on the Release Candidate process for Mag9. But to to be honest, I don't know what makes any of them special to merit an installation video. It appears Mageia borrows code from Fedora. (From my limited understanding they appear to use the kernel code for the cauldron/experimental version.) OpenMandriva has a version optimized for AMD cpus IIRC.
IF I want to do this but LEAVE OUT the encryption , all I need to do is SKIP the encrypting part-- right? (no other changes to get it to work??) I'm here alone- miles from anything and don't have anything I need to keep that private...
Snapper works better on fedora. On fedora it will add in the description on the pre and post snapshots what was installed. One doesn't need to manually enter as in this Debian example. Why doesn't it work the same way? That's a good question. And, why is all this set up so complicated. Couldn't the engineers have created an install script that would do all these things? If one wants to waste his/her time, and as a 15+-year user of Linux, just use Linux. Can you imagine Windows and macOS users needing to execute all these commands at the command line in a terminal running a shell? They'd give up before 15 minutes had elapsed. Their time isn't wasted, because they chose an OS that just works so they can get real work done instead of sitting in front of a command line spending I ever minutes just to get a computer to start working. I like 🎉😂 doing all these things, too, but what a waste of time!
After wayching this video, i have one question for the SUSE snapper developers: why? Why did you write snapper to wirk so clumsily? It just barely fmgets tge job done, and at 45:20, we ckearky see that it doesn't talk or play well, at all, with grub, and heck, dont youbthink we need grub? Well, yes, if citmrse. They need to start all over with a complete new approach and code. Snapper needs a replacement. If i had more knowledge, id write it myself, but im not advanced enough in my knowledge nor do i have tge manpower or womanpower do get it done in a reasonable amount of time.
Hello all,
This is just for reference. Please don't try this in production. Please test this first if you want to rely on it. I apologize, but I can't take responsibility if it fails. I recommend Stephen's approach of trying on a VM first. NOTE: Like Stephen says, always run update-grub after a snapshot and let it finish! Ideally grub-btrfs would catch this, and it probably usually does, but if not given enough time, it won't pick up on your new snapshots.
Also! This may only work on Debian, I'm not sure. Usually Debian does a lot of behind-the-scenes heavy-lifting for you! So again, please don't use this on production! Always thoroughly test before relying on something like this! There is no substitute for good, tested backups as well!
I was able to follow this guide and rollback fine, with some modifications to your method:
1) I never used ### btrfs sub set-def ## / #-- I didn't have to touch it at all. Snapper (or Debian) did the work for me. I didn't set it before or after! I never touched it in this process. ( I don't know if this matters...)
2) I rebooted into the good read-only snapshot, then I ran "snapper --ambit classic rollback", but before rebooting:
3) While in the read-only snapshot, I ran "update-initramfs -c -k all" and "update-grub". I also used "snapper ls" to confirm that the correct read-write snapshot was selected now.
4) I rebooted into the new read-write snapshot created by the last step by selecting it in the grub-btrfs submenu. (This seems necessary for some reason.)
5) I ran "update-initramfs -c -k all" then "update-grub" from the read-write snapshot (which had already been defaulted by snapper).
6) I didn't move snapshots around or delete any of the snapshots or force there to be only one snapshot.
7) After a reboot, the default boot entry worked as expected booting into the new default read-write snapshot!
This may be able to be simplified. My problem was that if I didn't reboot twice (In the way described above), the system didn't register the change in which snapshot to use as root. I updated the initramfs just in case, but this may be unnecessary. If you're trying this, please follow all the steps outline by Stephen before the breaking change (Except setting a default btrfs subvolume for /) and then all the steps above. Note that /boot will have to be on a separate partition or subvolume.
I'm sure this can be optimized, and I'll look into it if I get the chance, but I believe these steps will increase your odds of recovery. If anyone has suggestions or amendments, I'd really appreciate them!
Either way, thank you very much Stephen! I'd never have been able to work with snapper without your videos! (Documentation seems sparse, so I really appreciate the detailed explanations you always give!) My main fear in running Debian and other non-immutable distros was breaking changes I couldn't recover from. While I still love Silverblue, I really appreciate you opening up so many more distros to me!
Thanks again Stephen and all,
Dan / jedi453
Excellent info all around, thanks so much for sharing! :)
@@stephenstechtalks5377 Thanks Stephen!
I also just wanted to point out that you were correct that use of the update-initramfs command seems unnecessary (I just tested this on my machine). update-grub is enough, but you'll still seem to need to do the two boots from the grub-btrfs submenu and follow the other steps above to make it work.
Thanks again!
Indeed, thanks again!
@@DanI-xf6ym would it be good to add update-grub on boot using a cron job? Also, I think you guys assume that the bios (for baremetal) is not efi?
Thx for sharing all of that, this is super appreciated !
Hi Stephen, hope you're doing OK? Looking forward to the next video - thanks for taking the time to make these very helpful videos🙂.
All good, just got a load of other projects atm! Thanks for your support!
I really enjoyed the details that you went through. I've read many discussions on using Snapper and it comes down to which method you use. Arch, Opensuse, or something else which can complicate it. At this point for critical systems that I know will need snapshots, I use snapper, grub-btrfs, and btrfs-assistant. I use btrfs-assistant to configure snapper and never the snapper console command. It avoids the default ID changes and copies/moves the snapshots where it needs them and keeps the default id as a level 5. I can't say I understand it but I've not been left stranded yet 😀
Excellent, and thanks for sharing! :)
This is pretty impressive. It looks at first glance to be clumsy, but it seems like a lot of it can be scripted. Thanks for this thorough exploration.
Definitely scriptable!
A big thanks for taking the time to show how to set this up👍
Any time!
I've been playing with this more and it saved my bacon today. I can see myself enjoying this setup on my laptop for a long time going forward
Excellent!
Thank you for using snapper on Debian :)
(from current package maintainer)
Thanks for supporting Snapper on Debian! :)
Great video!! It's always nice to see what can be done. I don't really have a use case for it as files are stored direct on a file server which is encrypted backed up in the cloud. I do once a clean install of the system and take a full disk image of the machine. Even though you don't have a fast restore, you are better protected against disk failure. Since I don't need for most things the latest packages, only would need to reinstall a few flatpaks for where it is needed to have the latest and update the system. Even though previous versions of Debian were not all that easy on the installation side, always sticked to it for it's stability. Once installed forget about it and do the stuff you need to do. Recently upgraded server to Debian 12, without any issue.
Nothing beats real backups - thanks for sharing!
Big thanks Stephen for this great video, in the coming daysI will try the same setup on my thinkpad X1 4th gen, that now run on Deebian bullseye with Xfce Desktop and Spectrwm window manager. I was never a friend of Gnome, but it seems that gnome is really getting better. Thanks again and greetings from Switzerland.
Hope you enjoy it, and thanks for your input!
Hi. It also works fine with no encryption/no separate boot partition. I use snapper-rollback. No need for intermediate update-grub or default snapshots. Thanks!
Thanks for the info!
Thanks for the video, nice in depth demonstration of debian, btrfs and snapper.
Glad you like it!
@@stephenstechtalks5377 yeah for sure! These more technical and in depth video's are not always easy to find.
I give Stephen thesevtwo hurrahs: patience and clear, easy-to-understand instructions.
Glad you find it useful!
This has been a very informative video, as always.
Though I'm using btrfs with the basic @home sub volume and timeshift, I'll have to keep my eye out on ways to simplify using Snapper and keeping GRUB in-sync. Aeon/MicroOS is cool but I kinda see it as a relief option to get around the process.
Yeah, at least for now TS seems a better fit for Debian over Snapper... ;)
Stephen, another great tutorial.
Thanks.
Enable tips!
This tutorial definitely deserves one!
Noted!
Thank you, very helpful and comprehensive video.
Glad it was helpful!
Thanks for this. I love debian but they do make it harder than it needs to be sometimes! ;) I like with arch this is set up for you. Hopefully eventually debian will also It's still my go to OS for servers and many containers.
Indeed, thanks for sharing!
Hi Stephen. Another terrific video. So how did you deduce that /var/lib/AccountsServive and /var/lib/gdm3 had to be writable with a ro snapshot? Trial and error, or did you find a web site highlighting this? What about sddm and KDE plasma with a ro snapshot? Thanks!
Trial and error with Fedora actually, but there it's simply /var/lib/gdm w/o the '3'. I haven't gone too deep with sddm/KDE ro snapshot booting yet, but I seem to recall those didn't need any special subvols from what I tested so far!
Truth be told, for btrfs I've been simply following this method here: ruclips.net/video/K_O4jIpE66o/видео.html
My current Debian install snapshotting works great on LVM (true COW): ruclips.net/video/VwtqIPDJSwQ/видео.html
Recovery from live media is pretty simple once you get the hang of it!
I think yours might be the first video to perform this type of install for Debian 12. It's a shame the installer doesn't allow for easy subvolume creation when choosing BTRFS. It would be great if you had a link to a text overview of the BusyBox commands on Git or somewhere. Thanks!
Thanks for your support and suggestions!
Spirallinux is configured with btrfs and snapper out of the box
Really impressive, thanks a lot!!!! I appreciate your knowledge and explanation very much. I am trying to do the same but use btrfs-assistant with snapper instead of command line for rollbaks, I hope some time you have time to make a video with btrfs-assistant if you think it's a good software. Thanks again!!!
Glad it was helpful - btrfs-assistant is excellent!
Thanks alot your videos are as always very comprehensive
Glad you think so!
Ok. Like-Button smashed. ;)
Thanks! :)
Thanks for the insights about snapper ! (as I never made it to get a SUSE install working lol, I'll stick to debian anyway as the suse apt equivalent is rumored to be slow). Since the BTRFS quotas feature isn't stable as of 2024, I wonder why nobody on YT made a guide on how to use BTRFS on LVM (e.g at debian install time), for hot-resizing/hot-bay-expanding/hot-bay-removal/insertion in a LVM rig. BTRFS itself seems enough for partitioning/isolating into subvolumes, but without LVM, users have to know beforehands the allocated storage sizes. You have the best partition scheme I've seen, very convenient to isolate the QEMU stuff. I wish you overhauled it with LVM, as I don't know if getting a dedicated home logical volume, instead of keeping it as a a btrfs subvolume, would still allow timeshift/snapper to snapshot...
Thanks for sharing! BTRFS subvolumes are logical too - you can have as many as you want on a single physical partition formatted with BTRFS. :) LVM is CoW already, and BTRFS is considered by most to be CoW, so there may be redundancy here...
@@stephenstechtalks5377 Thanks to YOU for being this reactive! I commented (few days ago too) on this video watch?v=RPO-fS6HQbY . If I recall correctly his explanations, btrfs equilibrates free space among the logical volumes at all time, so one file evergrowing crazy (e.g logfile) is enough to make the system logical volume unusable. BTRFS quotas feature may have been created for this probably, but because it's not stable yet, I think LVM is a safer underlayer. It seems that at least another frenchie thought about such overthinked setup few years ago : watch?v=DFxs3EN4QAk
Excellent points to consider - thanks for the comment!
This is FANTASTIC.
So professional, excellent!
Wow, thanks!
Phenomenal.
Thanks for your support!
I think I would write a script that automates the process (running snapper, testing the state, running update-grub). BTW shouldn't it be update-grub2 with Debian?
Needs scripting for sure, once the bugs are ironed out. :)
On (at least) Debian 12 it's simply a link: /usr/sbin/update-grub2 -> update-grub
Nice video Good weekend all !!!
Thanks, you too!
Stephen what os you are use at home? You videos is so amazing!
Glad to hear it! This video was made using Fedora Silverblue 38, with a bit of post on MacOS. :)
Pretty interesting stuff, thanks... bookmarked
Glad it was helpful!
Great video! What are the changes you need to do to be able to restore plasma snapshots?
For Plasma, you'll generally use SDDM instead of GDM as the display manager and in my experience it just works for booting read-only snapshots.
Thnx for this vid ! I guess you missed a few subvols:
/var/cache, /var/tmp, /var/crash, /var/spool, /var/www
Hopefully the subvol creation will be included in the next version oif the debian installer!
One more: don't make all subvols toplevel 5 !
Yup, and thanks for the tips!
Thankyou :-) Life saving guide for an intermediate noob
Glad to hear that this helped!
The reason I'm looking at your video, every experience I had with btrfs was just failed in less than an hour of testing.
This is Snapper, but I believe Timeshift or even the default LVM snapshotting might be easier ;)
@@stephenstechtalks5377 no it was plain btrfs that has failed me every time I tried, I try it again every few years. My use case is RAID1 btrfs for root. Every few years I try it, install Debian with ext4 on a VM with a root and /boot partition, build the latest released kernel to get the latest btrfs. Boot from that, add a second disk to the VM, partition it the same and make the root for that disk btrfs, rsync it all, make sure it can boot from the second disk; shutdown VM, remove disk and boot with one disk with btrfs as root. Add a new second disk, create the same partitions, etc. to make it bootable and set up a btrfs RAID1/mirror the other second disk (RAID1 for Data, System and Meta data) and sync and shutdown. Then boot and again sync and shutdown. Then remove the first disk and boot up from the second disk, with kernel parameter degraded, then boot with 2 disks again, syncing the second from the old first. And boot from the old first as single disk and repeat a few times, it will fail eventually after just a few tries and syncing each time before the shutdown.
would it be a good idea to set zstd compression to a high level during system install and then set it down to fast level?! ...
Hey! Congrats! Question: does that work 100% also on baremetal?
It should!
Could I do this same installation and use TimeShift as an alternative to Snapper? I wanted something simpler because I switched to Linux a few weeks ago and I found the snapper very complicated to use in your video example
Timeshift should work fine - last I checked you would need the Ubuntu standard @ and @home subvolume layout :)
Hello Sir. I have a small issue with booting from grub to r/o snapshots.
System just hangs and get bunch of errors like Gdm service failed, account service failed etc..
I have the same layout as yours.
My workaround has been to open tty and make BTRFS snapshot ro false and then I can boot into Gdm and my system works.
I also had to change the /var/lib/ gdm3 to just /var/lib/gdm.
Why would that be?
Thank you
I didn’t see you run into that issue for some reason.
Hi! Very strange indeed, that Debian stable would make changes like this in the middle of a release...
INTERESTING... I think I may do that too.. I did BTRFS once and did NOt have very good luck with it. (I'm sure I screwed it up though- not the software itself!! :)
In my experience, good old Timeshift is a *much* better fit for Debian on BTRFS than Snapper. Just /@ and /@home subvols needed. Definitely experiment on a VM first and get comfortable before attempting hardware. :)
Full disclosure: I've had GREAT results with the LVM Debian installer defaults on ext4, and under-provisioned a bit to allow for snapshots...
@@stephenstechtalks5377 /@ and /@home? Do a video on that please.. have no idea what that is. I tried BTRFS- and it would not let me save it in Timeshift because I wanted it on different drive than the SSD for my OS. However, the large 2T drive I have for data didn't have a BTRFS partition on it-- so I made one- and it STILL wouldn't save to it. I don't get all that stuff..
I was wanting to get some help. Every time I run the command mount /dev/mapper/ I get a message that says
mount: can’t find /dev/mapper/ in /etc/fstab. How do I proceed?
If the mount point is not specified in /etc/fstab you would need to specify explicitly where (on which mount point directory) to mount /dev/mapper. Good luck!
@@stephenstechtalks5377 thanks for the tip. I’ve been thinking about the problem. One thing I’m going to try is when I was following your instructions and trying to install Debian 12 that way I was using a ventoy usb because that’s where I keep all of my distro ISO files on. Normally it works just fine. What I was thinking I would try is taking a blank USB and making it a dedicated Debian 12 usb and repeating the process to see if that changes anything.
I love how thorough the vids are but I wish you also had a website with the commands listed for reference. And some thought was given to scripting wherever possible. A Debian 12 with BTRFS and Snapshots is ideal for many SSD owners. Yes, I've followed the content.. I just like to simplify to scripts if possible to make installs quicker and not require me to remember all steps. I get the need to drop to shell to unmount and remount etc but there must be a better way? (and yes, Spiral Linux has this set up but its not Debian 12 based yet!). Finally, maybe explain why all the sub volumes? Is it just to map the other dirs to their own subvolumes to make the "@" snapshot smaller? Or is it to be able to snapshot the VM images and Containers (if so, say so) ?? I only ask all these questions cos I am VERY interested in the content 🙂 Others seem to copy your content but dont do it as well ;-)
Thanks for the feedback and suggestions! Yes all those subvolumes are created to avoid snapshotting directories with high "churn," being able to log in to read-only snapshots, and preserving logs across snapshots as well as minimizing disk usage. :)
B Tree File System is redirect on write, not copy on write. That system requires more writes and is not preferred for ssds nor HDDs. Wear them or. So don't have a COW, if it's not what you think it is. People are sloppy and seem not even to know there is a difference between redirection and copying.
Here's a good explanation of the difference:
www.infotinks.com/zfs-btrfs-are-row-not-cow-redirect-on-write-not-copy-on-write/
Thanks for sharing! :)
@@stephenstechtalks5377yes. I believe I read that same article six months ago.
35:25 How to get more detailed than just "apt" comments on the grub-btrfs list ? (other than manually editing each time the snapper-GUI) Anyone found a workaround ? Arch users do have the full CLI that they typed to install/remove a package, before rebooting... Is it thanks to snap-pac package? Is there an equivalent for apt ?
Last I checked, apt doesn't yet have an equivalent... :(
Would there be a way to automate this installation using preseed? Preseed for Debian always want to use LVM it seems
Should work! Also, LVM does snapshots and rollbacks very well...
Why do you choose to install BTRFS on top of LVM and not directly on a encrypted Lucks?
Directly on LUKS is probably a simpler option and something worth investigating with the Debian installer. :) BTRFS on LVM should be fine as long as you never attempt to snapshot the LVM - btrfs on snapshotted LVM is a big no-no (COW on COW). Thanks for sharing!
Can I do the same for open SUSE ?
thanks sir
Most welcome!
What the freak is going on with /dev/vda2 and vda1, it is not existing on debian 12
I'm blocked. Any insights would be much appreciated !
Those are virtual machine kvm devices - try nvme or sda?
I did this, and it was working, but I didn't turn off boot snapshots and now I cannot get to a rw filesystem for the life of me I tried `snapper --ambit classic rollback 0` which outputted
ambit is classic
creating read-only snapshot of current system. (snapshot 8)
creating read-write snapshot of 0 (snapshot 9)
setting default subvolume to snapshot 9
io erro(open failed path:/errno:1 (operation not permitted)).
any help? I seem to have trapped myself into ro root and I can't find my way out.
I deleted all my /.snapshot/* subvolumes and unsurprisingly hosed the system, but then I edited the grub boot option to point back to subvol=@ and booted to a read-write root no problem.
Thanks for sharing!
@@stephenstechtalks5377 is there are reason why not to make all of /var a separate subvol? that is how fedora silverblue works. It's what I intend to try on my next laptop
Interesting video. Since encryption should be default for notebooks, your install should be the recommend one for notebooks and PCs. What you do with snapshots looks nice, but the current system integration is to bad for normal users. Far to much hassle. The installers/recovery do have a lot of potential. They don't even integrate multi disk encrypted setups. Let alone recovery with snapper.
Thanks for sharing!
Was able to successfully finish the complete process including rollbacks, etc. However, the problem for me is that even after successfully rolling back, the packages (neofetch in this case) I was expecting to be throwing "command not found" error, but it ended up working as if it was installed.
Anyone has any ideas as to what could have gone wrong?
This is a great explanation of the difference between rollbacks and undochange (for Arch, but same for Debian):
www.reddit.com/r/linuxquestions/comments/m6hm9g/snappers_rollback_vs_undochange_whats_the/
Good luck!
@@stephenstechtalks5377 got it, something I'll bookmark and review tonight. However, I have a major issue with NVIDIA drivers and the setup you talked about. If I go with guided default installation method and ext4, the nividia drivers load fine and everything is good but if I switch to btrfs and your subvol layout, it just fails, consistently throwing unable to load, cannot find drivers.
wow configuration
Could be easier! :)
Trying to rollback but even after deleting all snaps and keeps the one that I want to use, grub doesn't boot to that snapshot. I can boot to that snapshot, but only If I select in the grub, not by default.
Did you try to make it read-write, then update-grub?
@@stephenstechtalks5377 Thank you for your reply, yes.
The only other thing I can think of is making this snapshot the default root subvolume... :/
@@stephenstechtalks5377 Its weird, because, looks like by default will choose the "current" snapshot. Watching many tutorials, After adding a snapshot, automatically will boot to that new snapshot.
I was going to try this but felt like too much work, even setting up subvolumes for timeshift is a pain IMO as i never done it before but i made it work on the first try suprisingly
Thanks for sharing, that's great! :)
@@stephenstechtalks5377 Its thanks to your other videos, great work!
I'm trying to duplicate your example and when it comes to the part about "btrfs su set-default 269 /", I have to ask why do this. If I skip this step and just update-grub and reboot I can see that snapshot and can boot with it. The difference is while booted into that snapshot, snapper ls shows snapshot "1-" instead yours showed "1*". These are the things that baffle me about snapper.
Thanks for asking! Snapper works much better not only on OpenSUSE but Arch and Fedora as well. There, grub-btrfs will boot from the default subvolume automatically - which means much less of a battle than on Debian as shown in this video. :)
I was the guy that suggested Mageia a few weeks back. In case you still care about that, why not try OpenMandriva instead?
Thanks for the suggestion!
@@stephenstechtalks5377 The Mageia people are on the Release Candidate process for Mag9.
But to to be honest, I don't know what makes any of them special to merit an installation video.
It appears Mageia borrows code from Fedora. (From my limited understanding they appear to use the kernel code for the cauldron/experimental version.)
OpenMandriva has a version optimized for AMD cpus IIRC.
Excuse the annoyance. I hope I have not wasted your time with the suggestions.
Never, thanks again! :)
Its recommended to use zram to me if only have 4gb ram?
Should be fine, but I wouldn't try to run any virtual machines on a low ram device... :)
IF I want to do this but LEAVE OUT the encryption , all I need to do is SKIP the encrypting part-- right? (no other changes to get it to work??) I'm here alone- miles from anything and don't have anything I need to keep that private...
Correct! I'm just doing it because some organizations require it. If any powerful entity ;) wants my data, they have ways of getting to it regardless!
Toilet files???
Flush them!
Snapper works better on fedora. On fedora it will add in the description on the pre and post snapshots what was installed. One doesn't need to manually enter as in this Debian example. Why doesn't it work the same way? That's a good question.
And, why is all this set up so complicated. Couldn't the engineers have created an install script that would do all these things? If one wants to waste his/her time, and as a 15+-year user of Linux, just use Linux.
Can you imagine Windows and macOS users needing to execute all these commands at the command line in a terminal running a shell? They'd give up before 15 minutes had elapsed. Their time isn't wasted, because they chose an OS that just works so they can get real work done instead of sitting in front of a command line spending I ever minutes just to get a computer to start working.
I like 🎉😂 doing all these things, too, but what a waste of time!
Well, you can stick with the defaults and be just fine. ;)
After wayching this video, i have one question for the SUSE snapper developers: why?
Why did you write snapper to wirk so clumsily? It just barely fmgets tge job done, and at 45:20, we ckearky see that it doesn't talk or play well, at all, with grub, and heck, dont youbthink we need grub?
Well, yes, if citmrse. They need to start all over with a complete new approach and code. Snapper needs a replacement. If i had more knowledge, id write it myself, but im not advanced enough in my knowledge nor do i have tge manpower or womanpower do get it done in a reasonable amount of time.
With Debian/Ubuntu/Mint TimeShift might just be a better choice!
you are a master of linux
Trying to get there! :)
Thank you
So much