Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 Sep 2009 10:43:24 +0200
From:      Roland Smith <rsmith@xs4all.nl>
To:        jaymax <jaymax36@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Undelete or recover from badblocks on disks
Message-ID:  <20090919084324.GB51231@slackbox.xs4all.nl>
In-Reply-To: <25518685.post@talk.nabble.com>
References:  <25498179.post@talk.nabble.com> <20090918052422.GA8637@slackbox.xs4all.nl> <25518685.post@talk.nabble.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



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