Results 1 to 6 of 6

Thread: Accidentally removed part of the /usr directory!

  1. #1
    Just burned his ISO
    Join Date
    Jun 2008
    Posts
    2

    Unhappy Accidentally removed part of the /usr directory!

    Allright, I'll be the wery first to say it. I am an complete and utter fool. I was trying to delete a directory within /usr/bin called usr so i started with the command cd /usr/bin next i figured that since I'm already in /usr/bin I will only need to issue rm -R /usr to get rid of the directory /usr/bin/usr and all files within it.

    It took me a few seconds to comprehend the mistake I had just made (I was naturally deleting the whole /usr directory and not the intended /usr/bin/usr one) and hit CTRL+C to end the process. By the time I interrupted the deleting process it had naturally worked its way through quite a few files (No idea how many but BT3 is still booting and my /usr directory is roughly 2.2 GB)

    At this point I was pretty much panicing, fearing to have to re-install BT3 re-make all my modifications/fixes/etc. and reinstall all additional programs. Anyway I crossed my fingers, said a quick prayer, and rebooted forcing a fsck at bootup. BT3 rebooted twice, doing some modification at the first time and reporting some inconsistency in the filestructure (d'oh). However much to my surprice no errors at the second bootup and I was already thinking I got away with a scare.

    No this is where my problems begin. Naturally since there are files missing some of my programs are not starting up anymore or not working correctly. Ettercap won't start up since it can't find etter.conf anymore, firefox isn't launching because libstdc++.so.5 seems to be gone kwrite is telling me that it fails to find gam_server and fails to connect to socket /tmp/fam-root-. Well to make a long story short quite a few programs have some kind of issue now, but many still work like nothing had ever happened.

    Now to my actual question: Will I be better of just biting down hard and reinstalling the whole system or is there any other way to solve the problem? (apart from reinstalling every single program with issues manually and all required dependencies as well that is). With windows you can run the installation cd and have it fix all missing system files but is there any similar possibility under linux? I only have experience of linux through BT3b which I have been running as my main and sole OS for roughly 4 moths now, and by the way simply love. So please do feel free to treat me as a noob . Any help will be greatly appreciated, and thank you for taking your time reading this long post.

  2. #2
    Junior Member MrWrong's Avatar
    Join Date
    Jan 2008
    Posts
    34

    Default

    why don't you just copy the usr directory from the install cd/dvd to the harddrive?

    I know there is a tutorial here on howto install BT3 from the command line. For the most part of that tutorial you are basically copying directories from the install media (about this point in the tutorial you go out for a cup of coffee if I remember right) to the hard drive.
    Wrong place
    Wrong time
    Wrong woman

  3. #3
    Senior Member
    Join Date
    Apr 2008
    Posts
    2,008

    Default

    Well I guess that this is the risk you take when you run BT under the root account

    However I think that the easiest way to fix it is indeed to copy the usr directory from the live CD as MrWrong suggested. I believe that the command that you will need to successfully do this without overwriting your pre-existing and added files is:

    Code:
    cp --preserve -R /usr /mnt/hda2
    You will need to do this booting from the live CD, not from your HD install. I am also assuming that you have BT3b installed on hda2, so you might need to change this. Let me know how it works out for you

    EDIT: I deleted my old recommendation as I figured out it would not work the way I had thought in the first place. The command posted now should work fine.
    -Monkeys are like nature's humans.

  4. #4
    Just burned his ISO
    Join Date
    Jun 2008
    Posts
    2

    Default

    Thanks guys for taking time to help me out. i am happy to be able to say that there was no need to reinstall backtrack, as the command posted by Tron sorted out my problems

    Thanks again!

  5. #5
    My life is this forum thorin's Avatar
    Join Date
    Jan 2010
    Posts
    2,629

    Default

    Quote Originally Posted by -=lux=- View Post
    Allright, I'll be the wery first to say it. I am an complete and utter fool. I was trying to delete a directory within /usr/bin called usr so i started with the command cd /usr/bin next i figured that since I'm already in /usr/bin I will only need to issue rm -R /usr to get rid of the directory /usr/bin/usr and all files within it.
    Gotta hate missing a period, so simple yet painful if missed.
    Code:
    rm -R ./usr
    On the upside it was your machine not some production server that you killed.
    I'm a compulsive post editor, you might wanna wait until my post has been online for 5-10 mins before quoting it as it will likely change.

    I know I seem harsh in some of my replies. SORRY! But if you're doing something illegal or posting something that seems to be obvious BS I'm going to call you on it.

  6. #6
    Senior Member
    Join Date
    Apr 2008
    Posts
    2,008

    Default

    So true, I guess missing a period is something that can have quite daunting consequences both for boys and girls
    -Monkeys are like nature's humans.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •