Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 08 Sep 2013 10:07:39 +0100
From:      Frank Leonhardt <freebsd-doc@fjl.co.uk>
To:        freebsd-questions@freebsd.org
Subject:   Re: ufs recovery
Message-ID:  <522C3E5B.3070005@fjl.co.uk>
In-Reply-To: <58B8F61A39614B629030FE4BE8DDF33B@yahoo.com>
References:  <58B8F61A39614B629030FE4BE8DDF33B@yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 08/09/2013 09:46, Laszlo Danielisz wrote:
> Hi,
>
> By mistake I forgot to edit my crontab on my FreeBSD 8.3 after I took out one of the hard drives.
> I had a little rsync script which I used to synchronise a directory between those two hard drives, because one of the hard drives were not present anymore and rsync had the --delete parameter I end up deleting the whole directory, of course with precious informations.
>
> I have ufs on the hdd, after the "accident" I've turned off the computer to avoid any writings on the disk.
> Do you have any idea how can I recover the lost directory?
>
> Thank you!
> Laci
>

Hi Laci,

I'm sorry to have to tell you that recovering UFS is not easy. It's not 
like MS-DOS or NFTS at all in that respect. When you delete from UFS it 
removes inode data and adds the space released to the free block list. 
It's a one-way process; there is no journalling and no way to undo any 
of it.

I don't know of any public domain utilities that will do what you need. 
EnCase can do something with UFS, and a utility called "Raise Data 
Recovery" will get stuff from damaged disks. This isn't the same as 
getting back deleted files.

The only option I've ever found to work is to scan the disk's free 
blocks (all of them in your case) with a utility that recognises 
specific file formats and pieces the file together using the contents it 
reads from each block, using "best guess" and manual choice to decide 
which the next block is. This is no joke if you've lost a lot of files, 
but worth it if you have one or two vital ones amongst them.

Sorry I can't be of any more comfort. As I'm sure someone will chip in, 
there are things you can do before the event.

Regards, Frank.






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?522C3E5B.3070005>