You are not logged in.

#1 2022-04-24 17:18:43

rudepeople
Member
Registered: 2013-03-10
Posts: 13

[solved] Btrfs with snapshots on LVM... on luks... with grub/uefi...

I'm trying to install arch on mine and my wife's laptops but I have some caveats...

Both laptops are used for banking from time to time and we are guilty of storing passwords in clear text. The bigger issue is these laptops do a lot of traveling so we worry about them getting stolen. The trade off is we use full disk encryption. But to make things even MORE complicated, my wife has one arm (please don't ask) so cli isn't really an option for her. So the reason I'm here is our laptops have been suffering as of late... We come from debian and have noticed a lot of the dev teams for debian we use have been infiltrated by incompetent people. Constantly crashing and just general bloat. We used arch about 10 years ago and had no issues, so back we go!

I would like to use some sort of simple to use snapshot utility which is timeshift. In debian it just worked without much fuss! The problem is in arch, timeshift will create snapshots manually but it won't create new snapshots on schedule. The best I can tell, it's not working with the fact the btrfs partition is on an LVM inside luks. I think it's the nested nature of the beast that tripping it up. When I go to the "location" section in timeshift config, it shows my drive, but also says it doesn't have a btrfs partition, dispite the fact timeshift WILL create a snapshot manually!

Then there's snapper, snapper works... but 2 issues: First, snapper doesn't really have a simple restoration mechanism. once again, my wife has only one arm so cli is far from comfortable for her to use. With snapper, she's got to open fstab and edit subvolid numbers which requires her looking at the subvolumes in cli (snapper-gui doesn't show subvol IDs). The second issue is I have seperate subvolumes for @home and @ (don't need to restore home if a package install/upgrade is to blame for something). snapper separates the snapshots for each subvolume, making it necessary to have 2 snapshot subvolumes and the way it sets snapshots (/.snapshots/1/snapshot/ and /home/.snapshots/1/snapshot/) is really breaking my brain. Why cant it store with a timestamp like timeshift (ie: timeshift-btrfs/snapshots/2022-04-23_14-15-40/@ and timeshift-btrfs/snapshots/2022-04-23_14-15-40/@home)??? In timeshift all snapshots are in one place and timestamped for obvious notation. Having to ls -hal on the timestamp folders just to get a date is such a pain. YOU try doing all of this with one arm! Time shift is just SO much better in this way.

PC info (Both machines are identical):

[rudepeople@eris ~]$ neofetch
                   -`                    rudepeople@eris 
                  .o+`                   --------------- 
                 `ooo/                   OS: Arch Linux x86_64 
                `+oooo:                  Host: HP ENVY x360 Convertible 15-ds1xxx 
               `+oooooo:                 Kernel: 5.17.4-arch1-1 
               -+oooooo+:                Uptime: 14 hours, 6 mins 
             `/:-:++oooo+:               Packages: 833 (pacman) 
            `/++++/+++++++:              Shell: bash 5.1.16 
           `/++++++++++++++:             Resolution: 1920x1080 
          `/+++ooooooooooooo/`           DE: Cinnamon 5.2.7 
         ./ooosssso++osssssso+`          WM: Mutter (Muffin) 
        .oossssso-````/ossssss+`         WM Theme: Mint-Y-Sand (Mint-X) 
       -osssssso.      :ssssssso.        Theme: Adwaita [GTK2/3] 
      :osssssss/        osssso+++.       Icons: Mint-Y-Yellow [GTK2/3] 
     /ossssssss/        +ssssooo/-       Terminal: gnome-terminal 
   `/ossssso+/:-        -:/+osssso+-     CPU: AMD Ryzen 7 4700U with Radeon Graphics (8) @ 2.000GHz 
  `+sso+:-`                 `.-/+oso:    GPU: AMD ATI 04:00.0 Renoir 
 `++:.                           `-/+/   Memory: 2048MiB / 15422MiB 
 .`                                 `/
[rudepeople@eris ~]$ lsblk
NAME          MAJ:MIN RM  SIZE RO TYPE  MOUNTPOINTS
nvme0n1       259:0    0  1.8T  0 disk  
├─nvme0n1p1   259:1    0    2G  0 part  /boot
└─nvme0n1p2   259:2    0  1.8T  0 part  
  └─luks-vol  254:0    0  1.8T  0 crypt 
    ├─lv-swap 254:1    0   42G  0 lvm   [SWAP]
    └─lv-root 254:2    0  1.8T  0 lvm   /home
                                        /var/log
                                        /


TL;DR:

1> does anyone know enough about timeshift to tell me how to configure my partitions to make it work properly? I need full disk encryption, including a swap partition.
2> if not 1, how do I make snapper create subvolumes in a more respectable manner? Is there a simpler "gui" option for restoration?

Last edited by rudepeople (2022-04-25 13:08:54)

Offline

#2 2022-04-24 18:36:16

Daemonjax
Member
Registered: 2009-07-02
Posts: 48

Re: [solved] Btrfs with snapshots on LVM... on luks... with grub/uefi...

Personally, I would use either btrfs by itself or lvm+ext4.  Then if I needed encryption, I'd add encryption to one of those.   What are you trying to get out of LVM when you only have a single disk that btrfs doesn't provide?  I'm no expert, so maybe you know something I don't.

Last edited by Daemonjax (2022-04-24 18:37:47)

Offline

#3 2022-04-24 19:25:29

rudepeople
Member
Registered: 2013-03-10
Posts: 13

Re: [solved] Btrfs with snapshots on LVM... on luks... with grub/uefi...

Daemonjax wrote:

What are you trying to get out of LVM when you only have a single disk that btrfs doesn't provide?  I'm no expert, so maybe you know something I don't.

Leaving swap unencrypted opens the door to attack. So for a safer build, encrypt all the things. The easiest way is to make 3 partitions (boot, root, and swap), encrypt all 3 and then format the root luks partition with btrfs... Im fairly sure thats how I did it in debian. The trouble is I then have 3 obvious partitions. Lvm on luks means there's no obvious separation. The less info an attacker has, the more likely they'll give up.

So its just the volume grouping that lvm offers. If I could sub-partition a luks volume, Id probably ditch lvm.

Honestly none of that matters here. Im just trying to understand the configuration of the snapshot programs available.

Last edited by rudepeople (2022-04-24 19:28:39)

Offline

#4 2022-04-24 22:30:30

nick_0189
Member
Registered: 2020-12-21
Posts: 45

Re: [solved] Btrfs with snapshots on LVM... on luks... with grub/uefi...

I'm not exactly sure about Timeshift and snapper. I don't see any reason why it wouldn't work with LVM. I would guess it has something to do with the scheduling side of it rather than the snapshotting side of it.  You can make services that automatically run them every so often, and restoring could also be done with a script, so if the GUI option isn't working right now for some reason you could try that. You could try to see if Timeshift leaves any logs indicating why it isn't taking snapshots when it's supposed to.

I have also been confused about how difficult it seems to visualize BTRFS snapshots and manipulate them. It seems like a lot of complicated and tedious work, even if you don't have to do it that often.

You could try BTRFS alone without LVM if it's causing problems. It seems sort of redundant to have them together since BTRFS offers similar volume management that LVM does. Since BTRFS supports swap files now, you might be able to just use one and it will be encrypted and exempt from snapshots. You can also use full disk encryption with BTRFS and even put the bootloader on a flash drive if you really want potential thieves to have absolutely no information.

Offline

#5 2022-04-24 23:29:45

rudepeople
Member
Registered: 2013-03-10
Posts: 13

Re: [solved] Btrfs with snapshots on LVM... on luks... with grub/uefi...

nick_0189 wrote:

I'm not exactly sure about Timeshift and snapper. I don't see any reason why it wouldn't work with LVM. I would guess it has something to do with the scheduling side of it rather than the snapshotting side of it.

BRILLIANT!!!

I googled "timeshift not taking scheduled snapshots" and found this! I had no idea cronie wasn't running because snapper was taking hourly snapshots. I just assumed all time based functions were connected to cron. I guess not! I enabled and started cronie. we'll see in about 30 if it worked. I'll post back when I know for sure.

Last edited by rudepeople (2022-04-24 23:32:58)

Offline

#6 2022-04-25 00:22:46

rudepeople
Member
Registered: 2013-03-10
Posts: 13

Re: [solved] Btrfs with snapshots on LVM... on luks... with grub/uefi...

Problem solved. it was cronie. Timeshift is working fine now.

for future lurkers:

$ sudo systemctl enable cronie.service
$ sudo systemctl start cronie.service

Offline

Board footer

Powered by FluxBB