From owner-freebsd-questions@FreeBSD.ORG Sat Sep 19 08:43:26 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF941106566C for ; Sat, 19 Sep 2009 08:43:26 +0000 (UTC) (envelope-from rsmith@xs4all.nl) Received: from smtp-vbr14.xs4all.nl (smtp-vbr14.xs4all.nl [194.109.24.34]) by mx1.freebsd.org (Postfix) with ESMTP id 2AD7F8FC08 for ; Sat, 19 Sep 2009 08:43:25 +0000 (UTC) Received: from slackbox.xs4all.nl (slackbox.xs4all.nl [213.84.242.160]) by smtp-vbr14.xs4all.nl (8.13.8/8.13.8) with ESMTP id n8J8hO57064384; Sat, 19 Sep 2009 10:43:24 +0200 (CEST) (envelope-from rsmith@xs4all.nl) Received: by slackbox.xs4all.nl (Postfix, from userid 1001) id 64D3DBA95; Sat, 19 Sep 2009 10:43:24 +0200 (CEST) Date: Sat, 19 Sep 2009 10:43:24 +0200 From: Roland Smith To: jaymax Message-ID: <20090919084324.GB51231@slackbox.xs4all.nl> References: <25498179.post@talk.nabble.com> <20090918052422.GA8637@slackbox.xs4all.nl> <25518685.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="kXdP64Ggrk/fb43R" Content-Disposition: inline In-Reply-To: <25518685.post@talk.nabble.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.20 (2009-06-14) X-Virus-Scanned: by XS4ALL Virus Scanner Cc: freebsd-questions@freebsd.org Subject: Re: Undelete or recover from badblocks on disks X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Sep 2009 08:43:26 -0000 --kXdP64Ggrk/fb43R Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Sep 18, 2009 at 10:17:31PM -0700, jaymax wrote: >=20 > Thanks Roland,=20 > smartctl showed disk to be fine! > fls requires a disk image, is there one created by default in FreeBSD 6.0= .=20 No, you have to create one. > Running fls in directory of deleted files/dir produced >=20 > > #fls -adr 2 > > Missing image file names (img_open) > >=20 >=20 > Is there a solution to this ? Create a disk image from the damaged drive, and save it on another disk with enough space. You can use dd(1) to create a disk image. You can devide the image into several files. For example, I will use dd to get two consecutive= 10 MiB pieces from a disk partition on a USB stick: # dd if=3D/dev/da0s1 of=3Ddd1.img bs=3D1m count=3D10 10+0 records in 10+0 records out 10485760 bytes transferred in 1.031497 secs (10165575 bytes/sec) # dd if=3D/dev/da0s1 of=3Ddd2.img bs=3D1m count=3D10 iseek=3D10 10+0 records in 10+0 records out 10485760 bytes transferred in 1.021128 secs (10268799 bytes/sec) Without specifying it, dd uses 512 byte blocks. This can take along time, because dd then needs to do a lot of small reads. Therefore I tend to speci= fy a larger block size. Note that 'bs=3D1m count=3D10' reads the save amount o= f data as 'bs=3D10m count=3D1' and 'bs=3D1k count=3D10240'. Using a larger blocksi= ze will usually mean faster reads, but I do not know what the practical limits to block sizes are. I would not start by using 'bs=3D1g', though. The (valid, IMHO) reason for using disk images is that you want to investig= ate a copy of the data, so you cannot accidentily destroy the original data. Roland --=20 R.F.Smith http://www.xs4all.nl/~rsmith/ [plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated] pgp: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 (KeyID: C321A725) --kXdP64Ggrk/fb43R Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.13 (FreeBSD) iEYEARECAAYFAkq0mawACgkQEnfvsMMhpyWG9ACfWzT05vbi7kXO1M7VL02yNMmA 8HwAoJ3yUgVc90VvLriD0hQ63zENwM+Z =u9NX -----END PGP SIGNATURE----- --kXdP64Ggrk/fb43R--