HOWTO - GPT/UEFI install with full disk encryption: BTRFSonLUKS with separate root, home and pkg subvolumes; hibernation with a swapfile; auto-snapshots with easy system rollback (GUI); boot into snapshots

@2000
The longer time was due to running OS prober. I run the command to measure the time used by grub-mkconfig:

  1. With OS prober: 15.00 seconds
  2. Without OS prober: 5.6 seconds

So my long shutdown time was indeed caused by OS prober. I can live with 5.6 seconds shutdown time :smile:.

Thanks again !

PS: I tried to get the logs with the command
journalctl --since “15 min ago”
after booting, but I see only the kernel logs for the booting up, not for the shut down.

@2000
Thanks for the guide. I’m doing a vbox install.

Minor nitpick: leadpad is probably not installed on the liveiso. So the step about changing default btrfs settings for compression should be updated on the website : https://endeavouros.com/docs/encrypted-installation-2/btrfsonluks-verbose-version/

My iso file name is endeavouros-2020.09.20-x86_64.iso
I verified the sha sum just to be sure that my iso is not damaged.

sha512sum -c endeavouros-2020.09.20-x86_64.iso.sha512
endeavouros-2020.09.20-x86_64.iso: OK
1 Like

Thanks @flyingcakes, I just checked but I couldn’t find any occurrence of “leadpad” in the guide.

I’m pretty sure “leafpad” is available on the live iso’s; at least those from this year. Could it maybe be a typo or misread on your side?

1 Like

Very very sorry
It’s supposed to be ‘leafpad’ not ‘leadpad’ :sweat:

Now that I typed it wrong once, I suppose I may have also made this mistake while in the live iso. I’ll re-download the iso and confirm tomorrow.

Thanks for your time!

1 Like

No worries, happens to me all the time :grin:.

I personally don’t use leafpad and prefer vi/vim or nano, but I thought leafpad would be easier to the average user trying out the guide.

1 Like

Hi!
I checked again. This time I typed the spelling correct. Leafpad is not installed on the latest iso.

Same with me. :v:

I agree with this. Mousepad does come installed on iso as of now. You may want to read this if you want to mention mousepad in the guide :point_down:

1 Like

Or - just grab featherpad instead! or use nano - or better yet, micro for your ‘sudo’ editing…

2 Likes

@flyingcakes
Thanks for checking again … I think I’ll just change the wiki article to use nano instead then. With a short description on how to copy, paste and save in nano it should be manageable for new users. Nano also has the benefit of coming preinstalled with all future iso’s :grinning:.

2 Likes

I’m used to nano. I could never get along with vim. :relieved:

3 Likes

I’m not sure that would help all that much - given that the commands are displayed onscreen for the basics…(which is what makes it usable for most).

Well, basically you’re right of course. As long as you cut & paste while staying in your nano file it’s pretty straightforward.
But there aren’t any commands displayed when you’d want to copy something from a wiki article open in your browser into the nano file for instance. I remember being irritated about this myself as a new user :wink: .

1 Like

I totally get that. For years vim seemed absolutely alien to me and I never touched that “elitist s***”. I mean who in his right mind would use something unintuitive like that, :grin:.

Well, one rainy day I ran vimtutor, added some stuff to my .vimrc and … :heart:.

1 Like

I guess you should mention something aftter all :grin: Perhaps a note that because nano works in a terminal, that the same copy/paste ‘protocols’ apply - ie: add in a SHIFT to your CTRL-C and CTRL-X and CTRL-V. It’s easier than trying to find and edit nanorc file!

I used it for years (well, vi) on early Linux and Unix (and Multics (?)) - and was never so happy as when I found an alternative! Too many years with CygnusEd on the Amiga I suspect - so I knew that better was available :grin:

Well …I’m going to have to pull a Mork & Mindy here… Nano Nano! :laughing:

6 Likes

@2000 Some or all of what I describe may have absolutely nothing to do with configuring Ubuntu 20.04 with BTRFSonLUKS but I thought I would run it by you in case this is something you have encoutered. If relevant I use an Samsung EVO 840 240GB and I followed all of Willi Mutschler’s guide including the part Step 3 (optional): Optimize mount options for SSD or NVME drives verbatim. I also use a swap file instead of a partition for hibernation which if I recall correctly is because when I looked into this it will allow me to later setup True hybrid-suspend/suspend-to-both/suspend-and-hibernate. I experience the same lockups on my Dell XPS 9360 although much less frequently and for less duration.

