You are not logged in.

#1 2014-08-19 18:57:04

dice
Member
From: Germany
Registered: 2014-02-10
Posts: 413

[solved]severe accident on system backup

I don't know if this is the right forum..this thread might be placed in (re)installtion..as you will see

I usually keep an rsync backup of my entire system on an external hdd. I wrote a script to do it some time ago and now I edited this script to make it more flexible.
However something went horribly wrong when my destination path was wrong and rsync started to delete files from / (yes root).
It didn't finish that's why it is only partially damaged.
I made a backup using my old(working) script before fooling around but I fear that this backup was damaged as well because after my new script failed I tried if the old one still works. As I saw that there were some
"deleting lib/.." lines I stopped but the backup is damaged of course
the old script:

#! /bin/zsh
sudo systemctl stop psd
sudo rsync -aAXv --stats --delete --delete-excluded --progress --log-file /media/linux\ storage/backup/obsidian.log /* /media/linux\ storage/backup/obsidian --exclude-from=exclude.list
sudo systemctl start psd

the new script as I planned it to be:

#! /bin/zsh
backupPath="/media/linux storage/backup/obsidian"
logfile=$backupPath"/obsidian_$(date +%d%m%y).log"
sudo systemctl stop psd
sudo rsync -aAXv --stats --delete --delete-excluded --progress --log-file $logfile /* $backupPath --exclude-from=exclude.list
xz -z -9 $logfile
sudo systemctl start psd

during the editing process I made the following two (known) mistakes:
a \ in combination with quotes

backupPath="/media/linux\ storage/backup/obsidian"

and at another try I forgot $backupPath

sudo rsync -aAXv --stats --delete --delete-excluded --progress --log-file $logfile /*  --exclude-from=exclude.list

I currently don't see why this deletes everything on / but this doesn't really matter at the moment.

Result: When booting I see a couple of failed systemd services and thats it. I can't tell what services failed because it is too fast to read andat the end I just get a black screen. Seems as if the system tries to start X and lightDM but fails.
When I switch to a tty theres only a message saying that getty was started on tty2 or whatever number and I can't enter a command or something.

Before I start trying to fix anything further I'm asking your for advice on how to proceed.
I thought about chrooting into the system hoping that pacmans database is intact and reinstalling every package. I am not sure if this would work though.

And yes I know I was stupid fooling around with rsync while using the delete flag and not using --dry-run. And of course I should have made a backup of the backup before experimenting with the backup.

If you would like to have any further information I will do what I can to provide it.
I will definitely post this to the computing mistakes thread once my system is working again and I figured out what went wrong.

Last edited by dice (2014-08-19 23:19:31)


I put at button on it. Yes. I wish to press it, but I'm not sure what will happen if I do.  (Gune | Titan A.E.)

Offline

#2 2014-08-19 19:51:41

stevenhoneyman
Member
From: England
Registered: 2014-05-25
Posts: 241

Re: [solved]severe accident on system backup

Personally, I would just reinstall. But if you'd rather not, you can add

break=y

to kernel command line[1] to get to a busybox shell so you can at least take a look at how bad the damage is. If that doesn't work, or you run without an initramfs, then some kind of live media or the Arch install disc/USB would give you something to work from.

If it looks "nearly all there", then chroot and pacman might be able to fill in the gaps[2].

[1] https://wiki.archlinux.org/index.php/Bo … _into_Init
[2] https://wiki.archlinux.org/index.php/Pa … l_packages

Last edited by stevenhoneyman (2014-08-19 19:52:14)

Offline

#3 2014-08-19 23:18:52

dice
Member
From: Germany
Registered: 2014-02-10
Posts: 413

Re: [solved]severe accident on system backup

woohooo I'm here on arch again.
I figured out that mostly /usr/lib was damaged and the symlink from /var/lib  to /usr/lib was gone. Luckily my backup was not that much damaged. I restored the lib folder from my backup and created the symlink.
After that I reinstalled all packages via pacman....(man, why is the font cache updated after nearly every font package installation. and why does it take so long..?)

Somehow the ownership on /usr/lib/lightdm was wrong. I corrected this and here I am. I thought it would be a lot more difficult to get this running again.
Although I expect further issues in the next days but this thread is solved.

One of those issues is my clock being off two hours..I guess this is ubuntu's fault. I'll deal with that tomorrow wink

Last edited by dice (2014-08-19 23:20:13)


I put at button on it. Yes. I wish to press it, but I'm not sure what will happen if I do.  (Gune | Titan A.E.)

Offline

Board footer

Powered by FluxBB