From owner-freebsd-questions@FreeBSD.ORG Sun Sep 8 22:04:02 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 45C032C1 for ; Sun, 8 Sep 2013 22:04:02 +0000 (UTC) (envelope-from rsmith@xs4all.nl) Received: from smtp-vbr12.xs4all.nl (smtp-vbr12.xs4all.nl [194.109.24.32]) by mx1.freebsd.org (Postfix) with ESMTP id B8F0C23EC for ; Sun, 8 Sep 2013 22:04:01 +0000 (UTC) Received: from slackbox.erewhon.net (slackbox.xs4all.nl [213.84.242.160]) by smtp-vbr12.xs4all.nl (8.13.8/8.13.8) with ESMTP id r88M3rr1077659; Mon, 9 Sep 2013 00:03:53 +0200 (CEST) (envelope-from rsmith@xs4all.nl) Received: by slackbox.erewhon.net (Postfix, from userid 1001) id E2D96123F1; Mon, 9 Sep 2013 00:03:52 +0200 (CEST) Date: Mon, 9 Sep 2013 00:03:52 +0200 From: Roland Smith To: Laszlo Danielisz Subject: Re: ufs recovery Message-ID: <20130908220352.GA43450@slackbox.erewhon.net> References: <58B8F61A39614B629030FE4BE8DDF33B@yahoo.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SUOF0GtieIMvvwua" Content-Disposition: inline In-Reply-To: <58B8F61A39614B629030FE4BE8DDF33B@yahoo.com> X-GPG-Fingerprint: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 X-GPG-Key: http://www.xs4all.nl/~rsmith/pubkey.txt X-GPG-Notice: If this message is not signed, don't assume I sent it! User-Agent: Mutt/1.5.21 (2010-09-15) X-Virus-Scanned: by XS4ALL Virus Scanner Cc: FreeBSD Questions X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Sep 2013 22:04:02 -0000 --SUOF0GtieIMvvwua Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Sep 08, 2013 at 10:46:35AM +0200, Laszlo Danielisz wrote: > Hi, >=20 > 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. Ouch. I have a similar procedure going. But I put it in a shell-script that mounts the destination _and_ checks if the destination is properly mounted = _before_ starting the rsync. I would suggest you do something similar in the future. Just to be clear, was the information deleted from _both_ harddisks? > 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 t= he > lost directory? Do you perhaps have a snapshot of the filesystem in question available? If = so, you can mount that and restore the files from it. See e.g.: http://www.freebsd.org/doc/handbook/snapshots.html If all else fails, have a look at sysutils/sleuthkit. Restoring deleted fil= es on UFS is very difficult, but you can find some pointers here: http://wiki.sleuthkit.org/index.php?title=3DFS_Analysis#Manual_Deleted_File= _Recovery It helps if you know what kind of data is contained in the deleted file. To prevent this from happening again, make regular backups e.g. to an exter= nal harddisk that you use for that purpose alone. Roland --=20 R.F.Smith http://rsmith.home.xs4all.nl/ [plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated] pgp: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 (KeyID: C321A725) --SUOF0GtieIMvvwua Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.21 (FreeBSD) iEYEARECAAYFAlIs9EgACgkQEnfvsMMhpyXnpACfaLEIgPNcNc8s30bJr3nVQlyb DwQAnA7vNYWnDiE90ndy4yADOd9EeWUC =c2ki -----END PGP SIGNATURE----- --SUOF0GtieIMvvwua--