this post was submitted on 14 Jan 2025
15 points (100.0% liked)

Arch Linux

170 readers
2 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 14 comments
sorted by: hot top controversial new old
[–] folkrav@lemmy.ca 15 points 1 month ago

You can run scripts before/after pacman commands using hooks

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

[–] h4x0r@lemmy.dbzer0.com 7 points 1 month ago* (last edited 1 month ago)

alias upgrayedd=' && pacman/paru ...'

OR

upgrayedd() {
    <pre>        
    pacman/paru "$1"
    
}</pre>
[–] Hellmo_Luciferrari@lemm.ee 5 points 1 month ago (1 children)
[–] revanite@lemm.ee 3 points 1 month ago

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

[–] ada@lemmy.blahaj.zone 3 points 1 month 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

[–] JackbyDev@programming.dev 2 points 1 month 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.

[–] ada@lemmy.blahaj.zone 2 points 1 month ago (1 children)

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

[–] JackbyDev@programming.dev 1 points 1 month ago (1 children)

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

[–] ada@lemmy.blahaj.zone 2 points 1 month 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

[–] JackbyDev@programming.dev 1 points 1 month ago (1 children)

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

[–] ada@lemmy.blahaj.zone 1 points 1 month ago

You can always test it by booting off a backup image. If it works, you have peace of mind, and you can just reboot again from the correct image

[–] giacomo@lemm.ee 2 points 1 month ago

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

[–] Strit@lemmy.linuxuserspace.show 2 points 1 month 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.

[–] jul@discuss.tchncs.de 1 points 1 month ago

I'm also on EndeavourOS and used this tutorial to do exactly that.

All you should have to do is

yay -S snapper-support btrfs-assistant