LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-22-2009, 08:01 AM   #1
jastazv
LQ Newbie
 
Registered: Feb 2009
Posts: 7

Rep: Reputation: 0
Accidentally rc0.d directory removed!!!


Hi everybody.

I was trying to remove the networking service at run level 0.
I wrote:
Code:
/etc/rc0.d/$ sudo rm * networking
Accidentally I put the space between the * and the networking word.

It is possible to recover the deleted files?

It is some backup available to load from the system?

Does anybody know a generic rc0.d directory then I could use update-rc.d for linking again the services to rc0.d directory?

Any help will be really appreciated...
 
Old 02-22-2009, 09:36 AM   #2
zedmelon
Member
 
Registered: Jun 2004
Location: colorado, USA
Distribution: slack, oBSD
Posts: 119

Rep: Reputation: 24
Unless you've specifically made adjustments to your system, there's no convenient way to recover deleted files. The upside of Linux/UNIX is, it gives you complete control over your system. The downside is, it assumes you know what you're doing and will avoid mistakes.

(Don't feel bad; we've all suffered through losing files or other lost time through typos and other mistakes.)

Your installation media might be a good place to start, although it's likely compressed into a huge tarball. Get ready to do some digging.

There are probably utilities which will let you dig into the data still on your drive. I believe that it's fairly universal that files aren't actually removed, just the pointer.

What distro are you using?
 
Old 02-22-2009, 10:27 AM   #3
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,669

Rep: Reputation: 498Reputation: 498Reputation: 498Reputation: 498Reputation: 498
remove?

jastazv:

you don't remove 'networking' service to go down rlevl.0 -- at run level 0 all (not only networking) are given sigterm signals and are given time to wind up their business toward shutdown. Much more you don't need to issue a root 'rm *' thats not necessary. The best and smartest way to reach your goal is to salute: Ctl+Alt+Del.

Upon reboot your system is restored.

Go in peace. You have committed no mortal sin against your system.
 
Old 02-22-2009, 09:26 PM   #4
zedmelon
Member
 
Registered: Jun 2004
Location: colorado, USA
Distribution: slack, oBSD
Posts: 119

Rep: Reputation: 24
Quote:
Originally Posted by malekmustaq View Post
jastazv:
Upon reboot your system is restored.
malekmustaq, you're right about the runlevel 0 stuff, but unless I'm reading this wrong, jastazv has already deleted the files by mistake. This won't be restored for him when he reboots; he'll have to replace them or reinstall.

jastazv, what version/distro are you running? Someone might be able to just .tgz their own directory and put it somewhere for you, which would give you a good start.
 
Old 02-23-2009, 12:37 AM   #5
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 676

Rep: Reputation: 137Reputation: 137
Quote:
Originally Posted by jastazv View Post
Hi everybody.

I was trying to remove the networking service at run level 0.
I wrote:
Code:
/etc/rc0.d/$ sudo rm * networking
Accidentally I put the space between the * and the networking word.

It is possible to recover the deleted files?

It is some backup available to load from the system?

Does anybody know a generic rc0.d directory then I could use update-rc.d for linking again the services to rc0.d directory?

Any help will be really appreciated...
Usually rc?.d directories contains no actual files but links to the files in /etc/init.d or /etc/rc.d/init.d
So you can just symlink again whatever you ant stopped on runlevel 0.

Even more simple - rc6.d and rc0.d is (nearly) identical, so you can copy links from rc6 to rc0
 
Old 02-25-2009, 01:41 PM   #6
jastazv
LQ Newbie
 
Registered: Feb 2009
Posts: 7

Original Poster
Rep: Reputation: 0
Thank you very much to everybody that have replied this thread. I copied the lynks of rc6.d directory but it did'nt work; that only caused that either only halts or reboots.

Excuse me that I didnīt mentioned my distro. My box is running Debian GNU/Linux 5.0, Lenny.

I looked for rc0.d directory schemes in fedora and ubuntu. I made the aproppiated lynks but I didnīt work.

Finally, I saw that I was spending more time trying to solve the problem that way than reintalling the root partition, so I reinstalled.

This is a experience that taught me that I should have a backup of that important files. So, the first thing that I made was copying the /boot, /etc/init.d, /etc/rc* to my home.

Well, that's the story. Again, I really appreciate your posts. Good look GNU/Linux people.
 
Old 02-25-2009, 01:43 PM   #7
jastazv
LQ Newbie
 
Registered: Feb 2009
Posts: 7

Original Poster
Rep: Reputation: 0
Thank you very much to everybody that have replied this thread. I copied the links of rc6.d directory but it did'nt work; that only caused that either only halts or reboots.

Excuse me that I didnīt mentioned my distro. My box is running Debian GNU/Linux 5.0, Lenny.

I looked for rc0.d directory schemes in fedora and ubuntu. I made the aproppiated lynks but I didnīt work.

Finally, I saw that I was spending more time trying to solve the problem that way than reintalling the root partition, so I reinstalled.

This is a experience that taught me that I should have a backup of that important files. So, the first thing that I made was copying the /boot, /etc/init.d, /etc/rc* to my home.

Well, that's the story. Again, I really appreciate your posts. Good look GNU/Linux people.
 
Old 02-25-2009, 01:44 PM   #8
jastazv
LQ Newbie
 
Registered: Feb 2009
Posts: 7

Original Poster
Rep: Reputation: 0
Thank you very much to everybody that have replied this thread. I copied the links of rc6.d directory but it did'nt work; that only caused that either only halts or reboots.

Excuse me that I didnīt mentioned my distro. My box is running Debian GNU/Linux 5.0, Lenny.

I looked for rc0.d directory schemes in fedora and ubuntu. I made the aproppiated links but I didnīt work.

Finally, I saw that I was spending more time trying to solve the problem that way than reintalling the root partition, so I reinstalled.

This is a experience that taught me that I should have a backup of that important files. So, the first thing that I made was copying the /boot, /etc/init.d, /etc/rc* to my home.

Well, that's the story. Again, I really appreciate your posts. Good look GNU/Linux people.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Accidentally removed shadow package hussar Slackware 3 12-24-2005 06:31 AM
accidentally removed /dev/cdrom verbose Linux - General 18 10-26-2005 03:44 PM
I accidentally removed the netstat command ! markraem Solaris / OpenSolaris 6 10-03-2005 10:18 AM
newbie - removed partition accidentally kristalchimera Debian 6 07-12-2003 11:36 PM
I accidentally removed lilo from my bootsector. Grafbak Linux - Newbie 2 06-20-2003 03:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration