Results 1 to 7 of 7
well my friend/coworker was trying to copy some new code over to our machine a and apparntly deleated /bin instead of bin. The computer was already shut down before we ...
- 07-16-2009 #1Just Joined!
- Join Date
- Jun 2009
- Posts
- 10
deleted /bin directory
well my friend/coworker was trying to copy some new code over to our machine a and apparntly deleated /bin instead of bin. The computer was already shut down before we figured out what had happened. Now I have to figure out how to repair it without reinstalling.
I have a laptop with the same os and archetecture so I thought I could just copy the bin folder from my laptop over to the desktop. The problem is I can't seem to mount anything. I put in the boot disk and start up the rescue mode fine. But when I try to mount neither the cdrom nor my usb drive appears in the /dev.
is it possible to mount something to copy the bin over, or does the rescue mode not support mounting? I would really prefer not to reinstall if I don't have to, it took awhile to get this computer configured the way we liked and I'm not sure I can remember all the steps.
Thanks for the help!
- 07-16-2009 #2Linux Guru
- Join Date
- Nov 2004
- Posts
- 6,110
I would try and do it all via a live cd. It doesn't matter what distribution as long as you can mount the partition /bin is on. At that point you can just drag and drop, making sure to set root as the owner if it is changed.
- 07-16-2009 #3Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
It could be worse. I think nuking /etc would be harder to recover from since that's where a lot of your system configuration files live. This is a good example of why it is wise to do a bit-image backup of your system disc before you make major updates to the system. Just in case you encounter one of these "Homer" moments that we all experience from time to time. Doh!
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 07-17-2009 #4Just Joined!
- Join Date
- Jun 2009
- Posts
- 10
thanks for the responses, but I'm still a bit stuck. The bin directory I have is on a laptop and needs to be moved over to the desktop. I don't know how to mount anything to do that. I boot into rescue mode but neither the cd-rom or the usb drive I attempt to use are detected in the /dev directory and without that I don't know how to mount. I really have no clue how the /dev directory gets populated with new devices or how to manualy cause that to happen.
I am a bit short on USB ports. I have two and I have to use one for a mouse and one for a cdrom, which means when I try to use either a cdrom or usb I have to remove the boot disk I had used. I don't know if it's not detecting the new device because it needs files from the boot disk and it can't access it?
- 07-17-2009 #5Just Joined!
- Join Date
- Jun 2009
- Posts
- 10
actually as an update I looked up ways to manually mount my cdrom, and they all failed so I decided to mes around even more. I copied all the files from the /usr/bin directory created in rescue mode (the temporary one that only exists while in rescue) to /mnt/sysimage/bin and tried rebooting.
Not sure if it worked yet. I can boot up now but it asks me for localhost login and it dosn't accept the superuser or usr loging of the system. I hope that is just because of my hack and the user info is still in there somewhere...
- 07-17-2009 #6Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
You can get a usb hub that you can plug the mouse and a thumb drive to copy the /bin directory from the laptop. Frye's, Best Buy, et al will have such for under $30USD. You don't need to boot the munged system from the boot disc. Boot a rescue or live CD. Then, boot the munged system with the rescue/live CD and copy the data from the thumb drive.
So the process goes like this:
1. Get a usb hub and thumb drive.
2. Plug hub into laptop.
3. Plug mouse and thumb drive into hub.
4. Boot laptop to Linux.
5. Copy /bin to thumb drive
6. Shut down laptop.
7. Plug hub into munged system.
8. Plug mounse into hub.
9. Boot munged system from rescue/live CD
10. Login as root.
11. Plug in thumb drive.
12. If necessary, mount thumb drive (if you are in text mode). Note, /dev/sdx below is the device id of the thumb drive - probably /dev/sdb or such, and the 1 is the partition number:
13. Copy /mnt/thumb contents to /bin.Code:mkdir /mnt /mnt/thumb mount /dev/sdx1 /mnt/thumb
14. Shutdown, remove thumb drive, and reboot system.Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 07-17-2009 #7Just Joined!
- Join Date
- Jun 2009
- Posts
- 10
the problem was the /dev/sdx (actually sda for my thumbdrive) wasn't appearing.
I actually got around that though. By copying the /usr/bin directory created by the rescue mode I managed a partial bootup into single user mode. enough to allow me to mount the cdrom and copy a proper bin directory from my laptop. Now everything is booting up and looks correctly; unfortunatly it turns out something is still wrong.
If i log in as a regular usr I cant su or su root (it prompts for password but dosn't accept the root password). I can log in to root though.both of my ethernet drives are not detected either.
Also when I tried running vnc it complained about not having a license file, which I had already provided, and when I tried to reinput the liscene file it complained about not being able to find a file it neeed (something like getMacaddress). I don't know if this is realated to the ethernet issue, but I suspect it is another symptom of my configuration being messed up somehow.
I suspect if I figured out why i can't use su it would point me to the source of the other problems. I did check my hosts files (as was suggested online as potentially causing trouble for the su command) but they are all unchanged and look correct. any idea what may have gone wrong or how to fix it?


Reply With Quote