There are some logs here from early October when it was especially bad - again I have no reason to believe this is anything to do with BTRFSonLUKS rather than it just being some Ubuntu issue: 20.04.1 frequent freezes, hangs, or lockups?

On my desktop within a week or so after my setup I started experiencing regular lockups and system freezes that could occur perhaps 20 times per day, and I was thankfully able to resolve this in the past by rolling back with Timeshift :slightly_smiling_face: Yesterday I downloaded ~10GiB of video and this morning I started receiving warnings about low disk space on root and after another reboot I could not get to the login screen. I dropped to a root recovery shell but apt clean and apt autoremove would not run as there was not enough space, ~64 KiB. I tried Bleachbit to free space, being sure not to select anything that mentioned backup files but it froze the system and I had to hard reset. I was able to roll back with Timeshift to a few days ago when I followed instructions I found to delete just the oldest kernel, which although has cleared ~60 GiB unfortunately seems to have removed all of my autosnapshots bar a manual one I took 19/09/20.

I have some HDDs I have not been using as I have been automounting as I have been trying to preserve their data before changing them from VeraCrypt (Desktop just froze for ~10 seconds) to LUKS, and I will get them set up as soon as I can so I can use for all downloads from now on but I wanted to ask if there is some better way I could handle Timeshift generally, how to free space if necessary in future without destroying backups, and if you have encountered anyone reporting similar freezes?

Some things come to mind:

Freezing →

  1. I have also occasionally encountered some freezing after manually deleting snapshots with Timeshift. The btrfs system will then run some cleanup processes in the background (called [btrfs-cleaner] or similar) which can cause notable freezing on one of my low-spec laptops. It depends on the amount of snapshots I delete in one go.
    Do your freezes occur after snapshots are removed (either automatically or manually)?

  2. If you followed Willi’s guide your fstab probably has the option “commit=120”. This is the resolution at which data are written to the filesystem. Btrfs normally defaults to a 30 seconds checkpoint interval in which new data are committed to the filesystem.
    Maybe try to remove or reduce your commit value and see if that helps.

  3. Your freezing may just be a side-effect of your ssd running out of space.

Low disk space →

  1. General linux userspace tools such as df will inaccurately report free space on a Btrfs partition. It is recommended to use btrfs filesystem usage to query Btrfs partitions. For example:
    btrfs filesystem usage /

Deleting a kernel should only free up about 10-35 MB; something went seriously wrong. I’d forget those instructions.

  1. Your btrfs filesystem may report that it has run out of free space; this mostly isn’t actually the case. In a btrfs file system there are chunks that are allocated for regular data and metadata. There are also chunks that are allocated to store file system information and also about where other chunks are located on the physical disk. Those chunks can only store the data. Very occasionally, a chunk type may fill up and start to run out of space. However, there may (and often is) still space available in other chunks. Therefore, some space needs to be freed up on it.
    There is a balancing feature available. The balance operation effectively frees up space in the other chunks to make it available for allocation.

It’s advisable to balance your btrfs system from time to time.

  • The following is what I run weekly; doesn’t take long on about 150GB
    sudo btrfs balance start -dusage=50 -dlimit=2 -musage=50 -mlimit=4 /

  • If you want to free up all the space wasted in all the chunks, you can run the following one-liner. Note that a balance will be run multiple times and try to free up chunks gradually. Use this if your system reports you’re out of space altogether.
    Warning: This will take a looooooooooooong time!
    sudo sh -c 'for i in 0 1 5 10 15 20 25 30 40 50 60 70 80 90 100; do echo "${0}: Running with ${i}%"; sudo btrfs balance start -dusage=$i -musage=$i /; done'

3 Likes

hello @2000, many thanks for your wiki, i have one request, I have an azerty keyboard, when I want to write my password to decrypt my system, this one is in qwerty, can you tell me what would be the procedure to have my keyboard in azerty if possible. thank you in advance

As this is a “full disk encryption”-scheme which includes /boot, I’m sorry to say, there’s no easy way to change the default keyboard layout from US-qwerty at this early stage in the boot process. At this stage solely grub and not our initramfs/kernel is in charge.

You have two viable options:

  1. You’ll just have to memorize and input the appropriate qwerty keys for your password, -or-
  2. change the pw, or add another password to something that works in both layouts.

Sorry, :cry:

hello @2000 thanks for your answer, have a good day