You are not logged in.

#1 2016-03-21 18:38:25

MountainX
Member
Registered: 2016-02-08
Posts: 371

wrapping pacman transactions in snapper+LVM snapshots (encrpted /boot)

I'm new to Arch and LVM snapshots. The snap-pac tool looks like it could do what I need, but the tutorials and forum posts I have found are all btrfs-centric. It seems like the community would benefit from having a tutorial that is specific to (or at least gives examples for) LVM as well.

Furthermore, my sitaution is complicated by having an encrypted /boot.

My questions are:

1.  Can I use snap-pac on a system with a fully encrypted drive (including /boot)?
I used this guide:
Full disk encryption with LUKS (including /boot) · Pavel Kogan
http://www.pavelkogan.com/2014/05/23/lu … ncryption/

2.  I have / and /home logical volumes already.  Would it be wise to create a /var logical volume (or any other) when using this snapshot approach?
Wrapping_pacman_transactions_in_snapshots - Snapper - ArchWiki
https://wiki.archlinux.org/index.php/Sn … _snapshots

3. Can I create grub boot menu options based on snapshots given my encrypted boot setup?
http://www.pavelkogan.com/2014/05/23/lu … ncryption/

If anyone wants to start an LVM-centric tutorial in the wiki for wrapping pacman transactions in snapper snapshots, I will test each step and enhance / expand the documentation based on my experiences.

BTW, I guess etckeeper is obsolete with this snapshot approach, right?

References:

GitHub - wesbarnett/snap-pac: Make pacman automatically use snapper to create pre/post snapshots like openSUSE's YaST
https://github.com/wesbarnett/snap-pac

Snapper/BTRFS layout for easily restoring files, or entire system / Installation / Arch Linux Forums
https://bbs.archlinux.org/viewtopic.php?id=194491

Last edited by MountainX (2016-03-21 18:46:30)

Offline

#2 2016-03-26 20:07:03

wba072
Member
Registered: 2010-11-11
Posts: 33

Re: wrapping pacman transactions in snapper+LVM snapshots (encrpted /boot)

I don't know anything about LVM snapshots, but the hooks in snap-pac just run scripts of snapper commands. I do know you should set "-fstype" (details in snapper's manpage), so the scripts would need to be modified. The snapper wiki article is definitely more btrfs focused, so any insight you have into LVM snapshots would be really helpful.

Concerning encryption, that probably isn't an issue, but I don't have an LVM setup so don't know for sure. I have a btrfs system setup with encryption (including /boot) and use snap-pac. My /boot is also btrfs, but if it was not, then snapper would just ignore it when it takes a snapshot of "/". I'm also able to populate my GRUB menu with snapshots (automatically with https://aur.archlinux.org/packages/grub-btrfs-git/).

People probably suggest making "/var" a subvolume/logical volume so that it is omitted when a snapshot is taken (snapshots don't recursively take snapshots of nested subvolumes, but ignore them). See https://wiki.archlinux.org/index.php/Sn … _slowdowns

Offline

#3 2016-03-26 20:22:30

elkoraco
Member
Registered: 2013-02-18
Posts: 140

Re: wrapping pacman transactions in snapper+LVM snapshots (encrpted /boot)

Based on what I know, LVM snapshots are meant to be used as a reliable backup tool, maybe once in a while for testing an upgrade, the performance hit for taking continuous snapshots of LVM volumes would be significant.

Offline

#4 2016-03-26 20:32:52

wba072
Member
Registered: 2010-11-11
Posts: 33

Re: wrapping pacman transactions in snapper+LVM snapshots (encrpted /boot)

elkoraco wrote:

Based on what I know, LVM snapshots are meant to be used as a reliable backup tool, maybe once in a while for testing an upgrade, the performance hit for taking continuous snapshots of LVM volumes would be significant.

Snapper automatically cleans up the oldest snapshots so that this doesn't happen (can be easily configurable).

Offline

#5 2016-03-26 21:17:12

MountainX
Member
Registered: 2016-02-08
Posts: 371

Re: wrapping pacman transactions in snapper+LVM snapshots (encrpted /boot)

I've been reading that LVM snapshots actually have a very significant performance hit (even for a single snapshot). Therefore, it seems my best option is to re-install Arch, getting rid of LVM+Ext4 and using btrfs instead. I'm trying to learn if btrfs is production-ready enough now, and there are a lot of mixed opinions on this.

Offline

#6 2016-03-26 21:47:15

MountainX
Member
Registered: 2016-02-08
Posts: 371

Re: wrapping pacman transactions in snapper+LVM snapshots (encrpted /boot)

elkoraco wrote:

Based on what I know, LVM snapshots are meant to be used as a reliable backup tool, maybe once in a while for testing an upgrade, the performance hit for taking continuous snapshots of LVM volumes would be significant.

I think you meant "snapshots are NOT meant to be used as a reliable backup tool". That is true for btrfs snapshots as well.

However, snapshots are a great way to wrap pacman transactions so that rolling back to the pre-upgrade state becomes very easy.

My original issue was that all the snapper and pac-snap tutorials are focused on btrfs and I'm using LVM. However, I'm now considering switching to btrfs. I'm beginning to understand that LVM snapshots have severe performance penalties while btrfs snapshots do not. Here are some of my references:

LVM2 snapshot performance problems
http://www.nikhef.nl/~dennisvd/lvmcrap.html

performance - Limit on the number of btrfs snapshots? - Unix & Linux Stack Exchange
http://unix.stackexchange.com/questions … -snapshots

LVM snapshot performance – John Leach
https://johnleach.co.uk/words/613/lvm-s … erformance

How many of you regularly use LVM snapshots? : linuxadmin
https://www.reddit.com/r/linuxadmin/com … snapshots/

Offline

#7 2016-03-26 22:51:42

elkoraco
Member
Registered: 2013-02-18
Posts: 140

Re: wrapping pacman transactions in snapper+LVM snapshots (encrpted /boot)

MountainX wrote:

I think you meant "snapshots are NOT meant to be used as a reliable backup tool". That is true for btrfs snapshots as well.

I probably should have written targets. Since snapshots are non-changing, they are a much better target for something like fsarchiver. The Sysrescue CD has good articles on this.

I've only ever used LVM snapshots like this, and I would delete them soon afterwards. I did try out the rollback feature with upgrades, but that was mostly for fun. The problem with LVM snapshots is that all the data and metadata that changes on the original volume needs to be written to every snapshot. So you either need to configure snapper to keep a small number of snapshot available, or you should consider switching to btrfs.

Last edited by elkoraco (2016-03-26 22:52:03)

Offline

Board footer

Powered by FluxBB