History log of /freebsd-current/sbin/recoverdisk/recoverdisk.c
Revision Date Author Comments
# b3e76948 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: two-line .h pattern

Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/


# d21ce74d 01-Feb-2021 Poul-Henning Kamp <phk@FreeBSD.org>

Register the bad read before bailing on terminal errors.

This way running recoverdisk in a loop will not get stuck on a bad
block which causes the disk or SD card detach.


# ca9acde2 09-May-2020 Poul-Henning Kamp <phk@FreeBSD.org>

Don't send clear screen until we are committed to run.


# 9546e08e 02-Apr-2020 Poul-Henning Kamp <phk@FreeBSD.org>

Add two options to recoverdisk(1) inspired by a recent
data-archæology project:

-u pattern

Fill unread parts of the output with pattern.
Default pattern is "_UNREAD_", empty pattern disables.

-v

Fancy status reporting using ANSI escapes and UTF-8


# ec835c9d 07-Feb-2019 Andriy Voskoboinyk <avos@FreeBSD.org>

recoverdisk(1): fclose() file supplied via '-r readlist' parameter when
it's no longer needed

PR: 204952
Reported by: David Binderman <dcb314@hotmail.com>
MFC after: 5 days


# 64de3fdd 30-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

SPDX: use the Beerware identifier.


# f32d2926 30-Apr-2016 Pedro F. Giffuni <pfg@FreeBSD.org>

sbin: ake use of our rounddown() macro when sys/param.h is available.

No functional change.


# d44ae92a 14-Mar-2013 Xin LI <delphij@FreeBSD.org>

Correct type for DIOCGSTRIPESIZE. Without this there
would be a stack overflow which will crash the program
later.

PR: bin/176953
Submitted by: r4721 tormail org
MFC after: 3 days


# 399fe479 04-Feb-2013 Xin LI <delphij@FreeBSD.org>

Use stripesize as smallest block size if it's available.

MFC after: 2 weeks


# 1efe3c6b 04-Nov-2011 Ed Schouten <ed@FreeBSD.org>

Add missing static keywords for global variables to tools in sbin/.

These tools declare global variables without using the static keyword,
even though their use is limited to a single C-file, or without placing
an extern declaration of them in the proper header file.


# 5df69e92 01-May-2011 Ulrich Spörlein <uqs@FreeBSD.org>

recoverdisk(8): treat output file consistently and abort on EINVAL

This improves usability a little as we no longer require using touch.
Also reword the manpage wrt. parameters and fix usage() [1]

With no media in a cd(4) drive, the reads will loop producing EINVAL,
abort in that case [2].

Document the shortcoming of sectorsize and MAXPHYS (a quick solution
to this might be having MAXPHYS as the "bigsize", in short testing it
didn't make a difference on throughput).

Submitted by: arundel [1]
PR: bin/154528 [2]


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# 0353e472 23-Mar-2009 Poul-Henning Kamp <phk@FreeBSD.org>

Save (empty) worklist at successful completion


# d81c1141 11-Mar-2009 Ed Schouten <ed@FreeBSD.org>

Also use %zu to print the allocation size when malloc(3) fails.

Discussed with: phk


# ab5792a9 11-Mar-2009 Poul-Henning Kamp <phk@FreeBSD.org>

Fix printf warnings on amd64 etc.


# 584f5546 11-Mar-2009 Poul-Henning Kamp <phk@FreeBSD.org>

Some improvements to recoverdisk


# 972b3f30 17-Jan-2009 Poul-Henning Kamp <phk@FreeBSD.org>

Bail on ENXIO, you won't get any further any way.

Submitted by: tobez


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# 601c3cc0 22-Apr-2007 Poul-Henning Kamp <phk@FreeBSD.org>

Improve reporting in recoverdisk a good deal.

Submitted by: Ulrich Spoerlein <uspoerlein@gmail.com>
PR: 111630


# 89d500c6 30-May-2006 Matteo Riondato <matteo@FreeBSD.org>

Make recoverdisk compile on amd64 and possibly other 64bit archs.
Bump WARNS to 6.

PR: amd64/97566
Reviewed by: phk@
MFC after: 3 days


# fd64dc9a 06-May-2006 Maxim Konovalov <maxim@FreeBSD.org>

o Take an account a media sectorsize for medium and bigsize calculation.
o Introduce -r and -w keys which allow to load and save a worklist.
o Replace README by man page.

PR: bin/96677
Submitted by: Ulrich Spoerlein
Approved by: phk
MFC after: 1 month


# db45c56d 29-Aug-2005 Maxim Sobolev <sobomax@FreeBSD.org>

Extend utility to allow recovering single file from the deffective
media.

MFC after: 2 weeks


# dadba0d1 23-Oct-2004 Dag-Erling Smørgrav <des@FreeBSD.org>

Use %zu to format size_t instead of %jd and an intmax_t cast.

Approved by: hamlet


# 091aa096 22-Oct-2004 Poul-Henning Kamp <phk@FreeBSD.org>

Stop amd64 warnings.


# 1f6ac570 08-Oct-2004 Poul-Henning Kamp <phk@FreeBSD.org>

Only print progress statistics once per second.


# 39d969ae 28-Sep-2004 Poul-Henning Kamp <phk@FreeBSD.org>

This is a small tool which will read an entire disk(partition) using
1M blocks and optionally write the read data to a file or disk.

If a read error happens, the 1M block gets put on the end of the worklist
and will be retried with 64k blocksize.

If a read error happens again, the 64k block gets put at the end of the
worklist and will be retried with single sector reads.

The program keeps trying until you stop it.

You can refresh a disk:

recoverdisk /dev/ad1 /dev/ad1

or salvage a floppy:

recoverdisk /dev/fd0 myfloppy.flp