Author Topic: Strategies for reverting a breaking upgrade?  (Read 1613 times)

0 Members and 1 Guest are viewing this topic.

Offline muncharo

  • Vollwertiges Mitglied
  • ***
  • Posts: 110
  • I'm new. Be nice!
  • Branch: stable
  • Desktop: i3
  • GPU Card: VGA compatible controller: Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 09)
  • GPU driver: free
  • Kernel: 4.1.19-1-MANJARO
  • Skill: Advanced
Re: Strategies for reverting a breaking upgrade?
« Reply #15 on: 01. March 2016, 00:34:23 »
I'd be interested in your favorite plugins, if you have more words to spare  ::)

Offline badbodh

  • Held Mitglied
  • *****
  • Posts: 923
  • Windows assumes I'm stupid, Linux proves it.
  • Branch: Testing
  • Desktop: Xfce, i3
  • GPU Card: Intel Mobile 4 Series
  • Kernel: linux41 64-bit
  • Skill: Intermediate
Re: Strategies for reverting a breaking upgrade?
« Reply #16 on: 01. March 2016, 00:39:04 »
I'd be interested in your favorite plugins, if you have more words to spare  ::)

*shots fired*
You can't feel the love till it hurts a little. Go rolling, go bleeding-edge !

Offline badbodh

  • Held Mitglied
  • *****
  • Posts: 923
  • Windows assumes I'm stupid, Linux proves it.
  • Branch: Testing
  • Desktop: Xfce, i3
  • GPU Card: Intel Mobile 4 Series
  • Kernel: linux41 64-bit
  • Skill: Intermediate
Re: Strategies for reverting a breaking upgrade?
« Reply #17 on: 01. March 2016, 00:53:59 »
i once lost /var/lib/pacman files due to data corruption. Thereafter pacman thought several packages "not installed" despite having files present in the system. And re-installing threw up the usual "already exists in filesystem" complaints. Not to mention broken-dependencies.

thereafter i crontabbed
Code: [Select]
/usr/bin/rsync -r -t -v -s /var/lib/pacman /some/place/elseyou never know when that backup may come in handy. After restoring from backup just do
Code: [Select]
sudo pacman -Qk to make sure things are okay.
You can't feel the love till it hurts a little. Go rolling, go bleeding-edge !

Offline Maboroshy

  • Neuling
  • *
  • Posts: 14
  • Branch: Stable
  • Desktop: KDE
  • GPU Card: Nvidia Quadro 880m
  • GPU driver: Nvidia blob
  • Kernel: linux41-x64
  • Skill: Novice
Re: Strategies for reverting a breaking upgrade?
« Reply #18 on: 01. March 2016, 10:43:52 »
I always back up whole disk with borg before updating. After initial backup it takes about 2-3 min to back up my 128 Gb SSD. Prepared usb stick with persistent linux mint install for recovery. Never had to use it yet. Would be good to use Manjaro on usb but no persistence mode for it yet.
« Last Edit: 01. March 2016, 10:51:19 by Maboroshy »

Offline Jeannie

  • Held Mitglied
  • *****
  • Posts: 1546
  • Skill: Novice
Re: Strategies for reverting a breaking upgrade?
« Reply #19 on: 01. March 2016, 12:05:49 »
My systems usually use the unstable branch. If an update breaks the system, I chroot into itfrom a live usb ystem and switch to testing. This only hapened once in over 3 years though.
J.
Hitten by the door in the back when I left Manjaro.

Offline pianoplayer

  • Neuling
  • *
  • Posts: 21
  • I'm new. Be nice!
  • Skill: Novice
Re: Strategies for reverting a breaking upgrade?
« Reply #20 on: 01. March 2016, 21:29:52 »
I also recommend Clonezilla very much! Before every upgrade I make a manual backup of these partitions (not the whole drive!!)

/  (13 GB)
/boot  (250 MB)

onto a USB-harddrive, which takes me about 3-5 minutes.

For the case if something breaks after pacman -Syyu, the system is backup running 5-10 min later without any headaches!
« Last Edit: 01. March 2016, 21:43:38 by pianoplayer »

Offline muncharo

  • Vollwertiges Mitglied
  • ***
  • Posts: 110
  • I'm new. Be nice!
  • Branch: stable
  • Desktop: i3
  • GPU Card: VGA compatible controller: Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 09)
  • GPU driver: free
  • Kernel: 4.1.19-1-MANJARO
  • Skill: Advanced
Re: Strategies for reverting a breaking upgrade?
« Reply #21 on: 02. March 2016, 05:59:13 »
Thanks for all the great tips, I stumbled across
Code: [Select]
btrfs send which let's you incrementally backup btrfs snapshots to external drives, kinda nifty:

