this post was submitted on 14 Jan 2025
0 points (NaN% liked)

Arch Linux

8405 readers
5 users here now

The beloved lightweight distro

founded 5 years ago
MODERATORS
 

I've seen some tools that do things like take snapshots periodically and ones that add snapshots to grub, but not this specifically. Does something exist?

This will probably be on EndeavourOS, not Arch directly, if it matters.

top 13 comments
sorted by: hot top controversial new old
[–] [email protected] 0 points 2 months ago

I use snapper. It takes snapshots not only triggered by pacman hooks but also on an interval or manually.

https://wiki.archlinux.org/title/Snapper

[–] [email protected] 0 points 2 months ago

The AUR package btrfs-autosnap does this. You define which subvolumes need to be snapshotted and how many it should keep of each. It adds a pacman hook that then takes a snapshot before updating.

[–] [email protected] 0 points 2 months ago

manjaro does this with timeshift. i think opensuse does as well.

[–] [email protected] 0 points 2 months ago

You can run scripts before/after pacman commands using hooks

https://wiki.archlinux.org/title/Pacman#Hooks

[–] [email protected] 0 points 2 months ago* (last edited 2 months ago)

alias upgrayedd='<snapshot command> && pacman/paru ...'

OR

upgrayedd() {
    <pre>
    <snapshot cmd>
    pacman/paru "$1"
    <post>
}
[–] [email protected] 0 points 2 months ago (1 children)
[–] [email protected] 0 points 2 months ago

This is what I use, I am on endeavouros too.

[–] [email protected] 0 points 2 months ago (1 children)

I don't know the details, but CachyOS uses a pacman hook to do exactly that, so it's possible. It looks like there are AUR packages to do the same thing, but I haven't looked at them

[–] [email protected] 0 points 2 months ago (1 children)

Does it do this out of the box? CachyOS is another option on my radar and that might push it over the edge for me over EOS.

[–] [email protected] 0 points 2 months ago (1 children)

Yep, as long as you use btrfs during the install and select snapper support

[–] [email protected] 0 points 2 months ago (1 children)

Just installed CachyOS and chose btrfs when installing, but it never asked about snapper. Maybe I need to do it manually.

[–] [email protected] 0 points 2 months ago (1 children)

If you open cachy hello, you'll see an option to install snapper support there. I should also add, you need to use grub for the boot images to work when you do a kernel upgrade

[–] [email protected] 0 points 2 months ago

Awesome! I installed it. Hopefully if something goes wrong I should be good. And yes, I used Grub!