Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Jan 2003 14:21:28 -0500
From:      Bill Moran <wmoran@potentialtech.com>
To:        bastill@adam.com.au
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Deleted files
Message-ID:  <3E2AFAB8.7000508@potentialtech.com>
References:  <1042951588.3e2a2da491b10@webmail.adam.com.au>

next in thread | previous in thread | raw e-mail | index | archive | help
bastill@adam.com.au wrote:
> I made a boo-boo!
> Two in fact!  :-)
> In transferring directories from one disk to another using dump | restore I
> forgot at one point to cd and put a number of directories into the wrong partition.
> So I deleted the wrong directories using rm -rf directoryname.
> Unfortunately deleting the wrongly transferred directory "home" in this way
> deleted the SOURCE /usr/home as well <sob>
> Is there any way at all I can recover the deleted files and subdirectories in
> the source location?

First thing you want to do is unmount the filesystem that has the deleted files
and make absolutely sure no more writing is done to the filesystem.

At that point, you can work on the raw device or make an image of the filesystem
to work on.  You probably want to make a backup image of the filesystem before
doing any work, regardless.

At this point, I don't know the details, but it basically involves knowing how
the ufs filesystem works so you can hunt through it and find the deleted data.
Like most filesystems, UFS doesn't actually remove anything when you delete
files (unless you use rm -s) it simply marks the space as free.  As long as
you haven't written anything to the filesystem since you deleted the files,
there's a good chance that the data is still there.

There was a tutorial somewhere on the net on recovering deleted files, but
when I searched, this (http://www.tu-ilmenau.de/~mojo/undelete.html) was the
best I found.  I don't know the details of how to search through the blocks
and find the missing data, so I can't help you there.

I'm assuming that you didn't make backups before starting the conversion process,
or you wouldn't be asking this question.  But the canonical answer to your
question is "restore from backup".  Recovering deleted files is a lot of work.

-- 
Bill Moran
Potential Technologies
http://www.potentialtech.com


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3E2AFAB8.7000508>