Accidentally deleted the /etc folder

New to Debian (Or Linux in general)? Ask your questions here!

Accidentally deleted the /etc folder

Postby sarksloane » 2018-02-24 17:24

Hi, Please I need your help how can I restore and retrieve my /etc folder. Because of my carelessness, I deleted the folder. :(

Please how can I restore the file without re-installation.
sarksloane
 
Posts: 75
Joined: 2017-01-17 04:21

Re: Accidentally deleted the /etc folder

Postby Head_on_a_Stick » 2018-02-24 17:31

Restore your backup.

Use this to preserve ACLs and other permissions:
Code: Select all
rsync -aAXv $source $destination
ESTRAGON: We always find something, eh, Didi, to give us the impression we exist?
VLADIMIR (impatiently): Yes, yes, we're magicians.
User avatar
Head_on_a_Stick
 
Posts: 7893
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Accidentally deleted the /etc folder

Postby sarksloane » 2018-02-24 17:36

Head_on_a_Stick wrote:Restore your backup.

Use this to preserve ACLs and other permissions:
Code: Select all
rsync -aAXv $source $destination

Sorry I am new to linux world.

Please can you give me the steps on how to do it? I don't know where to find my back up.
sarksloane
 
Posts: 75
Joined: 2017-01-17 04:21

Re: Accidentally deleted the /etc folder

Postby sarksloane » 2018-02-24 17:54

Please i do really need your help..
sarksloane
 
Posts: 75
Joined: 2017-01-17 04:21

Re: Accidentally deleted the /etc folder

Postby Bulkley » 2018-02-24 17:58

sarksloane wrote:Please can you give me the steps on how to do it? I don't know where to find my back up.


It is where you put it. I suspect that you never made a backup.

I would boot up a live Debian CD or USB. Then I would copy the entire /etc folder to my system and reboot. There is a slim chance that doing this might get you started. If it doesn't (and there is a big chance it won't) you will have to do a fresh install.

In the future, respect Debian's two tiered security. Avoid Sudo and use su. (Sudo has its uses but you need to learn how to use it safely.) Learn how to make backups.
Bulkley
 
Posts: 5617
Joined: 2006-02-11 18:35

Re: Accidentally deleted the /etc folder

Postby Head_on_a_Stick » 2018-02-24 18:12

Bulkley wrote:I would boot up a live Debian CD or USB. Then I would copy the entire /etc folder to my system and reboot.

I was going to suggest that but quite a few things would need to be changed — /etc/fstab being the main obstacle.

If the OP has the entire system on one partition then /etc/fstab could be deleted and the system should still boot.
ESTRAGON: We always find something, eh, Didi, to give us the impression we exist?
VLADIMIR (impatiently): Yes, yes, we're magicians.
User avatar
Head_on_a_Stick
 
Posts: 7893
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Accidentally deleted the /etc folder

Postby Head_on_a_Stick » 2018-02-24 18:13

sarksloane wrote:I don't know where to find my back up.

Debian doesn't backup automatically, you need to do this yourself.

Having a working backup strategy is the single most important thing to do on your computer, get something organised once you have fixed this mess.
ESTRAGON: We always find something, eh, Didi, to give us the impression we exist?
VLADIMIR (impatiently): Yes, yes, we're magicians.
User avatar
Head_on_a_Stick
 
Posts: 7893
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Accidentally deleted the /etc folder

Postby debiman » 2018-02-25 07:14

sarksloane, i wonder how you managed to accidentally delete all of it?
using a gui filemanager as root?
i just cannot imagine anyone entering 'rm -rf /etc' while being root...

anyhow, you learned two important lessons:

1) be careful. don't use gui apps as superuser, rather trust the terminal.
2) make backups before the shit hits the fan.
User avatar
debiman
 
Posts: 2809
Joined: 2013-03-12 07:18

Re: Accidentally deleted the /etc folder

Postby sarksloane » 2018-03-08 16:30

Thank you guys for all of your advise. This mistake was a definitely a very tremendous learning for me and indeed a very big lesson.

I did the re-installation from the beginning.
sarksloane
 
Posts: 75
Joined: 2017-01-17 04:21


Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 5 guests

fashionable