LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-11-2008, 12:30 AM   #1
ARsenthil
LQ Newbie
 
Registered: Nov 2006
Posts: 23

Rep: Reputation: 15
Wrongly removed /bin with rm -rf /bin


I have removed wrongly the /bin dir in Redhat el4.Instead of removing /media/usb/bin i cd to /media/usb
and did rm -rf /bin it removed every thing .The root also is denied from login ,How to solve this problem,please help me,it is urgent.
Thanks.
 
Old 03-11-2008, 12:47 AM   #2
v00d00101
Member
 
Registered: Jun 2003
Location: UK
Distribution: Devuan Beowulf
Posts: 514
Blog Entries: 1

Rep: Reputation: 37
Reinstall RHEL4.

I wouldnt even bother trying to reconstruct the /bin dir without a decent system backup. It will be quicker to reinstall the OS, than try and work out some way to copy the bin files back in.

If on the other hand like the good sys admin you are, you made a full system backup when you first installed, then simply copy the backup /bin files back to the directory from a rescue cd, as cp and mv are also in /bin as i remember.

Maybe someone else can suggest something.
 
Old 03-11-2008, 01:04 AM   #3
nigelc
Member
 
Registered: Oct 2004
Location: Sydney, Australia
Distribution: Mageia 7
Posts: 406
Blog Entries: 4

Rep: Reputation: 80
Heello,
you maybe able to get it/them from the boot cd disk.

But, then it is probably better to re-install the whole system
 
Old 03-11-2008, 08:05 AM   #4
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Ok, first of all, don't title your threads "very urgent", it does nothing to speed up responses but rather slow responses down. There is no priority on threads on a free forum, so make more descriptive titles so members that come here in their copious amounts of free time to help people like you know what your actual thread is about.

Now about your /bin directory and you mistakenly removing it, in the future do rm's with the full path to the directory or file you want to remove, do this after slapping yourself a few times for being dumb and removing your /bin directory.

Now, if you have a RHEL 4 cd that was maybe used to install this OS, use that to boot into rescue mode and repair the problem. Or if you have another RHEL system that is identical to this one, copy over the /bin directory from it to at least get a working machine back up. If none of these are possible and you have no backups, then it's reinstall time.
 
Old 03-14-2008, 04:54 PM   #5
hasanatizaz
Member
 
Registered: Nov 2007
Location: Pakistan
Distribution: Redhat and Debian
Posts: 317
Blog Entries: 1

Rep: Reputation: 35
same thing was done by me accidently, at that time i didnt know about single mode ( init1 ) i had to reinstall.
 
Old 03-14-2008, 04:59 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,120

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
And just to back up tricky, I wouldn't even be reading this thread if it (still) had "urgent" in the title.

Nothing to add to previous suggestions though.
 
Old 03-14-2008, 05:21 PM   #7
dxqcanada
Member
 
Registered: Sep 2006
Location: Canada
Distribution: Gentoo
Posts: 702

Rep: Reputation: 43
In the future you might want to add an alias to your profile:
Code:
alias rm="rm -i"
 
Old 03-14-2008, 05:36 PM   #8
hasanatizaz
Member
 
Registered: Nov 2007
Location: Pakistan
Distribution: Redhat and Debian
Posts: 317
Blog Entries: 1

Rep: Reputation: 35
@dxqcanada
alias rm="rm -i" ( rm -i )doesnt work when you use rm with -rf
 
Old 03-14-2008, 06:51 PM   #9
dxqcanada
Member
 
Registered: Sep 2006
Location: Canada
Distribution: Gentoo
Posts: 702

Rep: Reputation: 43
Hmmm, that blows that safety net.

Code:
Any previous occurrences of the -i option shall be ignored.

Last edited by dxqcanada; 03-14-2008 at 06:53 PM. Reason: forgot something
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to add paths to sbin, bin/bash, bin sh for users gopi.d Fedora 3 12-07-2007 12:47 AM
sudo /usr/bin/chroot /home/chroot /bin/su - xxx| /bin/su: user xxx does not exist saavik Linux - General 3 07-04-2007 10:30 AM
Installing .bin-files, leave the file in /usr/local/bin/ ? lagu2653 Linux - Software 1 11-08-2005 08:30 PM
bin/bash:usr/bin/lpr NO SUCH FILE OR DIRECTORY Adibe_Hamm Linux - Newbie 3 10-14-2003 02:30 AM
Newbie needs help Installing j2sdk-1_4_2-nb_3_5_1-bin-linux.bin bendoku Linux - Newbie 5 10-11-2003 09:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:04 PM.

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