https://unix.stackexchange.com/questions/207453/copy-btrfs-partition-to-external-harddisk-btrfs-partition-including-snapshots

Then you should make a read-only snapshot of watever subvolume(s) you want to backup on your filesystem by using

Code: [Select]
    btrfs su sn -r @subvolume-name @subvolume-name-ROon each subvolume. Then you should mount the blank btrfs filesystem and run

Code: [Select]
    btrfs send /path/to/@subvolume-name-RO | btrfs rec /path/to/backup-directory/
This will be the first send and btrfs will have to transfer all of the data this time. Next time you want to send a backup to this drive you can use incremental sends to only send what data has changed since the previous backup you sent. It will also use Copy On Write so you'll save a lot of space as well. Just make sure you keep the latest snapshot on both filesystems. When it's done you can rename the sent snapshot to whatever you want.

Now if you want to send another snapshot just rename the orignal one and take a new snapshot with something like

Code: [Select]
    mv @subvolume-name-RO @subvolume-name-RO-old
    btrfs su sn -r @subvolume-name @subvolume-name-RO
Then you can use send to send the latest snapshot using

Code: [Select]
    btrfs send -p @subvolume-name-RO-old @subvolume-name-RO | btrfs rec /path/to/backup-directory/and if the previous snapshot still exists on your backup drive it will send your new snapshot by only having to copy whatever changes you've made since the previous one.

Offline Chrysostomus

  • Maintainer
  • ***
  • Posts: 1634
  • Neckbeards are cool
    • Git
  • Branch: unstable
  • Desktop: Gnome, bspwm
  • GPU Card: Intel HD4000
  • GPU driver: free
  • Kernel: linux44-x64
  • Skill: Intermediate
Re: Strategies for reverting a breaking upgrade?
« Reply #22 on: 02. March 2016, 07:41:37 »
Artoo recommend redobackup in another thread as a easy to use alternative to clonezilla (undelying technology is the same): http://redobackup.org

For btrfs, there is btrfs-grub that lets you boot into your snapshots. And utilities that take a snapshot whenever you upgrade with pacman, after downloading the packages.

For just packages though, there is aura-bin that has
Code: [Select]
--save and
Code: [Select]
--restoreoptions, that let you roll back entire pacman upgrades instead of just downgrading individual packages. You need a bit of a hack to install aura on manjaro: comment out abs from dependencies, since manjaro does not have it.

Offline pianoplayer

  • Neuling
  • *
  • Posts: 21
  • I'm new. Be nice!
  • Skill: Novice
Re: Strategies for reverting a breaking upgrade?
« Reply #23 on: 02. March 2016, 16:57:20 »
@Chrys

Latest redobackup is from 2012, latest clonezilla is just a couple of days old. Easy to choose ;-)

Offline badbodh

  • Held Mitglied
  • *****
  • Posts: 923
  • Windows assumes I'm stupid, Linux proves it.
  • Branch: Testing
  • Desktop: Xfce, i3
  • GPU Card: Intel Mobile 4 Series
  • Kernel: linux41 64-bit
  • Skill: Intermediate
Re: Strategies for reverting a breaking upgrade?
« Reply #24 on: 02. March 2016, 17:01:32 »
You can't feel the love till it hurts a little. Go rolling, go bleeding-edge !

Offline muncharo

  • Vollwertiges Mitglied
  • ***
  • Posts: 110
  • I'm new. Be nice!
  • Branch: stable
  • Desktop: i3
  • GPU Card: VGA compatible controller: Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 09)
  • GPU driver: free
  • Kernel: 4.1.19-1-MANJARO
  • Skill: Advanced
Re: Strategies for reverting a breaking upgrade?
« Reply #25 on: 07. March 2016, 22:37:07 »
From the Arch reddit:

https://www.reddit.com/r/archlinux/comments/49cs2a/create_a_btrfs_snapshot_just_before_pacman/


Create a Btrfs Snapshot just before Pacman Upgrades/Installs/Removes a Package

If you are using Btrfs, you a probably somewhat familiar with snapshots. The latest pacman has a hooks capability, so I've created one in which a snapshot is created just before Pacman completes a transaction. Here's the hook (put it at /usr/share/libalpm/hooks/snapshot.hook):

Code: [Select]
[Trigger]
Operation = Upgrade
Operation = Install
Operation = Remove
Type = Package
Target = *

[Action]
Description = Btrfs snapshot before a transaction
Depends = btrfs-progs
When = PreTransaction
Exec = /usr/bin/dobtrfssnap

And here's the script it executes (put at /usr/bin/dobtrfssnap and make executable):
#!/bin/bash   
dirname=`date "+%FT%T"`
btrfs subvolume snapshot '/' /root/snapshots/pacman/$dirname


Also, you have to create /root/snapshots/pacman before using this.