Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Accidentally deleted the /etc folder

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
sarksloane
Posts: 89
Joined: 2017-01-17 04:21

Accidentally deleted the /etc folder

#1 Post by sarksloane »

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.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: Accidentally deleted the /etc folder

#2 Post by Head_on_a_Stick »

Restore your backup.

Use this to preserve ACLs and other permissions:

Code: Select all

rsync -aAXv $source $destination
deadbang

sarksloane
Posts: 89
Joined: 2017-01-17 04:21

Re: Accidentally deleted the /etc folder

#3 Post by sarksloane »

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: 89
Joined: 2017-01-17 04:21

Re: Accidentally deleted the /etc folder

#4 Post by sarksloane »

Please i do really need your help..

Bulkley
Posts: 6386
Joined: 2006-02-11 18:35
Has thanked: 2 times
Been thanked: 39 times

Re: Accidentally deleted the /etc folder

#5 Post by Bulkley »

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.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: Accidentally deleted the /etc folder

#6 Post by Head_on_a_Stick »

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.
deadbang

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: Accidentally deleted the /etc folder

#7 Post by Head_on_a_Stick »

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.
deadbang

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: Accidentally deleted the /etc folder

#8 Post by debiman »

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 crap hits the fan.

sarksloane
Posts: 89
Joined: 2017-01-17 04:21

Re: Accidentally deleted the /etc folder

#9 Post by sarksloane »

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.

Post Reply