Find the answer to your Linux question:
Results 1 to 5 of 5
Hi, I have deleted my system folders while I was under root (all folders there, /bin, /home, etc.). I have loaded a live cd (of ubuntu), and I am able ...
  1. #1
    Just Joined!
    Join Date
    Sep 2008
    Posts
    32

    How to use a live cd to recover deleted folders/files of linux ?

    Hi,

    I have deleted my system folders while I was under root (all folders there, /bin, /home, etc.). I have loaded a live cd (of ubuntu), and I am able to see the files
    and folders in my linux and windows partitions. I can open most of
    them, however, when I try to do this with the folders root and
    home/my_user_name of the linux partition, I cannot open and copy/paste them,
    because I don't have permissions to do so. Do you know how can I do
    this? It doesn't prompt me to enter any password. (My linux distribution was Slackware.)

    When I open a terminal in ubuntu now, I see/have access to the default
    ubuntu folders, but not to the partitions (and their folders).


    I don't know how to go to the home/my_user_name and the root folder of the slackware partition via the console.
    Now if I open a terminal (I am in the ubuntu of the live cd), the prompt (or user name) is:
    ubuntu@ubuntu:~$
    and when I type
    ubuntu@ubuntu:~$ ls
    then I see just the following folders: Documents, Music, Pictures,
    Videos, Public, Templates, und Desktop. All of them are empty, except Desktop, where I have a folder called Examples and a file ubiquity-gtkui.desktop.
    What I am wondering about is that I can see and access the Windows and Linux partitions, and also my usb stick, from my Desktop, however, I cannot see and access from the Desktop directory, when I changed to it in the terminal. On the contrary, I can see Example folder there (I see it on the Desktop, and in the terminal).

  2. #2
    Linux Guru
    Join Date
    Oct 2007
    Location
    Tucson AZ
    Posts
    1,939
    First step would be to use your Ubuntu Live CD and run the command: sudo fdisk -l and post the output here. You should then be able to get help with specific commands to use the Live CD to create a directory and mount your partitions so you can save your files.

  3. #3
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,970
    So, you ran "rm -rf /*"? Or "rm -rf /"? If so, you are probably SOL. There is an application ext3undel that sometimes will work, but I haven't tried it in such a catastrophic situation. In any case, now you know why normal operation as root in Linux/Unix systems is STRONGLY discouraged! In any case, what you did is considered a learning experience, and one which you probably won't repeat...
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  4. #4
    oz
    oz is online now
    forum.guy
    Join Date
    May 2004
    Location
    arch linux
    Posts
    18,093
    How to use a live cd to recover deleted folders/files of linux ?
    Sometimes, testdisk and/or photorec can recover various files but I don't know that either will help with your particular issues. Both applications come on the Parted Magic LiveCD if you should want to try them to see what happens.
    oz

    new members/users: read this first | new member faq
    no private messages requesting computer support - post them on the forums!
    please use the "report post" button to alert our forum admins to problematic posts rather than responding to them yourself.

  5. #5
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,970
    Quote Originally Posted by Rubberman View Post
    So, you ran "rm -rf /*"? Or "rm -rf /"? If so, you are probably SOL. There is an application ext3undel that sometimes will work, but I haven't tried it in such a catastrophic situation. In any case, now you know why normal operation as root in Linux/Unix systems is STRONGLY discouraged! In any case, what you did is considered a learning experience, and one which you probably won't repeat...
    I should know - as they say, I've been there and done that. In any case, that is one of the reasons why Ubuntu doesn't enable the root account by default, which means that all super-user account activities have to be done with sudo. Just that extra bit can make the user think for a second about what they are doing. We do understand your pain, and as much as we can we will help you try and recover your system. Just be aware that it might not be possible and that you should reconcile yourself with the possibility that you are facing reinstallation of the system and restoring user data from whatever backups are available.

    I have made it a standard procedure for me to do the following to ensure that this sort of error (we all make them, usually when tired and under some sort of "dead"line):
    Code:
    1. Make a backup bit-image copy of the system boot disc to an external USB or eSata
    drive on a regular basis. This image can be used to restore the system with a recovery/live CD
    quite easily and fairly quickly, usually less than an hour or two.
    2. Keep /home and all the associated user directories on a separate hard drive and make
    incremental backups regularly, to an external RAID-5 storage array on the network
    (not attached to the local system except via ethernet).
    These two simple steps allow me to recover my critical systems quickly and easily, even if I make a major muck-up, like trying to remove the entire file system.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

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