undo rm -rf *

Bill Oliver vendor at billoblog.com
Tue Mar 26 17:28:46 UTC 2013


The "dd" command is a workhorse, sorta like netcat.  The answer to "can you use if for copying/backing up XXX" is essentially always "yes."  However, it's not convenient for some things. For instance, it copies *files.*  Even though the old unix cant is that "everything is a file," it turns out that you sometimes have to play around for file-oriented utilities to play well with directories -- I don't think there's a recursive option for dd.

I don't use dd for backups where I don't want a disk or partition image because I don't want to backup everything, I don't want bit-for-bit backups of individual files (as I remember, dd will back up slack space as well as the file itself), and other tools are more friendly.  Rsync is my friend. As with most things in linux, there are 15 ways to do anything, and which is "best" depends on the circumstances, taste, and effort.  Sometimes it's easier to use a slightly less efficient tool you know well than a more efficient one you don't.

However, dd gurus often find a way for using it for everything, it seems.  Here's a nice review:

http://www.thegeekstuff.com/2010/10/dd-command-examples/

and

http://endlessparadigm.com/forum/showthread.php?tid=8016


billo

On Wed, 27 Mar 2013, Celik wrote:

> 
> 
> On Wed, Mar 27, 2013 at 1:49 AM, Bill Oliver <vendor at billoblog.com> wrote:
>
>       The last time this happened to me, I had some luck using sleuthkit:
>
>       http://www.sleuthkit.org/
>
>       As you noted, installing new things on your computer is destructive to deleted files.  It's a good idea, if
>       you can, to make an image of your disk asap and then work on that image.  What I have done is put a live
>       distro on a flash drive, boot from the live distro, dd the native disk to an external drive, and then run
>       the recovery utils on the image.
>
>       billo
> 
> 
> Bill, re-did the work. Because it was fresh in my mind, it didn't take as long.
> 
> The tasks you have mentioned (i.e. making an image of disk and dd) are new to me. I'll try to follow the steps with some
> dummy files on my laptop. The laptop is for testing new programs if anything goes wrong won't cause much heart-ache.
> 
> Please excuse me if this going to be a silly question, so can we use dd for making backups of our files/computer? or can
> we make an image of our disk solely for a backup purpose?
> 
>  
>
>       On Wed, 27 Mar 2013, Celik wrote:
> 
> 
>
>             On Tue, Mar 26, 2013 at 10:37 PM, Gary Stainburn <gary.stainburn at ringways.co.uk> wrote:
>                   There are a number of utilities that will attempt this for you.
>                   Google "undelete ext4 linux" assuming your filesystem is ext4.
> 
>
>             Gary, thank you for the information. Installed testdisk and exundelete. In the process most
>             likely substantially
>             decreased any chance of recovering the files. Tried exundelete but couldn't get it to work. Will
>             figure out how to use
>             the programs just in case needed in the future.
>
>             Meanwhile, lost only few hours of work.
>
>             Anyhow, thanks for the support.
> 
>
>              
>                   However, as your system is used the now unallocated space is being re-used
>                   reducing any your chances of success.  Even installing an uninstall utility
>                   will do this, as would switching to single user or shutting down.
>
>                   Even if you do nothing, the services in the background will be updating the
>                   filestore,
>
>                   On Tuesday 26 March 2013 11:23:29 Celik wrote:
>                   > Hi,
>                   >
>                   > Had a logic error in my bash script and did "rm -rf *" on my current
>                   > working directory. Any tips for undoing such an error?
>                   >
>                   > Regards,
>                   > C
> 
> 
>
>             --
>             Gary Stainburn
>             Group I.T. Manager
>             Ringways Garages
>             http://www.ringways.co.uk
>             --
>             users mailing list
>             users at lists.fedoraproject.org
>             To unsubscribe or change subscription options:
>             https://admin.fedoraproject.org/mailman/listinfo/users
>             Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
>             Have a question? Ask away: http://ask.fedoraproject.org
> 
> 
> 
> 
> --
> users mailing list
> users at lists.fedoraproject.org
> To unsubscribe or change subscription options:
> https://admin.fedoraproject.org/mailman/listinfo/users
> Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
> Have a question? Ask away: http://ask.fedoraproject.org
> 
> 
> 
>


More information about the users mailing list