You are not logged in.
This is a newby question. It's about downgrade or having package snapshots.
After I read the FAQ's and DOC's of Archlinux, I only saw something about downgrade, pacroll, and LVM snapshots.
Downgrade and pacroll only allows me to downgrade one step (I think...).
LVM snapshots... I down't use LVM, so it's limited to those who use it.
What I'm looking for, is a way of doing one or more snapshots of my packages (when all the system is stable and working), for allowing me later to do a rollback to a desired snapshot, after one or several updates with long time between them.
Is there a simple way to do that?
Offline
Either copy/paste the system partition using gparted (and others if you have them broken out like /var and /boot etc) or just tarup critical partitions. I don't know of a way to do it via pacman.
Offline
Check out the Arch Rollback Machine (ARM).
Offline
Check out the Arch Rollback Machine (ARM).
Hmmm! The way I understood what i've read, ARM is a repository with archived packages that allows you to rollback your system to a determined date.
But I'm thinking in a case, where I have a system updated, but detected some problems that the only way to solve them is downgrade several packages. After that my system is stable. Then I would make a snapshot of the packages installed, and during several months I don't make any other update. Maybe only one or another particular program update could be made, and other snapshot after each one.
Then I decide to make an update with "pacman -Syu" and the system get broken for any reason.
What I would like to have, is a way of getting one of the snapshots I made, and rebuild the system as it was some months before, with one command only. (ARM does it, but not as my computer was in that date)
I know there are tools like gparted and so on, but as you know it is not a fast task to do everyday at any time. I was thinking in a way of having a snapshot with a simple command and a rollback with another one.
So, it seems there is no way of doing that at this time. Is this wright?
Offline
I use rdiff-backup for the borked-upgrade scenario. It can make snapshots /incremental backups.
my backup script:
#!/bin/sh
ROOT_UID="0"
TARGET_LOCATION="/media/usb_harddisk_01/backups/arch_linux/"
#Check if run as root
if [ "$UID" -ne "$ROOT_UID" ] ; then
echo "You must be root to do that!"
exit 1
fi
# backup list of installed packages which
# can be reinstalled with pacman -S $(cat pkglist_official ) in case of a complete reinstall
pacman -Qqe | grep -v "$(pacman -Qqm)" > "$TARGET_LOCATION"packagelist_official
pacman -Qqm > "$TARGET_LOCATION"packagelist_aur
rdiff-backup \
--exclude /home/*/.cache \
--exclude /home/*/.local/share/Trash/files \
--exclude /home/*/.Trash \
--exclude /home/*/.thumbnails \
--exclude /dev \
--exclude /media \
--exclude /mnt \
--exclude /proc \
--exclude /sys \
--exclude /tmp \
--exclude /var/cache/pacman/pkg \
--exclude /var/log \
/ "$TARGET_LOCATION"
##Force is necessary because:
#Fatal Error: Found 2 relevant increments, dated:
#Sat Apr 10 12:39:24 2004
#Sat Apr 17 04:15:01 2004
#If you want to delete multiple increments in this way, use the --force.
echo "----------------------------------------"
echo " * Removing backups older than 5 Weeks"
echo "----------------------------------------"
rdiff-backup --force --remove-older-than 5W "$TARGET_LOCATION"
echo " "
echo "----------------------------------------"
echo " * Listing increments of backup"
echo "----------------------------------------"
rdiff-backup --list-increments "$TARGET_LOCATION"
echo " "
echo "----------------------------------------"
echo " * Disk usage after backup"
echo "----------------------------------------"
df -hmy recover script:
sudo rdiff-backup -r now /media/usb_harddisk_01/backups/arch_linux /Last edited by rwd (2010-04-29 13:18:59)
Offline
Not really what you are asking for, but have you considered using a backup tool like clonezilla?
It's quite fast, I use it all the time creating an image in my external drive - that can be really small btw.
You create a snapshot of your drive and you can do that every now and then or before any major
update. Then if something goes really wrong you can always go back where you were before by restoring
the clonezilla snapshot (restoring is normally very fast, too). And it's guaranteed that you will have your
working stable system back, no messing with configuration stuff whatsoever.
Last edited by geo909 (2010-01-03 18:08:19)
Offline
clonezilla is nice but it hasn't been updated in a while (I think it might be dead development wise), plus it doesn't support ext4 ![]()
Offline
I use rdiff-backup for the borked-upgrade scenario. It can make snapshots /incremental backups.
It seems interesting!
Not really what you are asking for, but have you considered using a backup tool like clonezilla?
I use it frequently (clonezilla) and I like it a lot.
But as you said, that was not what I was really asking for. I was thinking in something like a "fast emergency plan". Imagine you are going to do a global update, but first, you make a fast snapshot (sometyhing like creating a file with some metadata that takes only a few seconds), and then you make the upgrade. Later you could rollback everything if something went wrong, using only one command.
I think "pacroll" could be an interesting tool with a little more work on it.
Offline
what you are asking, can be done by simply checking pacman's log and perform the downgrades yourself.
remember, if you dont clean your system (using pacman, of course), all installed packages, old and new versions, will sit on /var/cache/pacman/pkg/
pacman's log is /var/log/pacman.log
im sure someone with minimal scripting skills can put up a few lines to do 'snapshotting'
Offline
But as you said, that was not what I was really asking for. I was thinking in something like a "fast emergency plan". Imagine you are going to do a global update, but first, you make a fast snapshot (sometyhing like creating a file with some metadata that takes only a few seconds), and then you make the upgrade. Later you could rollback everything if something went wrong, using only one command.
I think "pacroll" could be an interesting tool with a little more work on it.
Yeah, that's pretty different. Very interesting topic too
Offline
The simplest way I can think of is to download all the packages in a storage directory (on another partition or disk), by mounting that in your cache:
# mount --bind /media/storage/pkg20100106/ /var/cache/pacman/pkg/
# pacman -Sy
# pacman -Sw `pacman -Slq`
# umount /media/storage/pkg20100106/
The collateral good thing is that this procedure also points out all the dependency problems in the repo and you can report them to the tracker.
To avoid re-downloading the installed packages, or to copy them every time from your cache to the storage device, you can mount the storage in your cache dir at startup adding a line like this in /etc/fstab:
/dev/sda2 / ext4 defaults 0 1
/dev/sdb1 /media/storage ext4 defaults 0 1
/media/storage/pkg /var/cache/pacman/pkg none rw,bind 0 0
...so basically all the packages you download and/or install will go there. When you're content with the repository state and intend to keep it separated, unmount it, rename it, then create a replacement storage directory (that is, with the same name as in fstab) and mount it. For example:
# umount /media/storage/pkg/
# mv /media/storage/pkg/ /media/storage/pkg20100106/
# mkdir -p /media/storage/pkg/
# mount /media/storage/pkg/
You can optionally clean the repository before any of these procedures (# pacman -Sc) but remember to use this option in /etc/pacman.conf: CleanMethod = KeepCurrent, else all the cached but currently uninstalled packages will be erased.
How to use the packages in a directory at a later time as a repository is written in the wiki.
Last edited by akephalos (2010-01-05 23:23:02)
Offline
The simplest way I can think of is to download all the packages in a storage directory (on another partition or disk), by mounting that in your cache:
This is a different way of thinking the problem. Here you make a complete package repository, inside another device, which in case of disaster (disk loss) you are able to restore everything. This could be another interesting option... But I think it could be time consuming (the first time).
But there is another aspect to think of: the configuration files.
When we rollback a system, there are some configuration files inside /etc directory, which have been modified.
If we only reinstall packages we must replace their configuration as we had before, which can be the difference to have a buggy system.
So, it could be a nice idea to save all the "/etc" directory, and rebuild it after the rollback. This is not so big. Mine has only 16M ( # du -hs /etc ).
What do you think?
Offline