Page 1 of 1

I deleted my /etc !!!!!

Posted: 27 Oct 2016, 13:19
by viking60
Well as you all know backups are for chickens....but yesterday I manged to remove my /etc :!: :!: :!:
Image
Yes I know-- how is it even possible to be that stupid...so here we go;

I had an old backup on my USB drive.
This drive had a backup from my old Arch server and contained the directories /etc and /home

Since I have replaced that server with a Centos server I thought I'd delete those directories....

So cd into the USB drive and did a

Code: Select all

 rm -R /etc
and that of course did not remove the etc directory on the USB drive but the /etc on my main box :oops:

Stupid stupid stupid :f

So suddenly my user was completely gone root was gone and those users were gone even if I chrooted into it with my Viking Rescue system.

:wall:

Yeah that is bad :C but I was able to download and burn a Manjaro iso with SystemrRescueCD from our eminent rescue system and burn it to a DVD,

I started the Calamares installer and partitioned manually and had the option to keep the old data so I kept /home as is and also chose "keep" on /

That should replace my missing /etc.

I configured my user with the same data and password as before and was able to boot into my environment.

Every config file is there ('cept those in /etc of course) but I need to reinstall all missing programs.

Let this be a lesson to you :T :-D

I also have this script that backs up my /home on a daliy basis and in there I have pkglist.txt file that contains all installed packages:

I created it like this:

Code: Select all

pacman -Qqe | grep -vx "$(pacman -Qqm)" > /path/to/chosen/directory/pkglist.txt

I restored it with:

Code: Select all

sudo xargs -a </pat/to>/pkglist.txt pacman -S --needed

That should pretty much save my bacon.....depending on how old that file is....

Re: I deleted my /etc !!!!!

Posted: 20 Jun 2019, 22:51
by dedanna1029
Oh, holy crap!
Even worse is no one else but me noticed!

Re: I deleted my /etc !!!!!

Posted: 21 Jun 2019, 03:45
by Blackcrack
whoot.. eh how long we are linux-addicted ?
the first rule,

1. never touch a running system
2. make script-backuptools.
3. safe it, before it to late "tar cfvz /mnt/save/save/save/etc-%date%.tar.gz /etc"


:coffee_smile:

best regards
Blacky

Re: I deleted my /etc !!!!!

Posted: 26 Jun 2019, 23:04
by dedanna1029
We have those things. Sometimes however, we get busy, and plus, it's a lot more fun to screw a system up and then fix it lol. Anything else is just plain boring.